コード例 #1
0
        private RadPrintDocument CreatePrintDocument()
        {
            RadPrintDocument doc = new RadPrintDocument();

            doc.AssociatedObject = this;
            return(doc);
        }
コード例 #2
0
        public void Print()
        {
            RadPrintDocument doc = this.CreatePrintDocument();

            doc.DefaultPageSettings.Landscape = true;
            doc.Print();
        }
コード例 #3
0
        public static void PrintPreview(RadGridView grdData)
        {
            if (grdData.Rows.Count <= 0)
            {
                MessageBox.Show(@"No Datas To Be Printed.", @"Print", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return;
            }
            try
            {
                var rpd = new RadPrintDocument
                {
                    Margins             = new Margins(10, 10, 10, 10),
                    DefaultPageSettings = { PaperSize = new PaperSize("A4", 850, 1100) },
                    AssociatedObject    = grdData
                };

                var dialog = new RadPrintPreviewDialog
                {
                    ThemeName     = grdData.ThemeName,
                    Document      = rpd,
                    StartPosition = FormStartPosition.CenterScreen
                };
                dialog.ShowDialog();
            }
            catch (Exception e)
            {
                MessageBox.Show(@"Error While Printing Document." + Environment.NewLine + e.Message, @"Print", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
コード例 #4
0
        public bool PrintPage(int pageNumber, RadPrintDocument sender, PrintPageEventArgs args)
        {
            Bitmap bmp = new Bitmap(this.Width, this.Height);

            this.DrawToBitmap(bmp, new Rectangle(Point.Empty, this.Size));
            args.Graphics.DrawImage(bmp, Point.Empty);

            return(false);
        }
コード例 #5
0
        public void PrintPreview()
        {
            RadPrintDocument doc = this.CreatePrintDocument();

            doc.DefaultPageSettings.Landscape = true;
            RadPrintPreviewDialog dialog = new RadPrintPreviewDialog(doc);

            dialog.ThemeName = this.ThemeName;
            dialog.ShowDialog();
        }
コード例 #6
0
ファイル: Form1.cs プロジェクト: imaxmunguia/EjemploPracticos
        public Form1()
        {
            InitializeComponent();

            this.radPivotGrid1             = new RadPivotGrid();
            this.radPivotGrid1.ColumnWidth = 110;
            this.radPivotGrid1.Dock        = DockStyle.Fill;

            this.radPrintDocument1 = new RadPrintDocument();
            this.radPrintDocument1.AssociatedObject = this.radPivotGrid1;

            this.Controls.Add(this.radPivotGrid1);
        }
コード例 #7
0
ファイル: PaymentReport.cs プロジェクト: dansalan/DCFIv5
        private void btnPrint_Click(object sender, EventArgs e)
        {
            RadPrintDocument document = new RadPrintDocument();
            document.DefaultPageSettings.Landscape = true;
            document.HeaderHeight = 60;
            document.HeaderFont = new Font("Arial", 10, FontStyle.Bold);
            document.MiddleHeader = "Dansalan College Foundation, Inc. \r\n Marinaut, Marawi City, Lanao del Sur";
            document.MiddleFooter = "Page [Page #] of [Total Pages]";
            document.AssociatedObject = this.gridView;
            radPrintDocument1 = document;

            RadPrintPreviewDialog dialog = new RadPrintPreviewDialog();
            dialog.Document = this.radPrintDocument1;
            dialog.ShowDialog();
        }
コード例 #8
0
        public bool PrintPage(int pageNumber, RadPrintDocument sender, PrintPageEventArgs args)
        {
            float scale = Math.Min((float)args.MarginBounds.Width / panel.Size.Width, (float)args.MarginBounds.Height / panel.Size.Height);

            Bitmap panelBmp = new Bitmap(this.panel.Width, this.panel.Height);

            this.panel.DrawToBitmap(panelBmp, this.panel.Bounds);

            Matrix saveMatrix = args.Graphics.Transform;

            args.Graphics.ScaleTransform(scale, scale);
            args.Graphics.DrawImage(panelBmp, args.MarginBounds.Location);
            args.Graphics.Transform = saveMatrix;

            return(false);
        }
コード例 #9
0
ファイル: frmAdvisersLoad.cs プロジェクト: RazenRyne/eSAR_new
        private void btnPrint_Click(object sender, EventArgs e)
        {
            RadPrintDocument document = new RadPrintDocument();

            document.DefaultPageSettings.Landscape = true;
            document.HeaderHeight     = 60;
            document.HeaderFont       = new Font("Arial", 10, FontStyle.Bold);
            document.MiddleHeader     = "Dansalan College Foundation, Inc. \r\n Marinaut, Marawi City, Lanao del Sur";
            document.MiddleFooter     = "Page [Page #] of [Total Pages]";
            document.AssociatedObject = this.gvGradeSection;
            radPrintDocument1         = document;

            RadPrintPreviewDialog dialog = new RadPrintPreviewDialog();

            dialog.Document = this.radPrintDocument1;
            dialog.ShowDialog();
        }
コード例 #10
0
        private void menuPrintBirthdates_Click(object sender, EventArgs e)
        {
            printDocumentRad = new RadPrintDocument();
            printDocumentRad.DefaultPageSettings.Landscape = false;
            printDocumentRad.AssociatedObject = this.gridViewEmployees;
            printDocumentRad.MiddleHeader     = "Список дней рождения сотрудников офиса Фастдев, Екатеринбург";
            printDocumentRad.HeaderFont       = new System.Drawing.Font(FontFamily.GenericSerif, 15.0F);
            printDocumentRad.LeftFooter       = "Число сотрудников: " + employeeManager.NumberOfEmployees();

            ShowColumns(false, false);
            RadPrintPreviewDialog dialog = new RadPrintPreviewDialog();

            dialog.Document = printDocumentRad;
            dialog.ShowDialog();
            ShowColumns(true, false);
            gridViewEmployees.BestFitColumns(BestFitColumnMode.DisplayedCells);
        }
コード例 #11
0
        private void PrintPreview_Click(object sender, RoutedEventArgs e)
        {
            RadPrintDocument document = new RadPrintDocument();

            document.HeaderHeight             = 30;
            document.HeaderFont               = new Font("Arial", 22);
            document.Logo                     = System.Drawing.Image.FromFile(@"C:\MyLogo.png");
            document.LeftHeader               = "[Logo]";
            document.MiddleHeader             = "Middle header";
            document.RightHeader              = "Right header";
            document.ReverseHeaderOnEvenPages = true;
            document.FooterHeight             = 30;
            document.FooterFont               = new Font("Arial", 22);
            document.LeftFooter               = "Left footer";
            document.MiddleFooter             = "Middle footer";
            document.RightFooter              = "Right footer";
            document.ReverseFooterOnEvenPages = true;
            document.AssociatedObject         = this.radGridView1;
            RadPrintPreviewDialog dialog = new RadPrintPreviewDialog(document);

            dialog.Show();
            gridView.PrintPreview();
        }
コード例 #12
0
        private void PrintPane()
        {
            CalcPerGrading();

            txtDate.Text    = "Date: " + DateTime.Now.ToShortDateString();
            txtDate.Visible = true;
            radPanel2.Size  = new Size(702, 586);
            this.Size       = new Size(710, 657);


            RadPrintDocument document = new RadPrintDocument();

            document.AssociatedObject = new PanelPrinter(this.radPanel2);

            RadPrintPreviewDialog dialog = new RadPrintPreviewDialog(document);

            dialog.ShowDialog();


            txtDate.Visible = false;
            radPanel2.Size  = new Size(702, 361);
            this.Size       = new Size(702, 316);
        }
コード例 #13
0
        public static void PrintPreview(RadGridView grdData)
        {
            if (grdData.Rows.Count <= 0)
            {
                MessageBox.Show(@"No Datas To Be Printed.", @"Print", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return;
            }
            try
            {
                var rpd = new RadPrintDocument
                {
                    Margins = new Margins(10, 10, 10, 10),
                    DefaultPageSettings = { PaperSize = new PaperSize("A4", 850, 1100) },
                    AssociatedObject = grdData
                };

                var dialog = new RadPrintPreviewDialog
                {
                    ThemeName = grdData.ThemeName,
                    Document = rpd,
                    StartPosition = FormStartPosition.CenterScreen
                };
                dialog.ShowDialog();
            }
            catch (Exception e)
            {
                MessageBox.Show(@"Error While Printing Document." + Environment.NewLine + e.Message, @"Print", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
コード例 #14
0
 public int BeginPrint(RadPrintDocument sender, PrintEventArgs args)
 {
     return(1);
 }
コード例 #15
0
ファイル: AssessStudent.cs プロジェクト: RazenRyne/eSAR
 public Form GetSettingsDialog(RadPrintDocument document)
 {
     return null;
 }
コード例 #16
0
ファイル: AssessStudent.cs プロジェクト: RazenRyne/eSAR
        public bool PrintPage(int pageNumber, RadPrintDocument sender, PrintPageEventArgs args)
        {
            float scale = Math.Min((float)args.MarginBounds.Width / panel.Size.Width, (float)args.MarginBounds.Height / panel.Size.Height);

            Bitmap panelBmp = new Bitmap(this.panel.Width, this.panel.Height);
            this.panel.DrawToBitmap(panelBmp, this.panel.Bounds);

            Matrix saveMatrix = args.Graphics.Transform;
            args.Graphics.ScaleTransform(scale, scale);
            args.Graphics.DrawImage(panelBmp, args.MarginBounds.Location);
            args.Graphics.Transform = saveMatrix;

            return false;
        }
コード例 #17
0
ファイル: AssessStudent.cs プロジェクト: RazenRyne/eSAR
 public bool EndPrint(RadPrintDocument sender, PrintEventArgs args)
 {
     return true;
 }
コード例 #18
0
ファイル: AssessStudent.cs プロジェクト: RazenRyne/eSAR
 public int BeginPrint(RadPrintDocument sender, PrintEventArgs args)
 {
     return 1;
 }
コード例 #19
0
ファイル: AssessStudent.cs プロジェクト: RazenRyne/eSAR
        private void PrintPane()
        {
            CalcPerGrading();

            txtDate.Text = "Date: " + DateTime.Now.ToShortDateString();
            txtDate.Visible = true;
            radPanel2.Size = new Size(702, 586);
            this.Size = new Size(710, 657);


            RadPrintDocument document = new RadPrintDocument();
            document.AssociatedObject = new PanelPrinter(this.radPanel2);

            RadPrintPreviewDialog dialog = new RadPrintPreviewDialog(document);
            dialog.ShowDialog();


            txtDate.Visible = false;
            radPanel2.Size = new Size(702, 361);
            this.Size = new Size(702, 316);
        }
コード例 #20
0
 public bool EndPrint(RadPrintDocument sender, PrintEventArgs args)
 {
     return(true);
 }
コード例 #21
0
 public Form GetSettingsDialog(RadPrintDocument document)
 {
     return(null);
 }