![Report Report]()
错误图片 水晶报告外观 DB Connecion 请帮助我,我一直试图解决这个问题2个月 Hi AllI have been trying to solve passing parameters in Cyrstal report,What I have done is : 1) I added cyrstal repot in my project, 2) I connect with database using OLE DB (ADO) in database Expert form (For your kind information; I did not create or add DataSet1.xsd file the cyrstal report worked on below code with out parameters and I want report with parameter)3) I added below piece of code on my form load eventWhen I try to pass parameter using .SetparameterValue Function, report pop up with bunch of values BUT it does not filter with values which I wantHere is helping imagesError ImageCrystal report lookDB ConnecionPLEASE HELP ME, I HAVE BEEN TRYING TO SOLVE THIS CODE SINCE 2 MONTHSPublic Class frmrptProducts Private Sub frmrptProducts_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim cryRpt As New ReportDocument Dim CrTables As Tables Dim crtableLogoninfo As New TableLogOnInfo Dim crConnectionInfo As New ConnectionInfo 'Try 'load report cryRpt.Load(ReportPath & "CRproducts.rpt") 'parameters definition(if any) Dim ColourName As String = "White" cryRpt.SetParameterValue("colours", ColourName) 'provide connection info. This is important and you can change it as per your db location With crConnectionInfo .ServerName = My.Application.Info.DirectoryPath.ToString() & "\data\db.mdb" '.DatabaseName = "" '.UserID = "" .Password = "" End With CrTables = cryRpt.Database.Tables For Each CrTable In CrTables crtableLogoninfo = CrTable.LogOnInfo crtableLogoninfo.ConnectionInfo = crConnectionInfo CrTable.ApplyLogOnInfo(crtableLogoninfo) Next CRV.ReportSource = cryRpt CRV.Refresh() 'Catch ex As Exception ' MsgBox(ex.Message) 'End Try End Sub 推荐答案 这篇关于在VB.NET中传递水晶报表中的参数时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 11-03 06:24