Loading Crystal Report from embedded resource

时光怂恿深爱的人放手 提交于 2019-12-23 14:58:52

问题


I have an ASP.NET website and a referenced class library project. In this class library I have a Crystal Report set as embedded resource. I want to load the report dynamically into a CrystalReportViewer.

How do I do it?


回答1:


I figured out how to solve that problem. When a Crystal Report is added to a Class Library project, it creates a corresponding class, which inherits from ReportClass. An instance of this class can be used as ReportSource of the viewer.

Example:

var report = new CrystalReport1();
report.SetDataSource(datasource);
CrystalReportViewer1.ReportSource = report;


来源:https://stackoverflow.com/questions/5474086/loading-crystal-report-from-embedded-resource

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!