回复 1楼76856123的帖子
76856123 你好,
rpx 为 XML 模板文件,因此我们在给 viewer 赋值时需要使用 LoadLayout 方法去加载该文件,方法如下:
- private void Form1_Load(object sender, EventArgs e)
- {
- DataDynamics.ActiveReports.ActiveReport rpt = new DataDynamics.ActiveReports.ActiveReport();
- string filename = Application.StartupPath + "\\..\\..\\ActiveReport1.rpx";
- rpt.LoadLayout(filename);
- rpt.Run();
- this.viewer1.Document = rpt.Document;
- }
复制代码 |