private void btnPrintAsPdf_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            this.Cursor        = Cursors.WaitCursor;
            this.UseWaitCursor = true;
            //ProdPrint
            if (tcMain.SelectedTab.Name == "tpProd")
            {
                checkDirectory();
                fileName = "-Production";
                checkPdf();

                CompositeLink          comp  = new CompositeLink(new PrintingSystem());
                PrintableComponentLink link1 = new PrintableComponentLink();
                PrintableComponentLink link2 = new PrintableComponentLink();
                link1.Component = gcProd;
                link1.CreateReportHeaderArea += new CreateAreaEventHandler(link1_CreateReportHeaderArea);
                comp.Links.Add(link2);
                comp.Links.Add(link1);
                comp.Landscape = true;
                comp.PaperKind = System.Drawing.Printing.PaperKind.A2;
                comp.ExportToPdf(pdfName);
            }

            if (tcMain.SelectedTab.Name == "tpTramming")
            {
                //TrammingPrint
                checkDirectory();
                fileName = "-Tramming";
                checkPdf();

                CompositeLink          comp  = new CompositeLink(new PrintingSystem());
                PrintableComponentLink link1 = new PrintableComponentLink();
                PrintableComponentLink link2 = new PrintableComponentLink();
                link1.Component = gcTramming;
                link1.CreateReportHeaderArea += new CreateAreaEventHandler(link1_CreateReportHeaderArea);
                comp.Links.Add(link2);
                comp.Links.Add(link1);
                comp.Landscape = true;
                comp.PaperKind = System.Drawing.Printing.PaperKind.A2;
                comp.ExportToPdf(pdfName);
            }

            if (tcMain.SelectedTab.Name == "tpSB")
            {
                //SBPrint
                checkDirectory();
                fileName = "-ShiftBoss";
                checkPdf();

                CompositeLink          comp  = new CompositeLink(new PrintingSystem());
                PrintableComponentLink link1 = new PrintableComponentLink();
                PrintableComponentLink link2 = new PrintableComponentLink();
                link1.Component = gcSB;
                link1.CreateReportHeaderArea += new CreateAreaEventHandler(link1_CreateReportHeaderArea);
                comp.Links.Add(link2);
                comp.Links.Add(link1);
                comp.Landscape = true;
                comp.PaperKind = System.Drawing.Printing.PaperKind.A2;
                comp.ExportToPdf(pdfName);
            }
            this.Cursor        = Cursors.Default;
            this.UseWaitCursor = false;
            acControl.Show(frmMain.ActiveForm, "Print Completed", "Click on folder to open");
            //RemovedCode2
        }
Esempio n. 2
0
 protected override bool Export(CompositeLink link, string path, ExportOptions options)
 {
     link.ExportToPdf(path, new PdfExportOptions());
     return(true);
 }