在vb.net中如何从程序中传条件查询给水晶报表子报表?
解决方案 »
- respose.Redircet()能控制跳转页面的大小吗
- 关于asp.net datatable 合并问题
- ASP.NET创建SQL表时提示错误,求高手帮帮忙啊
- 怎样将DropDownList的成员清空成为一个内容为空的下拉列表
- asp.net2005数据访问:零代码还是分层架构?
- 如何截取字符串?
- 请教大家一个多页面之间数据传递的问题
- 自定义服务器控件如何在页面任意位置输出内容。如在body标记中添加事件
- 请教:"http/1.1 500 serrer error"
- web自定义控件:如何写一属性,就象DropDownList的Items一样?
- 请问这两种去SESSION的方式有什么不同?
- 求在asp.net后台代码中将word文档另存为文本文件的代码!!!!!!!(c#)
Function showSubReport(ByVal mainReport As ReportClass, ByVal StorePName As String, ByVal PN() As String, ByVal PV() As String, ByVal TableName As String, ByVal SubReportName As String)
Dim SubReport As New ReportDocument()
SubReport = mainReport.OpenSubreport(SubReportName)
Dim Ds As New DataSet() : Dim Ca As New ClassData()
Ds = Ca.DS(StorePName, PV, PN)
Ds.Tables(0).TableName = TableName
SubReport.SetDataSource(Ds)
SubReport.Refresh()
End Function
执行到这句crReportDocument1 = crReportDocument.OpenSubreport("Subreport1")
这里应该传入报表的文件名"report1.rpt"啊.而不是子报表对象的名称.这里是CS下的:
'显示子报表
Function showSubReport(ByVal mainReport As ReportClass, ByVal Ds As DataSet, ByVal TableName As String, ByVal SubReportControlName As String)
'Dim SubReport As New ReportDocument()
'SubReport = mainReport.OpenSubreport(SubReportName)
Ds.Tables(0).TableName = TableName
'SubReport.SetDataSource(Ds)
'SubReport.Refresh()
Dim subreportName As String
Dim subreportObject As SubreportObject
Dim subreport As New ReportDocument()
If TypeOf (mainReport.ReportDefinition.ReportObjects.Item(SubReportControlName)) Is SubreportObject Then
subreportObject = mainReport.ReportDefinition.ReportObjects.Item(SubReportControlName)
' 获取子报表名称。
SubReportName = SubreportObject.SubreportName
' 打开子报表作为 ReportDocument。
subreport = SubreportObject.OpenSubreport(SubReportName)
' 预览子报表。
subreport.SetDataSource(Ds)
subreport.Refresh()
End If
End Function这里传的是子报表对象的名称
BS跟CS是不同的.