开发者

Loading Crystal Report from embedded resource

开发者 https://www.devze.com 2023-02-20 18:05 出处:网络
I have an ASP.NET website and a referenced class library project. In t开发者_运维知识库his class library I have a Crystal Report set as embedded resource. I want to load the report dynamically into a

I have an ASP.NET website and a referenced class library project. In t开发者_运维知识库his 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?


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;
0

精彩评论

暂无评论...
验证码 换一张
取 消