我正在调用包含子报告RepHeaderSub.rpt的报告,我想将值传递给参数in 子报表。我使用了下面的代码,但它给出了错误'索引超出了数组的范围' 在传递参数到子报告的行。请帮我纠正
Dim cryRpt As New ReportDocument
cryRpt.Load(appPath & "\Reports\ConsumableLPO.rpt")
cryRpt.SetDatabaseLogon("sa", "dbr123")
frmRptViewer.CrystalReportViewer1.ReportSource = cryRpt
cryRpt.SetParameterValue("@Companyname", "ABC Company", "RepHeaderSub.rpt")
cryRpt.RecordSelectionFormula = "{vComsumableLPO.lpono} ='" & txtLpoNo.Text & "'"
frmRptViewer.Show()
frmRptViewer.CrystalReportViewer1.Refresh()