Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/297.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# RDLC报表Windows应用程序(VB.NET)中的小问题_C#_Winforms_Reporting Services_Rdlc_Vb.net 2010 - Fatal编程技术网

C# RDLC报表Windows应用程序(VB.NET)中的小问题

C# RDLC报表Windows应用程序(VB.NET)中的小问题,c#,winforms,reporting-services,rdlc,vb.net-2010,C#,Winforms,Reporting Services,Rdlc,Vb.net 2010,我在创建RDLC报告时出错,参数rpP缺少一个值(参考附件图像)。我已经检查了rpP&rpP有来自数据库的值 虽然当我点击刷新按钮(手动)时,它会正确显示所有数据。调试参数时,rpP已被赋值。但我不知道为什么它会显示这个错误 代码: 另外,如何导出到EXCEL文件或在EXCEL文件中打印 谢谢ds.Tables(0)中有多少行。行?是否有一种方法可以一次添加一个参数?如果您想要reporting services的功能,为什么不使用reporting services?用户可以使用“保存”按钮

我在创建RDLC报告时出错,参数rpP缺少一个值(参考附件图像)。我已经检查了rpP&rpP有来自数据库的值

虽然当我点击刷新按钮(手动)时,它会正确显示所有数据。调试参数时,rpP已被赋值。但我不知道为什么它会显示这个错误

代码:

另外,如何导出到EXCEL文件或在EXCEL文件中打印


谢谢

ds.Tables(0)中有多少行。行?是否有一种方法可以一次添加一个参数?如果您想要reporting services的功能,为什么不使用reporting services?用户可以使用“保存”按钮导出文件,如果您想要以代码导出,则:@surven ds.Tables(0).Rows是12,但现在我用TOP 1子句修复了存储过程,尽管仍然得到相同的错误。但问题是,当我手动单击报告上的刷新按钮时,它会正确显示所有记录[IMG]
            For Each drBody As DataRow In ds.Tables(0).Rows
            pName1 = CType(drBody("Name"), String)
            Me.ReportViewer1.LocalReport.Refresh()
            'ReportViewer1.LocalReport.ReportPath = Application.ExecutablePath
            Dim PICpATH As String = CType(drBody("ImagePath"), String)
            Dim passport As String = CType(drBody("PassportNo"), String)
            Dim arrParam(22) As ReportParameter
            arrParam(0) = New ReportParameter("rp", pName1.ToString(), True)
            **arrParam(1) = New ReportParameter("rpP", passport, True)**
            arrParam(2) = New ReportParameter("rpSocIncNo", CType(drBody("SocIncNo"), String), True)
            arrParam(3) = New ReportParameter("rpMartialStstus", CType(drBody("MartialStstus"), String), True)
            arrParam(4) = New ReportParameter("rpChildren", CType(drBody("Children"), String), True)
            arrParam(5) = New ReportParameter("rpChildrenAges", CType(drBody("ChildrenAges"), String), True)
            arrParam(6) = New ReportParameter("rpEmploymentDate", CType(drBody("EmploymentDate"), String), True)
            arrParam(7) = New ReportParameter("rpOccupation_Full", CType(drBody("Occupation_Full"), String), True)
            arrParam(8) = New ReportParameter("rpDepartment", CType(drBody("Department"), String), True)
            arrParam(9) = New ReportParameter("rpPosition", CType(drBody("Position"), String), True)
            arrParam(10) = New ReportParameter("rpJobDescription", CType(drBody("JobDescription"), String), True)
            arrParam(11) = New ReportParameter("rpLandline", CType(drBody("Landline"), String), True)
            arrParam(12) = New ReportParameter("rpMobile", CType(drBody("Mobile"), String), True)
            arrParam(13) = New ReportParameter("rpStreet", CType(drBody("Street"), String), True)
            arrParam(14) = New ReportParameter("rpDistrict", CType(drBody("District"), String), True)
            arrParam(15) = New ReportParameter("rpTown", CType(drBody("Town"), String), True)
            arrParam(16) = New ReportParameter("rpPostalCode", CType(drBody("PostalCode"), String), True)
            arrParam(17) = New ReportParameter("rpInsurance", CType(drBody("Insurance"), String), True)
            arrParam(18) = New ReportParameter("rpStart", CType(drBody("Start"), String), True)
            arrParam(19) = New ReportParameter("rpEndDate", CType(drBody("EndDate"), String), True)
            arrParam(20) = New ReportParameter("rpDisablilities", CType(drBody("Disablilities"), String), True)
            arrParam(21) = New ReportParameter("rpdob", CType(drBody("DoB"), String), True)
            arrParam(22) = New ReportParameter("rpNationality", CType(drBody("Nationality"), String), True)
            Me.ReportViewer1.LocalReport.SetParameters(New ReportParameter() {arrParam(0), arrParam(1), arrParam(2), arrParam(3), arrParam(4), arrParam(5), arrParam(6), arrParam(7), arrParam(8), arrParam(9), arrParam(10), arrParam(11), arrParam(12), arrParam(13), arrParam(14), arrParam(15), arrParam(16), arrParam(17), arrParam(18), arrParam(19), arrParam(20), arrParam(21), arrParam(22)})
        Next
        ReportViewer1.LocalReport.DataSources.Clear()
        ReportViewer1.LocalReport.DataSources.Add(rds)
        Me.ReportViewer1.LocalReport.Refresh()