void IPrintable.Print(MyGridPrintDocument gridPrintDocument, PrintPageEventArgs e)
 {
     e.Graphics.PageUnit = GraphicsUnit.Millimeter;
     e.Graphics.DrawString(SubstituteSpecialCommands(gridPrintDocument.CurrentPageNumber),
                           m_font,
                           m_brush,
                           m_x,
                           m_y);
 }
        /// <summary>
        ///
        /// </summary>
        /// <param name="gridPrintDocument"></param>
        public PrintPreviewForm(MyGridPrintDocument gridPrintDocument)
        {
            m_gridPrintDocument = gridPrintDocument;
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            //
            // TODO: Add any constructor code after InitializeComponent call
            //

            printPreviewControl1.Document = gridPrintDocument;
            m_headerFooterEditor          = new HeaderFooterEditor();
            this.RegisterHeaderFooter();
        }
Пример #3
0
        /// <summary>
        /// PrintPreview
        /// </summary>
        public void PrintPriviewGrid()
        {
            using (MyGridPrintDocument gridPrintDocument = new MyGridPrintDocument(this))
            {
                // See this.QueryPrintPage for how to use this event.
                gridPrintDocument.QueryPrintPage += new Xceed.Grid.QueryPrintPageEventHandler(this.QueryPrintPage);

                using (PrintPreviewForm printPreviewForm = new PrintPreviewForm(gridPrintDocument))
                {
                    try
                    {
                        printPreviewForm.ShowDialog(this.FindForm());
                    }
                    catch (Exception ex)
                    {
                        ExceptionProcess.ProcessWithNotify(ex);
                    }
                }

                gridPrintDocument.QueryPrintPage -= new Xceed.Grid.QueryPrintPageEventHandler(this.QueryPrintPage);
            }
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="gridPrintDocument"></param>
        public PrintPreviewForm(MyGridPrintDocument gridPrintDocument)
        {
            m_gridPrintDocument = gridPrintDocument;
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            //
            // TODO: Add any constructor code after InitializeComponent call
            //

            printPreviewControl1.Document = gridPrintDocument;
            m_headerFooterEditor = new HeaderFooterEditor();
            this.RegisterHeaderFooter();
        }
 void IPrintable.Print(MyGridPrintDocument gridPrintDocument, PrintPageEventArgs e)
 {
     e.Graphics.PageUnit = GraphicsUnit.Millimeter;
     e.Graphics.DrawString(SubstituteSpecialCommands(gridPrintDocument.CurrentPageNumber),
                             m_font,
                             m_brush,
                             m_x,
                             m_y);
 }