public static ReportModel CreateModel (string reportName,bool createGrouping) { ReportStructure reportStructure = CreateReportStructure(reportName); AvailableFieldsCollection abstractColumns = new AvailableFieldsCollection(); AbstractColumn a1 = new AbstractColumn("Field1",typeof(System.String)); reportStructure.AvailableFieldsCollection.Add(a1); ICSharpCode.Reports.Core.BaseDataItem bri = new ICSharpCode.Reports.Core.BaseDataItem(); bri.Name ="Field1"; reportStructure.ReportItemCollection.Add(bri); if (createGrouping) { reportStructure.Grouping = "group"; } ReportModel m = reportStructure.CreateAndFillReportModel(); IReportGenerator generator = new GeneratePushDataReport(m,reportStructure); generator.GenerateReport(); ReportLoader rl = new ReportLoader(); object root = rl.Load(generator.XmlReport.DocumentElement); ReportModel model = root as ReportModel; if (model != null) { model.ReportSettings.FileName = GlobalValues.PlainFileName; FilePathConverter.AdjustReportName(model); } else { throw new InvalidReportModelException(); } return model; }
private ReportModel CreateModel() { ReportModel m = ReportModel.Create(); Properties customizer = new Properties(); customizer.Set("ReportLayout", GlobalEnums.ReportLayout.ListLayout); IReportGenerator generator = new GeneratePlainReport(m, customizer); generator.GenerateReport(); ReportLoader rl = new ReportLoader(); // Console.WriteLine (generator.XmlReport.DocumentElement); object root = rl.Load(generator.XmlReport.DocumentElement); ReportModel model = root as ReportModel; if (model != null) { model.ReportSettings.FileName = GlobalValues.PlainFileName; FilePathConverter.AdjustReportName(model); } else { throw new InvalidReportModelException(); } return(model); }
public static ReportModel CreateModel (string reportName) { ReportStructure structure = CreateReportStructure(reportName); AvailableFieldsCollection abstractColumns = new AvailableFieldsCollection(); AbstractColumn a1 = new AbstractColumn("Field1",typeof(System.String)); structure.AvailableFieldsCollection.Add(a1); ICSharpCode.Reports.Core.BaseDataItem bri = new ICSharpCode.Reports.Core.BaseDataItem(); bri.Name ="Field1"; structure.ReportItemCollection.Add(bri); ReportModel m = structure.CreateAndFillReportModel(); ICSharpCode.Core.Properties customizer = new ICSharpCode.Core.Properties(); customizer.Set("Generator", structure); customizer.Set("ReportLayout",GlobalEnums.ReportLayout.ListLayout); IReportGenerator generator = new GeneratePushDataReport(m,customizer); generator.GenerateReport(); ReportLoader rl = new ReportLoader(); object root = rl.Load(generator.XmlReport.DocumentElement); ReportModel model = root as ReportModel; if (model != null) { model.ReportSettings.FileName = GlobalValues.PlainFileName; FilePathConverter.AdjustReportName(model); } else { throw new InvalidReportModelException(); } return model; }
public void CallData(int key) { loader = new ReportLoader(); dataPerUser = new FormData(); loader.SetStorage(CallerData.GetStorage()); dataPerUser = loader.Load(key); ExtractInfo(); }
public void TestNameIsLoaded() { for (int key = 0; key < keyTotals; ++key) { Assert.AreEqual(data[key].name, loader.Load(key).name); } }
public static ReportModel CreateModel(string reportName, bool createGrouping) { ReportStructure structure = CreateReportStructure(reportName); AvailableFieldsCollection abstractColumns = new AvailableFieldsCollection(); AbstractColumn a1 = new AbstractColumn("Field1", typeof(System.String)); structure.AvailableFieldsCollection.Add(a1); ICSharpCode.Reports.Core.BaseDataItem bri = new ICSharpCode.Reports.Core.BaseDataItem(); bri.Name = "Field1"; structure.ReportItemCollection.Add(bri); if (createGrouping) { structure.Grouping = "group"; } ReportModel m = structure.CreateAndFillReportModel(); ICSharpCode.Core.Properties customizer = new ICSharpCode.Core.Properties(); customizer.Set("Generator", structure); customizer.Set("ReportLayout", GlobalEnums.ReportLayout.ListLayout); IReportGenerator generator = new GeneratePushDataReport(m, customizer); generator.GenerateReport(); ReportLoader rl = new ReportLoader(); object root = rl.Load(generator.XmlReport.DocumentElement); ReportModel model = root as ReportModel; if (model != null) { model.ReportSettings.FileName = GlobalValues.PlainFileName; FilePathConverter.AdjustReportName(model); } else { throw new InvalidReportModelException(); } return(model); }
private ReportModel CreateModel () { ReportModel m = ReportModel.Create(); Properties customizer = new Properties(); customizer.Set("ReportLayout",GlobalEnums.ReportLayout.ListLayout); IReportGenerator generator = new GenerateFormSheetReport(m,customizer); generator.GenerateReport(); ReportLoader rl = new ReportLoader(); object root = rl.Load(generator.XmlReport.DocumentElement); ReportModel model = root as ReportModel; if (model != null) { model.ReportSettings.FileName = GlobalValues.PlainFileName; FilePathConverter.AdjustReportName(model); } else { throw new InvalidReportModelException(); } return model; }
private ReportModel CreateModel () { ReportModel m = ReportModel.Create(); ReportStructure reportStructure = new ReportStructure() { ReportLayout = GlobalEnums.ReportLayout.ListLayout }; IReportGenerator generator = new GenerateFormSheetReport(m,reportStructure); generator.GenerateReport(); ReportLoader loader = new ReportLoader(); object root = loader.Load(generator.XmlReport.DocumentElement); ReportModel model = root as ReportModel; model.ReportSettings.FileName = GlobalValues.PlainFileName; FilePathConverter.AdjustReportName(model); return model; }
private ReportModel CreateModel() { ReportModel m = ReportModel.Create(); ReportStructure reportStructure = new ReportStructure() { ReportLayout = GlobalEnums.ReportLayout.ListLayout }; IReportGenerator generator = new GenerateFormSheetReport(m, reportStructure); generator.GenerateReport(); ReportLoader loader = new ReportLoader(); object root = loader.Load(generator.XmlReport.DocumentElement); ReportModel model = root as ReportModel; model.ReportSettings.FileName = GlobalValues.PlainFileName; FilePathConverter.AdjustReportName(model); return(model); }