private void btnPA_Click(object sender, EventArgs e) { try { RPT.RPT_All_Categories RPT = new RPT.RPT_All_Categories(); RPT.FRM_RPT_Medicine FRM = new RPT.FRM_RPT_Medicine(); RPT.Refresh(); FRM.crystalReportViewer1.ReportSource = RPT; FRM.ShowDialog(); } catch { MessageBox.Show("حدث خطأ ما", "خطأ", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnExPDF_Click(object sender, EventArgs e) { try { RPT.RPT_All_Categories RPT = new RPT.RPT_All_Categories(); //Create export options ExportOptions EXO = new ExportOptions(); //PDF Format Options object PdfFormatOptions PDFFormat = new PdfFormatOptions(); //Create object for destination DiskFileDestinationOptions DFDO = new DiskFileDestinationOptions(); //Set the path of destination DFDO.DiskFileName = @"D:\CategoriesList.pdf"; //Options EXO = RPT.ExportOptions; // EXO.ExportDestinationType = ExportDestinationType.DiskFile; // EXO.ExportFormatType = ExportFormatType.PortableDocFormat; // EXO.ExportFormatOptions = PDFFormat; // EXO.ExportDestinationOptions = DFDO; //Refresh RPT.Refresh(); //Export RPT.Export(); //Show message MessageBox.Show("تم تصدير اللائحة بنجاح", "عملية التصدير", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch { MessageBox.Show("حدث خطأ ما", "خطأ", MessageBoxButtons.OK, MessageBoxIcon.Error); } }