您好
如上午沟通,问题重现,了解实现需求返回多个 DataTable的。所以建议走以下代码:- app.UseReporting(settings =>
- {
- settings.UseFileStore(new DirectoryInfo(@"D:\Demo"));
- settings.LocateDataSource = args =>
- {
- DataSet customerOrders = new DataSet("DataSource1");
- DataTable dt = new DataTable("Test");
- dt.Columns.Add("Field1");
- dt.Columns.Add("Field2");
- dt.Rows.Add("1", "苹果");
- dt.Rows.Add("2", "葡萄");
- dt.Rows.Add("3", "葡萄11");
- DataTable dt2 = new DataTable("Test2");
- dt2.Columns.Add("Field1");
- dt2.Columns.Add("Field2");
- dt2.Rows.Add("01", "苹果");
- dt2.Rows.Add("02", "葡萄");
- dt2.Rows.Add("03", "葡萄11");
- customerOrders.Tables.Add(dt);
- customerOrders.Tables.Add(dt2);
- if (args.DataSet.Name == "DataSet1")
- return customerOrders.Tables[0];
- if (args.DataSet.Name == "DataSet2")
- return customerOrders.Tables[1];
- return customerOrders.Tables[1];
- };
- settings.UseCompression = true;
- });
复制代码
|