/// <summary> /// Creates a new ReportPreview object /// </summary> public ReportPreview(ReportDesignerLoader loader,IViewContent content):base(content) { if (loader == null) { throw new ArgumentNullException("loader"); } this.designerLoader = loader; base.TabPageText = ResourceService.GetString("SharpReport.Preview"); }
/// <summary> /// Creates a new ReportPreview object /// </summary> public ReportPreview(ReportDesignerLoader loader, IViewContent content) : base(content) { if (loader == null) { throw new ArgumentNullException("loader"); } this.designerLoader = loader; base.TabPageText = ResourceService.GetString("SharpReport.Preview"); }
public ReportViewerSecondaryView(ReportDesignerLoader designerLoader,IViewContent content):base(content) { if (designerLoader == null) { throw new ArgumentNullException("designerLoader"); } if (content == null) { throw new ArgumentNullException("content"); } this.designerLoader = designerLoader; this.control = new ICSharpCode.Reports.Core.ReportViewer.PreviewControl(); this.control.Messages = new ReportViewerMessages(); this.control.PreviewLayoutChanged += OnPreviewLayoutChanged; base.TabPageText = ResourceService.GetString("SharpReport.ReportViewer"); }
public ReportViewerSecondaryView(ReportDesignerLoader designerLoader, IViewContent content) : base(content) { if (designerLoader == null) { throw new ArgumentNullException("designerLoader"); } if (content == null) { throw new ArgumentNullException("content"); } this.designerLoader = designerLoader; this.control = new ICSharpCode.Reports.Core.ReportViewer.PreviewControl(); this.control.Messages = new ReportViewerMessages(); this.control.PreviewLayoutChanged += OnPreviewLayoutChanged; base.TabPageText = ResourceService.GetString("SharpReport.ReportViewer"); }
private void LoadDesigner(Stream stream) { LoggingService.Info("Form Designer: BEGIN INITIALIZE"); defaultServiceContainer = new DefaultServiceContainer(); defaultServiceContainer.AddService(typeof(System.Windows.Forms.Design.IUIService), new UIService()); defaultServiceContainer.AddService(typeof(IToolboxService), new ToolboxService()); defaultServiceContainer.AddService(typeof(IHelpService), new HelpService()); this.designSurface = CreateDesignSurface(defaultServiceContainer); designSurface.Loading += this.DesignerLoading; designSurface.Loaded += this.DesignerLoaded; designSurface.Flushed += this.DesignerFlushed; designSurface.Unloading += this.DesingerUnloading; AmbientProperties ambientProperties = new AmbientProperties(); defaultServiceContainer.AddService(typeof(AmbientProperties), ambientProperties); defaultServiceContainer.AddService(typeof(ITypeResolutionService), new TypeResolutionService()); defaultServiceContainer.AddService(typeof(ITypeDiscoveryService), new TypeDiscoveryService()); defaultServiceContainer.AddService(typeof(System.ComponentModel.Design.IMenuCommandService), new MenuCommandService(panel, this.designSurface)); defaultServiceContainer.AddService(typeof(MemberRelationshipService), new DefaultMemberRelationshipService()); //need this to resolve the filename and manipulate //ReportSettings in ReportDefinitionDeserializer.LoadObjectFromXmlDocument //if the filename in ReportSettings is different from load location defaultServiceContainer.AddService(typeof(OpenedFile), base.PrimaryFile); DesignerOptionService dos = new System.Windows.Forms.Design.WindowsFormsDesignerOptionService(); dos.Options.Properties.Find("UseSmartTags", true).SetValue(dos, true); dos.Options.Properties.Find("ShowGrid", true).SetValue(dos, false); dos.Options.Properties.Find("UseSnapLines", true).SetValue(dos, true); defaultServiceContainer.AddService(typeof(DesignerOptionService), dos); this.loader = new ReportDesignerLoader(generator, stream); this.designSurface.BeginLoad(this.loader); if (!designSurface.IsLoaded) { throw new FormsDesignerLoadException(FormatLoadErrors(designSurface)); } defaultServiceContainer.AddService(typeof(System.ComponentModel.Design.Serialization.INameCreationService), new NameCreationService()); ISelectionService selectionService = (ISelectionService)this.designSurface.GetService(typeof(ISelectionService)); selectionService.SelectionChanged += SelectionChangedHandler; undoEngine = new ReportDesignerUndoEngine(Host); IComponentChangeService componentChangeService = (IComponentChangeService)this.designSurface.GetService(typeof(IComponentChangeService)); componentChangeService.ComponentChanged += OnComponentChanged; componentChangeService.ComponentAdded += OnComponentListChanged; componentChangeService.ComponentRemoved += OnComponentListChanged; componentChangeService.ComponentRename += OnComponentListChanged; this.Host.TransactionClosed += TransactionClose; UpdatePropertyPad(); hasUnmergedChanges = false; LoggingService.Info("Form Designer: END INITIALIZE"); }
private void LoadDesigner(Stream stream) { Console.WriteLine("LoadDesigner(Stream stream)"); LoggingService.Info("Form Designer: BEGIN INITIALIZE"); CreatePanel(); defaultServiceContainer = new DefaultServiceContainer(); defaultServiceContainer.AddService(typeof(System.Windows.Forms.Design.IUIService), new UIService()); defaultServiceContainer.AddService(typeof(IToolboxService),new ToolboxService()); defaultServiceContainer.AddService(typeof(IHelpService), new HelpService()); this.designSurface = CreateDesignSurface(defaultServiceContainer); designSurface.Loading += this.DesignerLoading; designSurface.Loaded += this.DesignerLoaded; designSurface.Flushed += this.DesignerFlushed; designSurface.Unloading += this.DesingerUnloading; AmbientProperties ambientProperties = new AmbientProperties(); defaultServiceContainer.AddService(typeof(AmbientProperties), ambientProperties); defaultServiceContainer.AddService(typeof(ITypeResolutionService), new TypeResolutionService()); defaultServiceContainer.AddService(typeof(ITypeDiscoveryService), new TypeDiscoveryService()); defaultServiceContainer.AddService(typeof(System.ComponentModel.Design.IMenuCommandService), new MenuCommandService(panel,this.designSurface )); defaultServiceContainer.AddService(typeof(MemberRelationshipService), new DefaultMemberRelationshipService()); //need this to resolve the filename and manipulate //ReportSettings in ReportDefinitionDeserializer.LoadObjectFromXmlDocument //if the filename in ReportSettings is different from load location defaultServiceContainer.AddService(typeof(OpenedFile),base.PrimaryFile); DesignerOptionService dos = new System.Windows.Forms.Design.WindowsFormsDesignerOptionService(); dos.Options.Properties.Find( "UseSmartTags", true ).SetValue( dos, true ); dos.Options.Properties.Find( "ShowGrid", true ).SetValue( dos, false ); dos.Options.Properties.Find( "UseSnapLines", true ).SetValue( dos, true ); defaultServiceContainer.AddService( typeof( DesignerOptionService ), dos ); this.loader = new ReportDesignerLoader(generator,stream); this.designSurface.BeginLoad(this.loader); if (!designSurface.IsLoaded) { throw new FormsDesignerLoadException(FormatLoadErrors(designSurface)); } defaultServiceContainer.AddService(typeof(System.ComponentModel.Design.Serialization.INameCreationService), new NameCreationService()); ISelectionService selectionService = (ISelectionService)this.designSurface.GetService(typeof(ISelectionService)); selectionService.SelectionChanged += SelectionChangedHandler; undoEngine = new ReportDesignerUndoEngine(Host); IComponentChangeService componentChangeService = (IComponentChangeService)this.designSurface.GetService(typeof(IComponentChangeService)); componentChangeService.ComponentChanged += OnComponentChanged; componentChangeService.ComponentAdded += OnComponentListChanged; componentChangeService.ComponentRemoved += OnComponentListChanged; componentChangeService.ComponentRename += OnComponentListChanged; this.Host.TransactionClosed += TransactionClose; UpdatePropertyPad(); hasUnmergedChanges = false; LoggingService.Info("Form Designer: END INITIALIZE"); }