【发布时间】:2009-09-11 15:54:41
【问题描述】:
我正在使用 CrystalReportViewer 和 CrystalReportSource 在我的应用程序中加载和显示一个 .rpt 文件。
我的情况是这样的:
假设有人在我的应用程序之外创建了一个水晶报表并将其数据源设置为数据库 A。然后我在我的应用程序中使用该 .rpt 文件,但我需要将它绑定到不同的数据库(在术语上与原始数据库相同)表结构和列名,但使用不同的用户名和密码使用不同的连接字符串)。我如何在 C# 中做到这一点?
目前我使用以下方式加载报告:
this.CrystalReportSource1.ReportDocument.Load(reportsSubfolder + report.ReportFileName);
//it is here that I need to change the connection data of the report.
【问题讨论】:
标签: c# crystal-reports