// 加载报表
private void LoadReport( )
{
GrapeCity.ActiveReports.PageReport report = new GrapeCity.ActiveReports.PageReport();
//load the report layout
report.Load(new System.IO.FileInfo(Server.MapPath("") + "..\\..\\Reports\\pwxkz1.rdlx"));
// report.Document.LocateDataSource += WebViewer1_LocateDataSource;
WebViewer1.LocateDataSource += WebViewer1_LocateDataSource;
WebViewer1.Report = report;
WebViewer1.ViewerType = GrapeCity.ActiveReports.Web.ViewerType.FlashViewer;
WebViewer1.FlashViewerOptions.TocPanelOptions.ShowThumbnails = false;
WebViewer1.FlashViewerOptions.TocPanelOptions.ShowToc = true;
WebViewer1.FlashViewerOptions.TocPanelOptions.Visible = true;
WebViewer1.FlashViewerOptions.ShowSplitter = false;
//WebViewer1.FlashViewerOptions.TocPanelOptions.
}
void WebViewer1_LocateDataSource(object sender, GrapeCity.ActiveReports.
LocateDataSourceEventArgs args)
{
if (args.DataSourceName == "DataSource1")
{
//动态绑定数据集
switch (args.DataSetName)
{
case "DischargePermit":
args.Data = GetDataSource("\\data\\DischargePermit.txt");
break;
case "DrainOutlet":
args.Data = GetDataSource("\\data\\DrainOutlet.txt");
break;
default:
break;
}
}
}
只加载第一个数据源。怎么加载2个数据源? |
|