Specifying a report
假設該示例報告已添加到您的.NET項目:
Dim parameter1 As CrystalDecisions.Shared.ParameterField
Dim parameter2 As CrystalDecisions.Shared.ParameterField
With SampleReport
.SetDatabaseLogon("user", "password", "server", "database")
'locate first parameter in report
parameter1 = .ParameterFields.Find("@p1", "")
'locate second parameter in report
parameter2 = .ParameterFields.Find("@p2", "")
End With
'create a new discrete-parameter value
Dim stringValue As New CrystalDecisions.Shared.ParameterDiscreteValue()
stringValue.Value = "USA"
'assign it to the parameter's current values collection
parameter1.CurrentValues.Add(stringValue)
'create a new discrete-parameter value
Dim numberValue As New CrystalDecisions.Shared.ParameterDiscreteValue()
numberValue.Value = 100
'assign it to the parameter's current values collection
parameter2.CurrentValues.Add(numberValue)
With Me.CrystalReportViewer1
.ReportSource = SampleReport
End With
我認爲賞金會吸引更多的人回答它迫切... – Eimantas 2009-11-24 10:46:35
如何賞金? – odiseh 2009-11-24 11:02:50
你不能開始一個在過去48小時內沒有被問到的問題的賞金... – romaintaz 2009-11-24 11:35:05