private void btnPrintAllCate_Click(object sender, EventArgs e) { RPT.FrmDonationReport frm = new RPT.FrmDonationReport(); RPT.RPT_Get_All_Categories myreport = new RPT.RPT_Get_All_Categories(); myreport.Refresh(); frm.DonationReport.ReportSource = myreport; frm.ShowDialog(); }
private void btnSaveAsPDF_Click(object sender, EventArgs e) { RPT.RPT_Get_All_Categories RPT_ALL_Categories = new RPT.RPT_Get_All_Categories(); ExportOptions export = new ExportOptions(); DiskFileDestinationOptions diskFileDestination = new DiskFileDestinationOptions(); PdfFormatOptions pdfFormat = new PdfFormatOptions(); diskFileDestination.DiskFileName = @"G:\CategorieList22.PDF"; export = RPT_ALL_Categories.ExportOptions; export.ExportDestinationType = ExportDestinationType.DiskFile; export.ExportFormatType = ExportFormatType.PortableDocFormat; export.ExportFormatOptions = pdfFormat; export.ExportDestinationOptions = diskFileDestination; try { RPT_ALL_Categories.Export(); } catch (Exception ex) { MessageBox.Show(ex.Message); } //end save it to PDF MessageBox.Show("Done!.."); }