Example #1
0
        public static void ExportToPDF(DataGridView DataGV, string Name)
        {
            DGVEPdfExportSettings exportSettings = new DGVEPdfExportSettings();

            SaveFileDialog saveFileDialog1 = new SaveFileDialog();

            saveFileDialog1.FileName   = Name;
            saveFileDialog1.DefaultExt = "pdf";
            saveFileDialog1.ShowDialog();

            exportSettings.ExportFileName          = saveFileDialog1.FileName; //Export file name
            exportSettings.OpenFileAfterGeneration = true;                     //Open generated file after export
            System.Drawing.Printing.PaperSize paper = new System.Drawing.Printing.PaperSize("A4", 1169, 827);
            exportSettings.PdfPaperSize = paper;


            //Set other settings here...
            DGVEPdfExporter exporter = new DGVEPdfExporter();

            exporter.Export(DataGV, exportSettings);
        }
Example #2
0
        public static void ExportToPDF(DataGridView DataGV, string Name)
        {
            DGVEPdfExportSettings exportSettings = new DGVEPdfExportSettings();

            SaveFileDialog saveFileDialog1 = new SaveFileDialog();
            saveFileDialog1.FileName = Name;
            saveFileDialog1.DefaultExt = "pdf";
            saveFileDialog1.ShowDialog();

            exportSettings.ExportFileName = saveFileDialog1.FileName;//Export file name
            exportSettings.OpenFileAfterGeneration = true; //Open generated file after export
            System.Drawing.Printing.PaperSize paper = new System.Drawing.Printing.PaperSize("A4", 1169, 827);
            exportSettings.PdfPaperSize = paper;

            //Set other settings here...
            DGVEPdfExporter exporter = new DGVEPdfExporter();
            exporter.Export(DataGV, exportSettings);
        }