private void ExportToExcelAll_Click(object sender, EventArgs e) { RPT.RPT_ALL_CATEGORIES myreport = new RPT.RPT_ALL_CATEGORIES(); //Create Export Options خاص باعدادات التقرير ExportOptions export = new ExportOptions(); //Create object for Destination خاص بمكان حفظ التقرير DiskFileDestinationOptions dfdoptions = new DiskFileDestinationOptions(); PdfFormatOptions pdfformat = new PdfFormatOptions(); //set the path of destination رابط المسار الذى نريد وضع الملف فيه dfdoptions.DiskFileName = "E:\\Categorieslist.pdf"; export = myreport.ExportOptions; export.ExportDestinationType = ExportDestinationType.DiskFile; export.ExportFormatType = ExportFormatType.PortableDocFormat; export.ExportFormatOptions = pdfformat; export.ExportDestinationOptions = dfdoptions; myreport.Refresh(); myreport.Export(); MessageBox.Show("List Exported Successfuly ! ", "Export", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void PrintAllCateg_Click(object sender, EventArgs e) { RPT.RPT_ALL_CATEGORIES rpt = new RPT.RPT_ALL_CATEGORIES(); RPT.FRM_RPT_PRODUCT frm = new RPT.FRM_RPT_PRODUCT(); rpt.Refresh(); frm.crystalReportViewer1.ReportSource = rpt; frm.ShowDialog(); }