コード例 #1
0
ファイル: AbstractLayout.cs プロジェクト: ootsby/SharpDevelop
		public AbstractLayout(ReportModel reportModel)
		{
			if (reportModel == null) {
				throw new ArgumentNullException("reportModel");
			}
			this.ReportModel = reportModel;
		}
コード例 #2
0
		/// <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
ファイル: ListLayout.cs プロジェクト: ootsby/SharpDevelop
		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
ファイル: ReportModel.cs プロジェクト: Paccc/SharpDevelop
		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;
		}
コード例 #6
0
		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();
			}
		}
コード例 #9
0
		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();
			}
		}
コード例 #10
0
		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;
		}
コード例 #11
0
		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;
		}
コード例 #12
0
		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;
		}
コード例 #16
0
		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();
		}
コード例 #17
0
		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;
					}
				}
			}
		}
コード例 #18
0
		/// <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;
		}
コード例 #20
0
		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;
		}
コード例 #23
0
		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;
		}
コード例 #24
0
		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
ファイル: ResultPanel.cs プロジェクト: Paccc/SharpDevelop
		void ShowData()
		{
			this.model = reportStructure.CreateAndFillReportModel();
			this.resultDataSet =  FillGrid();
			if (resultDataSet.Tables.Count > 0) {
				SetupGrid ();
			}
			
		}
コード例 #26
0
		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;
		}
コード例 #29
0
		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();
		}