private void button7_Click(object sender, EventArgs e) { RPT.RPT_ALL_PRODUCT myReport = new RPT.RPT_ALL_PRODUCT(); RPT.RPT_PRODUCT frm = new RPT.RPT_PRODUCT(); frm.crystalReportViewer1.ReportSource = myReport; frm.ShowDialog(); }
private void button8_Click(object sender, EventArgs e) { saveFileDialog1.Title = "Save to:"; saveFileDialog1.FileName = "Produits List.pdf"; saveFileDialog1.Filter = "PDF file |*.pdf"; if (saveFileDialog1.ShowDialog() == DialogResult.OK) { string Path = saveFileDialog1.FileName; RPT.RPT_ALL_PRODUCT myReport = new RPT.RPT_ALL_PRODUCT(); // Create Export Option ExportOptions export = new ExportOptions(); // Create Obect For Destination DiskFileDestinationOptions dfoption = new DiskFileDestinationOptions(); PdfFormatOptions pdfformat = new PdfFormatOptions(); // Set The Path Of Destination dfoption.DiskFileName = Path; export = myReport.ExportOptions; export.ExportDestinationType = ExportDestinationType.DiskFile; export.ExportFormatType = ExportFormatType.PortableDocFormat; export.ExportFormatOptions = pdfformat; export.ExportDestinationOptions = dfoption; myReport.Export(); MessageBox.Show("Liste Exportée avec Succès", "Export", MessageBoxButtons.OK, MessageBoxIcon.Information); } }