解决方法:打开 Global.asax.cs, 在这个里面去配置
- [6/28 下午8:34] Sergey Romanov
- in global.asax, you can change the initialization setting to protected void Application_Start(object sender, EventArgs e) {
- this.UseReporting(settings =>
- {
- settings.UseFileStore(new DirectoryInfo(Server.MapPath("~")));
- settings.UseCompression = true;
- settings.SetLocateDataSource(args => { return LoadData(); });
- });
- }
-
复制代码
示例代码如下:
- this.UseReporting(settings =>
- {
- settings.UseFileStore(new DirectoryInfo("~"));
- settings.UseCompression = true;
- settings.SetLocateDataSource(args => {
- System.Data.DataTable dt = new System.Data.DataTable();
- if (args.Report.DataSets[0].Name == "DataSet1")
- {
-
- dt.Columns.Add("Field1");
- dt.Columns.Add("Field2");
- dt.Rows.Add("1", "1");
- dt.Rows.Add("2", "2");
-
- }
- return dt;
- });
-
- });
复制代码
|