水晶报告中没有有效的报告源可用错误 [英] No valid report source is available error in crystal report
问题描述
在asp.net中创建水晶报表后,我必须继续下一页C#。发生以下错误。
没有有效的报告来源
Plz帮助我..
< blockquote>参考一些类似的主题:
否有效的报告来源可用 - 水晶报告 [ ^ ]
否有效报告来源可用 [ ^ ]
没有有效的报告来源。在asp.net水晶报告 [ ^ ]
没有有效的报告源 - 水晶报告 [ ^ ]
#简单的解决方案(虽然这段代码是一个vb.net代码;但是这个想法很简单)
我刚刚使用CrystalReportViewer解决了这个问题* *导航活动**
查看报告按钮我已在会话中保存报告文件
受保护的 Sub B utton1_Click( ByVal sender 作为 对象,< span class =code-keyword> ByVal e As EventArgs)句柄 Button1.Click
' - ds是包含要在报告中显示的数据的数据集变量
rptDoc.SetDataSource(ds)
Session.Add( rptdoc,rptDoc)
CrystalReportViewer1.ReportSource = rptDoc
结束 Sub
然后在CrystalReportViewer的Navigate事件中我将CrystalReportViewer数据源设置为Session
受保护的 Sub j( ByVal 来源作为 对象, ByVal e 作为 CrystalDecisions.Web.NavigateEventArgs)句柄 CrystalReportViewer1.Navigate
rpt.SetDataSource(ds)
CrystalReportViewer1.ReportSource = session( rptdoc)
结束 Sub
因此,每次在导航到报表中的其他页面之前,CrystalReportViewer数据源都会设置为会话中保存的报表文档。
After creating crystal reports in asp.net,C# when i have to go on next page.following error occurs.
No valid report source is available
Plz help me..
Refer some similar threads:
No valid report source is available- crystal reports[^]
No Valid report source is available[^]
No valid report source is available. in asp.net crystal report[^]
No valid report source is available- crystal reports [^]
#Simple Solution ( although this code is a vb.net code ; but the idea is same and simple )
I have just Solved this problem using CrystalReportViewer **Navigate Event**
in View report Button i have saved report document in a session
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click ' -- the ds is dataset variable containing data to be displayed in the report rptDoc.SetDataSource(ds) Session.Add("rptdoc", rptDoc) CrystalReportViewer1.ReportSource = rptDoc End Sub
then in Navigate event of CrystalReportViewer i set the CrystalReportViewer data source to the Session
Protected Sub j(ByVal source As Object, ByVal e As CrystalDecisions.Web.NavigateEventArgs) Handles CrystalReportViewer1.Navigate rpt.SetDataSource(ds) CrystalReportViewer1.ReportSource = session("rptdoc") End Sub
So each time before you navigate to another page in the report , CrystalReportViewer data source is set to the report document saved in the session.
这篇关于水晶报告中没有有效的报告源可用错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!