public RdlViewer() { this.InitializeComponent(); _DrawPanel.BorderStyle = BorderStyle.None; _SourceFileName = null; _SourceRdl = null; _Parameters = null; // parameters to run the report _pgs = null; // the pages of the report to view _loadFailed = false; _PageWidth = 0; _PageHeight = 0; _ReportDescription = null; _ReportAuthor = null; _ReportName = null; _zoom = -1; // force zoom to be calculated // Get our graphics DPI Graphics g = null; try { g = this.CreateGraphics(); DpiX = g.DpiX; DpiY = g.DpiY; } catch { DpiX = DpiY = 96; } finally { if (g != null) g.Dispose(); } _ScrollMode = ScrollModeEnum.Continuous; // tooltip _vScrollToolTip = new ToolTip(); _vScrollToolTip.AutomaticDelay = 100; // .1 seconds _vScrollToolTip.AutoPopDelay = 1000; // 1 second _vScrollToolTip.ReshowDelay = 100; // .1 seconds _vScrollToolTip.InitialDelay = 10; // .01 seconds _vScrollToolTip.ShowAlways = false; _vScrollToolTip.SetToolTip(_vScroll, ""); _DrawPanel.Parent = this; _DrawPanel.MouseWheel += new MouseEventHandler(DrawPanelMouseWheel); _WarningButton = new PictureBox(); _WarningButton.Parent = this; _WarningButton.Width = 15; _WarningButton.Height = 15; _WarningButton.Paint += new PaintEventHandler(_WarningButton_Paint); _WarningButton.Click += new System.EventHandler(WarningClick); ToolTip tip = new ToolTip(); tip.AutomaticDelay = 500; tip.ShowAlways = true; tip.SetToolTip(_WarningButton, "Click to see Report Warnings"); _ParameterPanel = new ScrollableControl(); _FindCtl = new RdlViewerFind(); _FindCtl.Height = 27; _FindCtl.Parent = this; _FindCtl.Viewer = this; _FindCtl.Visible = false; this.Layout += new LayoutEventHandler(RdlViewer_Layout); this.SuspendLayout(); // Must be added in this order for DockStyle to work correctly this.Controls.Add(_FindCtl); this.Controls.Add(_ParameterPanel); this.ResumeLayout(false); }
public void RestoreState(SerializationInfoEx info, bool restoreCustomObjects) { this.Name = info.GetString("Name"); this.Height = info.GetInt32("Height"); _stateId = info.GetValue<Guid>("_stateId"); _titleFont = info.GetValue<Font>("_titleFont"); _titleFontBrush = info.GetValue<Brush>("_titleFontBrush"); _fill = info.GetValue<Brush>("_fill"); _axisLabelsFont = info.GetValue<Font>("_axisLabelsFont"); _xAxisLabelsFontBrush = info.GetValue<Brush>("_xAxisLabelsFontBrush"); _yAxisLabelsPosition = info.GetValue<YAxisLabelPosition>("_yAxisLabelsPosition"); _yAxisLabelsFontBrush = info.GetValue<Brush>("_yAxisLabelsFontBrush"); _xAxisLabelsFormat = info.GetString("_xAxisLabelsFormat"); _yAxisLabelsFormat = info.GetString("_yAxisLabelsFormat"); _labelsFont = info.GetValue<Font>("_labelsFont"); _labelsFontBrush = info.GetValue<Brush>("_labelsFontBrush"); _labelsFill = info.GetValue<Brush>("_labelsFill"); _labelsTopMargin = info.GetSingle("_labelsTopMargin"); _labelsMargin = info.GetSingle("_labelsMargin"); _showSeriesLabels = info.GetBoolean("_showSeriesLabels"); _showClippingRectangle = info.GetBoolean("_showClippingRectangle"); _unitUnificationOptimizationEnabled = info.GetBoolean("_unitUnificationOptimizationEnabled"); _smoothingMode = info.GetValue<SmoothingMode>("_smoothingMode"); _defaultAbsoluteSelectionMargin = info.GetSingle("_defaultAbsoluteSelectionMargin"); _scrollMode = info.GetValue<ScrollModeEnum>("_scrollMode"); _rightMouseButtonSelectionMode = info.GetValue<SelectionModeEnum>("_rightMouseButtonSelectionMode"); _selectionPen = info.GetValue<Pen>("_selectionPen"); _selectionFill = info.GetValue<Brush>("_selectionFill"); _additionalDrawingSpaceAreaMarginLeft = info.GetInt32("_additionalDrawingSpaceAreaMarginLeft"); _additionalDrawingSpaceAreaMarginRight = info.GetInt32("_additionalDrawingSpaceAreaMarginRight"); _actualDrawingSpaceAreaMarginLeft = info.GetInt32("_actualDrawingSpaceAreaMarginLeft"); _actualDrawingSpaceAreaMarginTop = info.GetInt32("_actualDrawingSpaceAreaMarginTop"); _actualDrawingSpaceAreaMarginRight = info.GetInt32("_actualDrawingSpaceAreaMarginRight"); _actualDrawingSpaceAreaMarginBottom = info.GetInt32("_actualDrawingSpaceAreaMarginBottom"); _actualDrawingSpaceAreaBorderPen = info.GetValue<Pen>("_actualDrawingSpaceAreaBorderPen"); _actualDrawingSpaceAreaFill = info.GetValue<Brush>("_actualDrawingSpaceAreaFill"); _limitedView = info.GetBoolean("_limitedView"); _seriesItemWidth = info.GetSingle("_seriesItemWidth"); _seriesItemMargin = info.GetSingle("_seriesItemMargin"); if (restoreCustomObjects && info.GetBoolean("customObjectsSaved")) {// Restore custom objects. _customObjectsManager.RestoreState(info); } else {// New clear custom objects. _customObjectsManager.Clear(); } _actualSpaceGrid = info.GetValue<ChartGrid>("_actualSpaceGrid"); _drawingSpaceGrid = info.GetValue<ChartGrid>("_drawingSpaceGrid"); _chartName = info.GetString("_chartName"); _appearanceScheme = info.GetValue<AppearanceSchemeEnum>("_appearanceScheme"); _autoScrollToEnd = info.GetBoolean("_autoScrollToEnd"); if (info.ContainsValue("_maximumXZoom")) { _maximumXZoom = info.GetSingle("_maximumXZoom"); } else { _maximumXZoom = null; } _xAxisLabelSpacing = info.GetSingle("_xAxisLabelSpacing"); if (AppearanceSchemeChangedEvent != null) { AppearanceSchemeChangedEvent(this, _appearanceScheme); } }
public RdlViewer() { _SourceFileName = null; _SourceRdl = null; _Parameters = null; // parameters to run the report _pgs = null; // the pages of the report to view _loadFailed = false; _PageWidth = 0; _PageHeight = 0; _ReportDescription = null; _ReportAuthor = null; _ReportName = null; _zoom = -1; // force zoom to be calculated // Get our graphics DPI Graphics g = null; try { g = this.CreateGraphics(); DpiX = g.DpiX; DpiY = g.DpiY; } catch { DpiX = DpiY = 96; } finally { if (g != null) { g.Dispose(); } } _ScrollMode = ScrollModeEnum.Continuous; // Handle the controls _vScroll = new VScrollBar(); _vScroll.Scroll += new ScrollEventHandler(this.VerticalScroll); _vScroll.Enabled = false; // tooltip _vScrollToolTip = new ToolTip(); _vScrollToolTip.AutomaticDelay = 100; // .1 seconds _vScrollToolTip.AutoPopDelay = 1000; // 1 second _vScrollToolTip.ReshowDelay = 100; // .1 seconds _vScrollToolTip.InitialDelay = 10; // .01 seconds _vScrollToolTip.ShowAlways = false; _vScrollToolTip.SetToolTip(_vScroll, ""); _hScroll = new HScrollBar(); _hScroll.Scroll += new ScrollEventHandler(this.HorizontalScroll); _hScroll.Enabled = false; _DrawPanel = new PageDrawing(null); _DrawPanel.Paint += new PaintEventHandler(this.DrawPanelPaint); _DrawPanel.Resize += new EventHandler(this.DrawPanelResize); _DrawPanel.MouseWheel += new MouseEventHandler(DrawPanelMouseWheel); _DrawPanel.KeyDown += new KeyEventHandler(DrawPanelKeyDown); _RunButton = new Button(); _RunButton.Parent = this; _RunButton.Text = "Run Report"; _RunButton.Width = 90; _RunButton.FlatStyle = FlatStyle.Flat; _RunButton.Click += new System.EventHandler(ParametersViewClick); _WarningButton = new PictureBox(); _WarningButton.Parent = this; _WarningButton.Width = 15; _WarningButton.Height = 15; _WarningButton.Paint += new PaintEventHandler(_WarningButton_Paint); _WarningButton.Click += new System.EventHandler(WarningClick); ToolTip tip = new ToolTip(); tip.AutomaticDelay = 500; tip.ShowAlways = true; tip.SetToolTip(_WarningButton, "Click to see Report Warnings"); _ParameterPanel = new ScrollableControl(); this.Layout += new LayoutEventHandler(RdlViewer_Layout); this.SuspendLayout(); // Must be added in this order for DockStyle to work correctly this.Controls.Add(_DrawPanel); this.Controls.Add(_vScroll); this.Controls.Add(_hScroll); this.Controls.Add(_ParameterPanel); this.ResumeLayout(false); }
public RdlViewer() { _SourceFileName=null; _SourceRdl=null; _Parameters=null; // parameters to run the report _pgs=null; // the pages of the report to view _loadFailed=false; _PageWidth=0; _PageHeight=0; _ReportDescription=null; _ReportAuthor=null; _ReportName=null; _zoom=-1; // force zoom to be calculated // Get our graphics DPI Graphics g = null; try { g = this.CreateGraphics(); DpiX = g.DpiX; DpiY = g.DpiY; } catch { DpiX = DpiY = 96; } finally { if (g != null) g.Dispose(); } _ScrollMode = ScrollModeEnum.Continuous; // Handle the controls _vScroll = new VScrollBar(); _vScroll.Scroll += new ScrollEventHandler(this.VerticalScroll); _vScroll.Enabled = false; // tooltip _vScrollToolTip = new ToolTip(); _vScrollToolTip.AutomaticDelay = 100; // .1 seconds _vScrollToolTip.AutoPopDelay = 1000; // 1 second _vScrollToolTip.ReshowDelay = 100; // .1 seconds _vScrollToolTip.InitialDelay = 10; // .01 seconds _vScrollToolTip.ShowAlways = false; _vScrollToolTip.SetToolTip(_vScroll, ""); _hScroll = new HScrollBar(); _hScroll.Scroll += new ScrollEventHandler(this.HorizontalScroll); _hScroll.Enabled = false; _DrawPanel = new PageDrawing(null); _DrawPanel.Paint += new PaintEventHandler(this.DrawPanelPaint); _DrawPanel.Resize += new EventHandler(this.DrawPanelResize); _DrawPanel.MouseWheel +=new MouseEventHandler(DrawPanelMouseWheel); _DrawPanel.KeyDown += new KeyEventHandler(DrawPanelKeyDown); _RunButton = new Button(); _RunButton.Parent = this; _RunButton.Text = "Run Report"; _RunButton.Width = 90; _RunButton.FlatStyle = FlatStyle.Flat; _RunButton.Click += new System.EventHandler(ParametersViewClick); _WarningButton = new PictureBox(); _WarningButton.Parent = this; _WarningButton.Width = 15; _WarningButton.Height = 15; _WarningButton.Paint +=new PaintEventHandler(_WarningButton_Paint); _WarningButton.Click += new System.EventHandler(WarningClick); ToolTip tip = new ToolTip(); tip.AutomaticDelay = 500; tip.ShowAlways = true; tip.SetToolTip(_WarningButton, "Click to see Report Warnings"); _ParameterPanel = new ScrollableControl(); this.Layout +=new LayoutEventHandler(RdlViewer_Layout); this.SuspendLayout(); // Must be added in this order for DockStyle to work correctly this.Controls.Add(_DrawPanel); this.Controls.Add(_vScroll); this.Controls.Add(_hScroll); this.Controls.Add(_ParameterPanel); this.ResumeLayout(false); }