private void button1_Click(object sender, EventArgs e)
        {
            // Create objects and define event handlers.
            CompositeLink composLink = new CompositeLink(new PrintingSystem());

            composLink.CreateMarginalHeaderArea += new CreateAreaEventHandler(composLink_CreateMarginalHeaderArea);
            PrintableComponentLink pcLink1 = new PrintableComponentLink();
            PrintableComponentLink pcLink2 = new PrintableComponentLink();
            Link linkMainReport            = new Link();

            linkMainReport.CreateDetailArea += new CreateAreaEventHandler(linkMainReport_CreateDetailArea);
            Link linkGrid1Report = new Link();

            linkGrid1Report.CreateDetailArea += new CreateAreaEventHandler(linkGrid1Report_CreateDetailArea);
            Link linkGrid2Report = new Link();

            linkGrid2Report.CreateDetailArea += new CreateAreaEventHandler(linkGrid2Report_CreateDetailArea);

            // Assign the controls to the printing links.
            pcLink1.Component = this.gridControl1;
            pcLink2.Component = this.gridControl2;

            // Populate the collection of links in the composite link.
            // The order of operations corresponds to the document structure.
            composLink.Links.Add(linkGrid1Report);
            composLink.Links.Add(pcLink1);
            composLink.Links.Add(linkMainReport);
            composLink.Links.Add(linkGrid2Report);
            composLink.Links.Add(pcLink2);

            // Create the report and show the preview window.
            composLink.ShowPreviewDialog();
        }
Ejemplo n.º 2
0
        //Kaydet butonuna basıldığında rapor oluşturulup kullanıcıya sunuluyor
        private void btn_Kaydet_Click(object sender, EventArgs e)
        {
            var composLink = new CompositeLink(new PrintingSystem());

            composLink.CreateMarginalHeaderArea += new CreateAreaEventHandler(composLink_CreateMarginalHeaderArea);
            var pcLink1        = new PrintableComponentLink();
            var pcLink2        = new PrintableComponentLink();
            var pcLink3        = new PrintableComponentLink();
            var linkGridReport = new Link();

            linkGridReport.CreateDetailArea += new CreateAreaEventHandler(linkGridReport_CreateDetailArea);
            var linkChart1Report = new Link();

            linkChart1Report.CreateDetailArea += new CreateAreaEventHandler(linkChart1Report_CreateDetailArea);
            var linkChart2Report = new Link();

            linkChart2Report.CreateDetailArea += new CreateAreaEventHandler(linkChart2Report_CreateDetailArea);

            pcLink1.Component = dgv_Veriler;
            pcLink2.Component = DxChart1;
            pcLink3.Component = DxChart2;

            composLink.Links.Add(linkGridReport);
            composLink.Links.Add(linkChart1Report);
            composLink.Links.Add(linkChart2Report);
            composLink.Links.Add(pcLink1);
            composLink.Links.Add(pcLink2);
            composLink.Links.Add(pcLink3);

            composLink.ShowPreviewDialog();
        }
Ejemplo n.º 3
0
        private void denemeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            CompositeLink          composLink = new CompositeLink(new PrintingSystem());
            PrintableComponentLink pcLink1    = new PrintableComponentLink();
            PrintableComponentLink pcLink2    = new PrintableComponentLink();

            //richEditControl1.Document.Sections[0].Page.PaperKind = System.Drawing.Printing.PaperKind.A5;
            //pcLink2.Component = gridControl1;
            pcLink1.Component = tsfGridControl;

            //tsfGridView.OptionsPrint.RtfReportHeader = richEditControl1.Document.RtfText;

            composLink.PaperKind      = System.Drawing.Printing.PaperKind.A4;
            composLink.Landscape      = true;
            composLink.Margins.Left   = 50;
            composLink.Margins.Right  = 50;
            composLink.Margins.Top    = 50;
            composLink.Margins.Bottom = 50;

            //composLink.Links.Add(pcLink2);
//            composLink.Links[0].CustomPaperSize = new System.Drawing.Size(500, 200);
            composLink.Links.Add(pcLink1);

            composLink.ShowPreviewDialog();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            CompositeLink          compLink = new CompositeLink(new PrintingSystem());
            PrintableComponentLink gridLink = new PrintableComponentLink();

            gridLink.Component = gridControl1;
            Link headerLink = new Link();

            headerLink.CreateDetailArea += new CreateAreaEventHandler(headerLink_CreateDetailArea);
            Link footerLink = new Link();

            footerLink.CreateDetailArea += new CreateAreaEventHandler(footerLink_CreateDetailArea);
            compLink.Links.Add(headerLink);
            compLink.Links.Add(gridLink);
            compLink.Links.Add(footerLink);

            compLink.ShowPreviewDialog();
        }
Ejemplo n.º 5
0
 private void m_cmd_xuat_pdf_Click(object sender, EventArgs e)
 {
     try
     {
         DevExpress.XtraPrinting.PrintingSystem ps = new DevExpress.XtraPrinting.PrintingSystem();
         CompositeLink          cl       = new CompositeLink(ps);
         PrintableComponentLink pclChart = new PrintableComponentLink();
         PrintableComponentLink pclPivot = new PrintableComponentLink();
         pclChart.Component = m_chart_gpa_cpa;
         pclPivot.Component = m_pivot_kq_sinh_vien;
         cl.Links.AddRange(new object[] { pclChart, pclPivot });
         cl.ShowPreviewDialog();
         cl.PrintingSystem.ExportToPdf(Application.StartupPath + "\\..\\..\\CPA_GPA.pdf");
     }
     catch (Exception v)
     {
         MessageBox.Show("Đã xảy ra lỗi hệ thống!");
     }
 }
 private void m_cmd_xuat_pdf_Click(object sender, EventArgs e)
 {
     try
     {
         DevExpress.XtraPrinting.PrintingSystem ps = new DevExpress.XtraPrinting.PrintingSystem();
         CompositeLink          cl       = new CompositeLink(ps);
         PrintableComponentLink pclChart = new PrintableComponentLink();
         PrintableComponentLink pclPivot = new PrintableComponentLink();
         pclChart.Component = chartControl1;
         pclPivot.Component = m_pivot_ty_le_qua_mon;
         cl.Links.AddRange(new object[] { pclChart, pclPivot });
         cl.ShowPreviewDialog();
         cl.PrintingSystem.ExportToPdf(Application.StartupPath + "\\..\\..\\BaoCao.pdf");
     }
     catch
     {
         MessageBox.Show("Đã xảy ra lỗi hệ thống!");
     }
 }
Ejemplo n.º 7
0
        private void ReportAnImage(string filename, bool pageBreakAfterEachImage)
        {
            CompositeLink  compositeLink  = new CompositeLink(printingSystem1);
            Image          image          = Image.FromFile(filename);
            FrameDimension frameDimension = new FrameDimension(image.FrameDimensionsList[0]);
            int            framesCount    = image.GetFrameCount(frameDimension);

            for (int i = 0; i < framesCount; i++)
            {
                image.SelectActiveFrame(frameDimension, i);
                compositeLink.Links.Add(new ImageLink(new Bitmap(image), pageBreakAfterEachImage));
            }

            image.Dispose();

            compositeLink.PaperKind = PaperKind.A3;
            compositeLink.Landscape = true;

            compositeLink.ShowPreviewDialog();
        }
Ejemplo n.º 8
0
        private void printExportItem_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var ps       = new PrintingSystem();
            var gridLink = new PrintableComponentLink(ps)
            {
                Component = eventGrid
            };
            var schedulerLink = new PrintableComponentLink(ps)
            {
                Component = scheduler
            };
            var combinedLink = new CompositeLink(ps)
            {
                PaperKind = PaperKind.A4
            };

            combinedLink.Links.AddRange(new[] {
                schedulerLink,
                gridLink
            });

            combinedLink.ShowPreviewDialog();
        }
Ejemplo n.º 9
0
        private void m_cmd_xuat_pdf_Click(object sender, EventArgs e)
        {
            try
            {
                DevExpress.XtraPrinting.PrintingSystem ps = new DevExpress.XtraPrinting.PrintingSystem();
                CompositeLink cl = new CompositeLink(ps);
                PrintableComponentLink pclChart = new PrintableComponentLink();
                PrintableComponentLink pclPivot = new PrintableComponentLink();
                pclChart.Component = m_chart_gpa_cpa;
                pclPivot.Component = m_pivot_kq_sinh_vien;
                cl.Links.AddRange(new object[] { pclChart, pclPivot });
                cl.ShowPreviewDialog();
                cl.PrintingSystem.ExportToPdf(Application.StartupPath + "\\..\\..\\CPA_GPA.pdf");

            }
            catch (Exception v)
            {

                MessageBox.Show("Đã xảy ra lỗi hệ thống!");
            }
        }
Ejemplo n.º 10
0
        public static void PrintPreview(ChartControl chartControl, GridControl grid)
        {
            chartControl.OptionsPrint.SizeMode = DevExpress.XtraCharts.Printing.PrintSizeMode.Zoom;
            CompositeLink composLink = new CompositeLink(new PrintingSystem());
            PrintableComponentLink pcLink1 = new PrintableComponentLink();
            PrintableComponentLink pcLink2 = new PrintableComponentLink();
            Link linkMainReport = new Link();

            linkMainReport.CreateDetailArea += new CreateAreaEventHandler(linkMainReport_CreateDetailArea);
            Link linkGrid1Report = new Link();
            linkGrid1Report.CreateDetailArea += new CreateAreaEventHandler(linkGrid1Report_CreateDetailArea);
            Link linkGrid2Report = new Link();
            linkGrid2Report.CreateDetailArea += new CreateAreaEventHandler(linkChartReport_CreateDetailArea);

            pcLink1.Component = grid;
            pcLink2.Component = chartControl;

            composLink.Links.Add(linkGrid2Report);
            composLink.Links.Add(pcLink2);
            composLink.Links.Add(linkGrid1Report);
            composLink.Links.Add(pcLink1);
            composLink.Links.Add(linkMainReport);
            composLink.ShowPreviewDialog();
        }
 private void m_cmd_xuat_pdf_Click(object sender, EventArgs e)
 {
     try
     {
         DevExpress.XtraPrinting.PrintingSystem ps = new DevExpress.XtraPrinting.PrintingSystem();
         CompositeLink cl = new CompositeLink(ps);
         PrintableComponentLink pclChart = new PrintableComponentLink();
         PrintableComponentLink pclPivot = new PrintableComponentLink();
         pclChart.Component = chartControl1;
         pclPivot.Component = m_pivot_ty_le_qua_mon;
         cl.Links.AddRange(new object[] { pclChart, pclPivot });
         cl.ShowPreviewDialog();
         cl.PrintingSystem.ExportToPdf(Application.StartupPath + "\\..\\..\\BaoCao.pdf");
     }
     catch
     {
         MessageBox.Show("Đã xảy ra lỗi hệ thống!");
     }
 }
Ejemplo n.º 12
0
        private void exportToolStripMenuItem_Click(object sender, EventArgs e)
        {
            CompositeLink          cLink = new CompositeLink(new PrintingSystem());
            PrintableComponentLink pcl1  = new PrintableComponentLink();

            pcl1.Component = accExtreGridControl;
            PrintableComponentLink pcl2 = new PrintableComponentLink();

            pcl2.Component = accExtreOztGridControl;

            cLink.Links.Add(pcl1);
            cLink.Links.Add(pcl2);

            cLink.PaperKind      = System.Drawing.Printing.PaperKind.A4;
            cLink.Landscape      = true;
            cLink.Margins.Left   = 50;
            cLink.Margins.Right  = 50;
            cLink.Margins.Top    = 50;
            cLink.Margins.Bottom = 50;

            var Font = new Font("Tahoma", 12, FontStyle.Bold);

            PageHeaderFooter phf  = cLink.PageHeaderFooter as PageHeaderFooter;
            string           mdlH = string.Format("{0} Firma Extresi [{1:dd.MM.yyyy} - {2:dd.MM.yyyy}]", firma, dateEdit1.DateTime, dateEdit2.DateTime.AddDays(-1));

            //string mdlH = string.Format("{0} {1:MMMM yyyy} Ekstresi", firma, dateEdit1.DateTime);
            phf.Header.Content.AddRange(new string[] { "", mdlH, "" });
            phf.Header.LineAlignment = BrickAlignment.Far;
            phf.Header.Font          = Font;

            phf.Footer.Content.AddRange(new string[] { "[Date Printed] [Time Printed]", "", Program.USR });
            phf.Footer.LineAlignment = BrickAlignment.Near;

            cLink.ShowPreviewDialog();

            /*
             * PrintingSystem ps = new PrintingSystem();
             * PrintableComponentLink link = new PrintableComponentLink();
             * link.Component = accExtreGridControl;
             * PrintableComponentLink link2 = new PrintableComponentLink();
             * link2.Component = accExtreOzetGridControl;
             * ps.Links.Add(link);
             * ps.Links.Add(link2);
             *
             *
             * link.PaperKind = System.Drawing.Printing.PaperKind.A4;
             * link.Landscape = false;
             * link.Margins.Left = 50;
             * link.Margins.Right = 50;
             * link.Margins.Top = 50;
             * link.Margins.Bottom = 50;
             *
             * var Font = new Font("Tahoma", 12, FontStyle.Bold);
             *
             * PageHeaderFooter phf = link.PageHeaderFooter as PageHeaderFooter;
             * string mdlH = string.Format("Firma Extre");
             * phf.Header.Content.AddRange(new string[] { "", mdlH, "" });
             * phf.Header.LineAlignment = BrickAlignment.Far;
             * phf.Header.Font = Font;
             *
             * phf.Footer.Content.AddRange(new string[] { "[Date Printed] [Time Printed]", "", Program.USR });
             * phf.Footer.LineAlignment = BrickAlignment.Near;
             *
             * link.CreateDocument();
             * link.ShowPreview();*/
        }