有两种,一种是公用的,直接在usereporting里面设计并返回:
- app.UseReporting(config => {
- config.SetLocateDataSource((args) => {
- DataTable dt = new DataTable();
- return dt;
- });
- config.UseFileStore(ResourcesRootDirectory);
- });
复制代码 另一种是我们写自定义的报表加载,报表的预览返回直接走UseCustomStore
相当于自定义报表返回,然后在报表加载的时候,去加载自定义数据源
- app.UseReporting(config => {
- config.UseCustomStore(getReport);
- });
- private object getReport(string reportName)
- {
- PageReport report = new PageReport();
- report.Load(new FileInfo(""));
- report1.Document.LocateDataSource += new GrapeCity.ActiveReports.LocateDataSourceEventHandler(Document_LocateDataSource);
- .......
- return report;
- }
复制代码
|