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;
		}
		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;
		}
Example #3
0
		public static IReportGenerator Create (ReportModel model,ReportStructure reportStructure)			                                     
		                                       
		{	
			IReportGenerator reportGenerator = null;
				switch (model.DataModel) {
				case GlobalEnums.PushPullModel.PullData:
					reportGenerator = new GeneratePullDataReport(model,reportStructure);
					break;
				case GlobalEnums.PushPullModel.PushData:
					reportGenerator = new GeneratePushDataReport(model,reportStructure);
					break;
				case GlobalEnums.PushPullModel.FormSheet:
					reportGenerator = new GenerateFormSheetReport (model,reportStructure);
					break;
			}
			return reportGenerator;
		}
		public static IReportGenerator Create (ReportModel model,		                                     
		                                       Properties customizer)
		{	
			IReportGenerator reportGenerator = null;
				switch (model.DataModel) {
				case GlobalEnums.PushPullModel.PullData:
					reportGenerator = new GeneratePullDataReport(model,customizer);
					
					break;
				case GlobalEnums.PushPullModel.PushData:
					reportGenerator = new GeneratePushDataReport(model,customizer);
					break;
				case GlobalEnums.PushPullModel.FormSheet:
					reportGenerator = new GenerateFormSheetReport (model,customizer);
					break;
			}
			return reportGenerator;
		}
Example #5
0
        public static IReportGenerator Create(ReportModel model, ReportStructure reportStructure)

        {
            IReportGenerator reportGenerator = null;

            switch (model.DataModel)
            {
            case GlobalEnums.PushPullModel.PullData:
                reportGenerator = new GeneratePullDataReport(model, reportStructure);
                break;

            case GlobalEnums.PushPullModel.PushData:
                reportGenerator = new GeneratePushDataReport(model, reportStructure);
                break;

            case GlobalEnums.PushPullModel.FormSheet:
                reportGenerator = new GenerateFormSheetReport(model, reportStructure);
                break;
            }
            return(reportGenerator);
        }
Example #6
0
        public static IReportGenerator Create(ReportModel model,
                                              Properties customizer)
        {
            IReportGenerator reportGenerator = null;

            switch (model.DataModel)
            {
            case GlobalEnums.PushPullModel.PullData:
                reportGenerator = new GeneratePullDataReport(model, customizer);

                break;

            case GlobalEnums.PushPullModel.PushData:
                reportGenerator = new GeneratePushDataReport(model, customizer);
                break;

            case GlobalEnums.PushPullModel.FormSheet:
                reportGenerator = new GenerateFormSheetReport(model, customizer);
                break;
            }
            return(reportGenerator);
        }