嗨我知道这个问题会被认为是重复的,因为有很多关于这类问题的回答问题,我试图尝试可能正确的代码或回答这类问题,但似乎我没有运气我决定问这个问题。
我在水晶报告中有两个参数,我需要通过这个来自vb.net来显示每月报告,但是在我运行报告查看器之后它只显示空白纸我想知道这有什么不对我认为这段代码是正确的但显然不起作用我希望你帮助我谢谢。
'Print stock out monthly report
Dim stockOutMonthlyPeriodReport As New StockOutMonthlyPeriodReport
Dim stockOutMonthlyPeriodViewer As New StockOutMonthlyReportViewer
Dim paramFields As New ParameterFields
Dim param1Field, param2Field As New ParameterField
Dim param1Range, param2Range As New ParameterDiscreteValue
reportTimePeriodTextObject = stockOutMonthlyPeriodReport.Section1.ReportObjects("monthlyTextObject")
reportTimePeriodTextObject.Text = "Monthly Report of " & monthlyReportComboBox.Text & " Year " & monthlyYearReportComboBox.Text
param1Field.ParameterFieldName = "timePeriodMonthName" ' Parameter Name In Crystal Report param2Field.ParameterFieldName = "timePeriodYear" ' Parameter Name In Crystal Report
param1Range.Value = monthlyReportComboBox.Text
param1Field.CurrentValues.Add(param1Range)
paramFields.Add(param1Field)
param2Field.ParameterFieldName = "timePeriodYear" ' Parameter Name In Crystal Report
param2Range.Value = yearlyReportComboBox.Text
param2Field.CurrentValues.Add(param2Range)
paramFields.Add(param2Field)
stockOutMonthlyPeriodViewer.StockOutMonthlyCrystalViewer.ParameterFieldInfo = paramFields 'to pass parameter inf.to CRV
stockOutMonthlyPeriodViewer.StockOutMonthlyCrystalViewer.ReportSource = stockOutMonthlyPeriodReport ' Assign Report Source to CRV
stockOutMonthlyPeriodViewer.Show()
答案 0 :(得分:0)
我设置了这样的参数。
stockOutMonthlyPeriodReport.SetParameterValue("name of param", value)