示例#1
0
		public AbstractLayout(ReportModel reportModel)
		{
			if (reportModel == null) {
				throw new ArgumentNullException("reportModel");
			}
			this.ReportModel = reportModel;
		}
		/// <summary>
		/// Default constructor - initializes all fields to default values
		/// </summary>
		public GeneratePushDataReport(ReportModel reportModel,		                              
		                              Properties properties):base(reportModel,properties)
		{
			
			base.UpdateGenerator();
			base.UpdateModel();
		}
示例#3
0
		public ListLayout(ReportModel reportModel,ReportItemCollection reportItemCollection):base(reportModel)
		{
			this.reportItems = reportItemCollection;
			ICSharpCode.Reports.Core.BaseRowItem row = new ICSharpCode.Reports.Core.BaseRowItem();
			AdjustContainer(base.ReportModel.DetailSection,row);
			base.ParentItem = row;
		}
示例#4
0
		public CollectParametersCommand (ReportModel model)
		{
			if (model == null) {
				throw new ArgumentNullException("model");
			}
			this.model = model;
		}
示例#5
0
		public static ReportModel Create() 
		{
			ReportModel m = new ReportModel();
			foreach (GlobalEnums.ReportSection sec in Enum.GetValues(typeof(GlobalEnums.ReportSection))) {
				m.SectionCollection.Add (SectionFactory.Create(sec.ToString()));
			}
			return m;
		}
		public GeneratePullDataReport(ReportModel reportModel,ReportStructure reportStructure):base(reportModel,reportStructure)		                              		                             	                         
		{
			if (reportModel == null) {
				throw new ArgumentNullException("reportModel");
			}
			base.UpdateGenerator();
			base.UpdateModel();
			base.SqlQueryParameters.AddRange(base.ReportStructure.SqlQueryParameters);
		}
示例#7
0
		public void AddContent (ReportModel reportModel)
		{
			
			if (reportModel == null) {
				throw new ArgumentNullException("reportModel");
			}
			this.reportModel = reportModel;
			this.explorerTree.ReportModel = this.reportModel;
			ViewCount++;
		}
示例#8
0
		public GeneratePlainReport(ReportModel reportModel,Properties customizer):base(reportModel,customizer)
		{
			if (reportModel == null) {
				throw new ArgumentNullException("reportModel");
			}
			
			if (base.ReportModel.ReportSettings.DataModel != GlobalEnums.PushPullModel.FormSheet) {
				throw new InvalidReportModelException();
			}
		}
		public GenerateFormSheetReport(ReportModel reportModel,ReportStructure reportStructure ):base(reportModel,reportStructure)                                                      
		{
		                             	
			if (reportModel == null) {
				throw new ArgumentNullException("reportModel");
			}
			
			if (base.ReportModel.ReportSettings.DataModel != GlobalEnums.PushPullModel.FormSheet) {
				throw new InvalidReportModelException();
			}
		}
		private AbstractRenderer PushDataRenderer(ReportModel model)
		{
			ICSharpCode.Reports.Addin.Commands.DataSetFromXsdCommand cmd =
				new ICSharpCode.Reports.Addin.Commands.DataSetFromXsdCommand();
			cmd.Run();
			DataSet ds = cmd.DataSet;
			if ( ds != null) {
				return  base.SetupPushDataRenderer(model,ds.Tables[0]);
			}
			return null;
		}
		public AbstractPreviewCommand(ReportModel model, ICSharpCode.Reports.Core.ReportViewer.PreviewControl reportViewer)
		{
			if (model == null) {
				throw new  ArgumentNullException ("model");
			}
			if (reportViewer == null) {
				throw new ArgumentNullException("reportViewer");
			}
			
			this.model = model;
			this.reportViewer = reportViewer;
		}
		protected AbstractReportGenerator(ReportModel reportModel,Properties customizer)
		{
			if (reportModel == null) {
				throw new ArgumentNullException("reportModel");
			}

			if (customizer == null) {
				throw new ArgumentNullException("customizer");
			}
			this.properties = customizer;
			this.reportModel = reportModel;
		}
示例#13
0
		public ReportModel CreateRenderableModel()
		{
			ReportModel m = new ReportModel();
			generator.MergeFormChanges((System.CodeDom.CodeCompileUnit)null);
			XmlDocument doc = new XmlDocument();
			doc.LoadXml(generator.ViewContent.ReportFileContent);
			ReportLoader rl = new ReportLoader();
			object root = rl.Load(doc.DocumentElement);
			m = root as ReportModel;
			
			m.ReportSettings.FileName = generator.ViewContent.PrimaryFileName;
			FilePathConverter.AdjustReportName(m);
			return m;
		}
示例#14
0
		public static void AdjustReportName (ReportModel model)
		{
			if (model == null) {
				throw new ArgumentNullException("model");
			}
			foreach (BaseSection section in model.SectionCollection) {
				foreach (BaseReportItem item in section.Items) {
					BaseImageItem baseImageItem = item as BaseImageItem;
					if (baseImageItem != null) {
						baseImageItem.ReportFileName = model.ReportSettings.FileName;
					}
				}
			}
		}
示例#15
0
		public static AbstractLayout CreateGenerator (GlobalEnums.ReportLayout reportLayout,
		                                              ReportModel model,
		                                              ReportItemCollection items)
		{
			AbstractLayout layout = null;
			switch (reportLayout) {
				case GlobalEnums.ReportLayout.ListLayout:
					layout = new ListLayout(model,items);
					break;
				case GlobalEnums.ReportLayout.TableLayout:
					layout = new TableLayout(model,items);
					break;
			}
			return layout;
		}
		protected AbstractReportGenerator(ReportModel reportModel,ReportStructure reportStructure)
		{
			if (reportModel == null) {
				throw new ArgumentNullException("reportModel");
			}
			if (reportStructure == null) {
				throw new ArgumentNullException("reportStructure");
			}
			this.ReportModel = reportModel;
			ReportStructure = reportStructure;
			this.AvailableFieldsCollection.Clear();
			this.ReportItemCollection.Clear();
			this.GroupColumnCollection.Clear();
			this.ParameterCollection.Clear();
		}
		public static void AdjustReportName (ReportModel model)
		{
			if (model == null) {
				throw new ArgumentNullException("model");
			}
			System.Diagnostics.Trace.WriteLine("");
			System.Diagnostics.Trace.WriteLine (String.Format("FilePathConverter:AdjustReportName {0}",model.ReportSettings.FileName));
			foreach (BaseSection section in model.SectionCollection) {
				foreach (BaseReportItem item in section.Items) {
					BaseImageItem baseImageItem = item as BaseImageItem;
					if (baseImageItem != null) {
						baseImageItem.ReportFileName = model.ReportSettings.FileName;
					}
				}
			}
		}
		/// <summary>
		/// Default constructor - initializes all fields to default values
		/// </summary>
		public GeneratePushDataReport(ReportModel reportModel,		                              
		                              Properties properties):base(reportModel,properties)
		{
			if (reportModel == null) {
				throw new ArgumentNullException("reportModel");
			}

			if (base.ReportModel.ReportSettings.DataModel != GlobalEnums.PushPullModel.PushData) {
				throw new ArgumentException ("Wrong DataModel in GeneratePushReport");
			}
			
			reportStructure = (ReportStructure)properties.Get("Generator");

			base.AvailableFieldsCollection.AddRange(reportStructure.AvailableFieldsCollection);
			base.ReportItemCollection.AddRange(reportStructure.ReportItemCollection);
		}
示例#19
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;
		}
		protected AbstractReportGenerator(ReportModel reportModel,Properties properties)
		{
			if (reportModel == null) {
				throw new ArgumentNullException("reportModel");
			}

			if (properties == null) {
				throw new ArgumentNullException("customizer");
			}
			this.ReportModel = reportModel;
			this.Properties = properties;
			ReportStructure = (ReportStructure)properties.Get("Generator");
			
			this.AvailableFieldsCollection.Clear();
			this.ReportItemCollection.Clear();
			this.GroupColumnCollection.Clear();
			this.ParameterCollection.Clear();
		}
示例#21
0
		public override void Run()
		{
			reportStructure = new ReportStructure();
			if (GlobalValues.IsValidPrinter() == true) {
				
				using (WizardDialog wizard = new WizardDialog("Report Wizard", reportStructure, WizardPath)) {
					if (wizard.ShowDialog() == DialogResult.OK) {
						reportModel = reportStructure.CreateAndFillReportModel ();
						CreateReportFromModel(reportModel,reportStructure);
					}
					else{
						this.canceled = true;
					}
				}
			} else {
				MessageService.ShowError(ResourceService.GetString("Sharpreport.Error.NoPrinter"));
			}
		}
示例#22
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;
		}
		public  AbstractRenderer CreateRenderer (ReportModel model)
		{
			if (model == null) {
				throw new ArgumentNullException("model");
			}
			AbstractRenderer abstractRenderer = null;
			switch (model.DataModel) {
					case GlobalEnums.PushPullModel.FormSheet : {
						abstractRenderer = StandartReportRenderer(model);
						break;
					}
					case GlobalEnums.PushPullModel.PullData:{
						abstractRenderer = StandartReportRenderer(model);
						break;
					}
					case GlobalEnums.PushPullModel.PushData:{
						abstractRenderer = PushDataRenderer(model);
						break;
					}
			}
			return abstractRenderer;
		}
		public static void Absolut2RelativePath (ReportModel model)
		{
			if (model == null) {
				throw new ArgumentNullException("model");
			}
			
			foreach (BaseSection section in model.SectionCollection) {
				foreach (BaseReportItem item in section.Items) {
					BaseImageItem baseImageItem = item as BaseImageItem;
					if (baseImageItem != null) {
						baseImageItem.ReportFileName = model.ReportSettings.FileName;
						
						if (Path.IsPathRooted(baseImageItem.ImageFileName)) {
							string d = FileUtility.GetRelativePath(
								Path.GetDirectoryName(model.ReportSettings.FileName),
								Path.GetDirectoryName(baseImageItem.ImageFileName));

							baseImageItem.RelativeFileName = d + Path.DirectorySeparatorChar + Path.GetFileName(baseImageItem.ImageFileName);
						}
					}
				}
			}
		}
示例#25
0
		void ShowData()
		{
			this.model = reportStructure.CreateAndFillReportModel();
			this.resultDataSet =  FillGrid();
			if (resultDataSet.Tables.Count > 0) {
				SetupGrid ();
			}
			
		}
		public void Init()
		{
			this.reportModel = CreateModel(reportName);
		}
示例#27
0
		public XmlDocument CreateXmlModel()
		{
			Console.WriteLine("ReportDesignerLoader:CreateXmlModel");
			ReportModel m = new ReportModel();
			generator.MergeFormChanges((System.CodeDom.CodeCompileUnit)null);
			XmlDocument xmlDocument = new XmlDocument();
			xmlDocument.LoadXml(generator.ViewContent.ReportFileContent);
			return xmlDocument;
		}
示例#28
0
		protected override void PerformLoad(IDesignerSerializationManager serializationManager)
		{
			InternalReportLoader internalLoader = new InternalReportLoader(this.host,generator, stream);
			internalLoader.LoadOrCreateReport();
			this.reportModel = internalLoader.ReportModel;
		}
		private AbstractRenderer StandartReportRenderer(ReportModel model)
		{		
			ICSharpCode.Reports.Addin.Commands.CollectParametersCommand cmd = new ICSharpCode.Reports.Addin.Commands.CollectParametersCommand(model.ReportSettings);
			cmd.Run();
			return  base.SetupStandardRenderer (model,null);
		}
示例#30
0
		private void CreateReportFromModel (ReportModel model)
		{
			reportGenerator = GeneratorFactory.Create (model,customizer);
			file.MakeDirty();
			reportGenerator.GenerateReport();
		}