private void BTM_SAVE_ALL_Click(object sender, EventArgs e) { RPT.RPT_ALL_CATT My_Report = new RPT.RPT_ALL_CATT(); ExportOptions export = new ExportOptions(); DiskFileDestinationOptions dfoption = new DiskFileDestinationOptions(); //PdfFormatOptions pdfformat = new PdfFormatOptions(); PdfFormatOptions pdfFormatt = new PdfFormatOptions(); //set destination of file to save in dfoption.DiskFileName = @"D:\categories_List.pdf"; export = My_Report.ExportOptions; export.ExportDestinationType = ExportDestinationType.DiskFile; //export.ExportFormatType = ExportFormatType.PortableDocFormat; export.ExportFormatType = ExportFormatType.PortableDocFormat; export.ExportFormatOptions = pdfFormatt; //export.ExportFormatOptions = pdfformat; export.ExportDestinationOptions = dfoption; My_Report.Refresh(); My_Report.Export(); MessageBox.Show("تم الحفظ ", "حفظ", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void BTM_PRINT_ALL_Click(object sender, EventArgs e) { RPT.RPT_ALL_CATT rpt = new RPT.RPT_ALL_CATT(); RPT.FRM_RPT_PRODUCT frm = new RPT.FRM_RPT_PRODUCT(); //rpt.SetParameterValue("@ID", Convert.ToInt32(TXT_ID.Text)); rpt.Refresh(); frm.crystalReportViewer1.ReportSource = rpt; frm.ShowDialog(); }