private void ExportToPdfCurrent_Click(object sender, EventArgs e) { RPT.rpt_single_category myReport = new RPT.rpt_single_category(); // Create Export options ExportOptions export = new ExportOptions(); // Create object for destination DiskFileDestinationOptions dfoptions = new DiskFileDestinationOptions(); PdfFormatOptions pdfformat = new PdfFormatOptions(); // Set the path of destination dfoptions.DiskFileName = @"D:\scienses\life with c#\projects\Products Managemnt\Reports\CategoryDetails.pdf"; export = myReport.ExportOptions; export.ExportDestinationType = ExportDestinationType.DiskFile; export.ExportFormatType = ExportFormatType.PortableDocFormat; export.ExportFormatOptions = pdfformat; export.ExportDestinationOptions = dfoptions; myReport.SetParameterValue("@id", Convert.ToInt32(txtID.Text)); myReport.Export(); MessageBox.Show("List Eported Successfully ", "Export", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void BTM_SAVE_SINGLE_Click(object sender, EventArgs e) { RPT.RPT_SINGLE_CATEGORY My_Report = new RPT.RPT_SINGLE_CATEGORY(); 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:\category_details.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.SetParameterValue("@ID", Convert.ToInt32(TXT_ID.Text)); //My_Report.Refresh(); My_Report.Export(); MessageBox.Show("تم الحفظ ", "حفظ", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void exportToPdfAll_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 dfoptions = new DiskFileDestinationOptions(); PdfFormatOptions pdfformat = new PdfFormatOptions(); // Set the path of destination dfoptions.DiskFileName = @"D:\scienses\life with c#\projects\Products Managemnt\Reports\CategoriesList.pdf"; export = myReport.ExportOptions; export.ExportDestinationType = ExportDestinationType.DiskFile; export.ExportFormatType = ExportFormatType.PortableDocFormat; export.ExportFormatOptions = pdfformat; export.ExportDestinationOptions = dfoptions; myReport.Refresh(); myReport.Export(); MessageBox.Show("List Eported Successfully ", "Export", MessageBoxButtons.OK, MessageBoxIcon.Information); }
public static void ExportPdf(string filename, ReportClass crReport) { var dest = new DiskFileDestinationOptions { DiskFileName = GetPath(filename) }; var formatOpt = new PdfFormatOptions { FirstPageNumber = 0, LastPageNumber = 0, UsePageRange = false, CreateBookmarksFromGroupTree = false }; var ex = new ExportOptions { ExportDestinationType = ExportDestinationType.DiskFile, ExportDestinationOptions = dest, ExportFormatType = ExportFormatType.PortableDocFormat, ExportFormatOptions = formatOpt }; crReport.SetDatabaseLogon("sa", "sabroso123"); crReport.Export(ex); }
private void button11_Click(object sender, EventArgs e) { RPT.GET_ALL_CATEGORIES myreport = new RPT.GET_ALL_CATEGORIES(); //creat export options ExportOptions export = new ExportOptions(); //creat object for destination DiskFileDestinationOptions Pdfoptions = new DiskFileDestinationOptions(); PdfFormatOptions PDFformat = new PdfFormatOptions(); // Pdfoptions.DiskFileName = @"D:\CATEGORIESlist.PDF"; export = myreport.ExportOptions; export.ExportDestinationType = ExportDestinationType.DiskFile; export.ExportFormatType = ExportFormatType.PortableDocFormat; export.ExportFormatOptions = PDFformat; export.ExportDestinationOptions = Pdfoptions; myreport.Refresh(); myreport.Export(); MessageBox.Show("list exported successfully !", "export", MessageBoxButtons.OKCancel, MessageBoxIcon.Information); }
private void btnPDF_Click(object sender, EventArgs e) { RPT.rpt_all_Categories myreport = new RPT.rpt_all_Categories(); //create export options ExportOptions expoert = new ExportOptions(); //create object for destination DiskFileDestinationOptions dfoptions = new DiskFileDestinationOptions(); PdfFormatOptions pdfformat = new PdfFormatOptions(); //set the path of destionation SaveFileDialog ofd = new SaveFileDialog(); ofd.Filter = "ملفات pdf | *.pdf"; if (ofd.ShowDialog() == DialogResult.OK) { dfoptions.DiskFileName = ofd.FileName; } expoert = myreport.ExportOptions; expoert.ExportDestinationType = ExportDestinationType.DiskFile; expoert.ExportFormatType = ExportFormatType.PortableDocFormat; expoert.ExportFormatOptions = pdfformat; expoert.ExportDestinationOptions = dfoptions; myreport.Refresh(); myreport.Export(); MessageBox.Show("تم حفظ الملف بنجاح", "الحفظ", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void button12_Click(object sender, EventArgs e) { RPT.rpt_singl_categories myreport2 = new RPT.rpt_singl_categories(); //creat export options ExportOptions export = new ExportOptions(); //creat object for destination DiskFileDestinationOptions Pdfoptions = new DiskFileDestinationOptions(); PdfFormatOptions PDFformat = new PdfFormatOptions(); // Pdfoptions.DiskFileName = @"D:\CATEGORIESlistdetales.PDF"; export = myreport2.ExportOptions; export.ExportDestinationType = ExportDestinationType.DiskFile; export.ExportFormatType = ExportFormatType.PortableDocFormat; export.ExportFormatOptions = PDFformat; export.ExportDestinationOptions = Pdfoptions; myreport2.Refresh(); myreport2.SetParameterValue("@ID", Convert.ToInt32(txtID.Text)); myreport2.Export(); MessageBox.Show("list exported successfully !", "export", MessageBoxButtons.OKCancel, MessageBoxIcon.Information); }
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 buttonPDFcurrent_Click(object sender, EventArgs e) { string filedes = @"D:\stock proj\CategoryDetails.pdf"; if (File.Exists(filedes)) { File.Delete(filedes); } Reports.Single_Cat_Report report = new Reports.Single_Cat_Report(); report.Refresh(); //export options obj report.SetParameterValue("@id", int.Parse(textid.Text)); ExportOptions ex = new ExportOptions(); //create disk obj DiskFileDestinationOptions disk = new DiskFileDestinationOptions(); PdfFormatOptions pdfformat = new PdfFormatOptions(); //set the path disk.DiskFileName = @"D:\stock proj\CategoryDetails.pdf"; ex = report.ExportOptions; ex.ExportDestinationType = ExportDestinationType.DiskFile; ex.ExportFormatType = ExportFormatType.PortableDocFormat; ex.ExportFormatOptions = pdfformat; ex.ExportDestinationOptions = disk; report.Export(); MessageBox.Show("Successfuly Stored", "Stored Report", MessageBoxButtons.OK, MessageBoxIcon.Information); }
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 btnSaveAsPDFcurrentCate_Click(object sender, EventArgs e) { /* * RPT.RPT_Get_Single_Categorie get_Single_Categorie = new RPT.RPT_Get_Single_Categorie(); * //RPT.CrystalReport1 get = new RPT.CrystalReport1(); * RPT.RPT_ALL_Donations get_All_Donations = new RPT.RPT_ALL_Donations(); * ExportOptions export = new ExportOptions(); * DiskFileDestinationOptions diskFileDestination = new DiskFileDestinationOptions(); * * PdfFormatOptions pdfFormat = new PdfFormatOptions(); * diskFileDestination.DiskFileName = @"G:\SingleCategorie2234.PDF"; * export = get_Single_Categorie.ExportOptions; * * export.ExportDestinationType = ExportDestinationType.DiskFile; * export.ExportFormatType = ExportFormatType.PortableDocFormat; * export.ExportFormatOptions = pdfFormat; * export.ExportDestinationOptions = diskFileDestination; * * get_Single_Categorie.Refresh(); * get_Single_Categorie.SetParameterValue("@ID", Convert.ToInt32(txtCateID.Text)); * /* * get_Single_Categorie.Refresh(); * get_Single_Categorie.SetParameterValue("@ID", Convert.ToInt32(txtCateID.Text)); * try { get_Single_Categorie.Export(); } * catch (Exception ex) * { * MessageBox.Show(ex.Message); * } * //end save it to PDF * MessageBox.Show("Done!..");*/ //RPT.RPT_Single_Category get_Single_Category = new RPT.RPT_Single_Category(); //RPT.RPT_Get_Single_Category get_Single_Category = new RPT.RPT_Get_Single_Category(); RPT.RPT_Get_Single_Category get_Single_Category = new RPT.RPT_Get_Single_Category(); // RPT.RPT_ALL_Donations get_All_Donations = new RPT.RPT_ALL_Donations(); ExportOptions export = new ExportOptions(); DiskFileDestinationOptions diskFileDestination = new DiskFileDestinationOptions(); PdfFormatOptions pdfFormat = new PdfFormatOptions(); diskFileDestination.DiskFileName = @"G:\SingleCategorie113562test.PDF"; export = get_Single_Category.ExportOptions; export.ExportDestinationType = ExportDestinationType.DiskFile; export.ExportFormatType = ExportFormatType.PortableDocFormat; export.ExportFormatOptions = pdfFormat; export.ExportDestinationOptions = diskFileDestination; get_Single_Category.Refresh(); get_Single_Category.SetParameterValue("@ID", Convert.ToInt32(txtCateID.Text)); try { get_Single_Category.Export(); } catch (Exception ex) { MessageBox.Show(ex.Message); } //end save it to PDF MessageBox.Show("Done!.."); }
private void saveCatsProdsToPdf_Click(object sender, EventArgs e) { // todo : fix the save file problem (fixed and now works properly) Emad .. Feb 2, 2018 try { lblState.Text = "جاري الحفظ ..."; this.Cursor = Cursors.WaitCursor; Reports.rpt_singleCategoryProducts rpt_singleCatProducts = new Reports.rpt_singleCategoryProducts(); // refresh the report (clear any binded params, if the report was used before and already has a binded param) rpt_singleCatProducts.Refresh(); // bind the category_ID param to the report rpt_singleCatProducts.SetParameterValue("@cat_id", Convert.ToInt32(dataGridView1.CurrentRow.Cells[0].Value.ToString())); //create export report options ExportOptions exprtOpts = new ExportOptions(); DiskFileDestinationOptions dfOptions = new DiskFileDestinationOptions(); PdfFormatOptions pdfFrmtOps = new PdfFormatOptions(); SaveFileDialog sfd = new SaveFileDialog(); sfd.Title = "حفظ قائمة المنتجات"; sfd.Filter = "PDF files (*.pdf)|*.pdf|All files (*.*)|*.*"; sfd.CheckPathExists = true; sfd.ShowDialog(); //MessageBox.Show(sfd.FileName); // bind the result "address of file as a string" to the dfOptions object of (DiskFileDestinationOptions dfOptions = new DiskFileDestinationOptions();) dfOptions.DiskFileName = sfd.FileName; exprtOpts = rpt_singleCatProducts.ExportOptions; exprtOpts.ExportDestinationType = ExportDestinationType.DiskFile; exprtOpts.ExportFormatType = ExportFormatType.PortableDocFormat; exprtOpts.ExportFormatOptions = pdfFrmtOps; exprtOpts.ExportDestinationOptions = dfOptions; rpt_singleCatProducts.Export(); lblState.Text = "تم الحفظ بنجاح"; this.Cursor = Cursors.Default; } catch (UnauthorizedAccessException) { MessageBox.Show("ليس لديك صلاحية لحفظ الملف في هذا المسار. من فضلك اختر مسار مختلف", "خطا بالصلاحية", MessageBoxButtons.OK, MessageBoxIcon.Error); lblState.Text = ".."; } }
public void Export_Monthly_Invoice_Report() { rptDoc = new Tax.Tax_Invoice_Reports.Tax_Invoice_Monthly_rpt(); Logon_To_Crystal(); rptDoc.SetParameterValue("@Monthly_Invoice_Id", invoiceid); rptDoc.SetParameterValue("@Trans", "SELECT_Client_ID"); rptDoc.SetParameterValue("@Client_Id", clientid); rptDoc.SetParameterValue("@Branch_ID", commonid); rptDoc.SetParameterValue("@Client_Number", commonid); rptDoc.SetParameterValue("@Client_Name", ""); rptDoc.SetParameterValue("@Client_Code", ""); rptDoc.SetParameterValue("@Client_Photo", ""); rptDoc.SetParameterValue("@Client_Country", commonid); rptDoc.SetParameterValue("@Client_State", commonid); rptDoc.SetParameterValue("@Client_District", commonid); rptDoc.SetParameterValue("@Client_City", ""); rptDoc.SetParameterValue("@Client_Pin", ""); rptDoc.SetParameterValue("@Client_Address", ""); rptDoc.SetParameterValue("@Client_Phone", ""); rptDoc.SetParameterValue("@Client_Fax", ""); rptDoc.SetParameterValue("@Client_Email", ""); rptDoc.SetParameterValue("@Client_Web", ""); rptDoc.SetParameterValue("@Inserted_By", commonid); rptDoc.SetParameterValue("@Inserted_date", DateTime.Now); rptDoc.SetParameterValue("@Modified_By", commonid); rptDoc.SetParameterValue("@Modified_Date", DateTime.Now); rptDoc.SetParameterValue("@status", "True"); rptDoc.SetParameterValue("@External_Client_Id", commonid); rptDoc.SetParameterValue("@Monthly_Invoice_Id", invoiceid, "Individual"); ExportOptions CrExportOptions; FileInfo newFile = new FileInfo(@"\\192.168.12.33\Invoice-Reports\Tax_Invoice_Monthly.pdf"); DiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions(); PdfFormatOptions CrFormatTypeOptions = new PdfFormatOptions(); CrDiskFileDestinationOptions.DiskFileName = newFile.ToString(); CrExportOptions = rptDoc.ExportOptions; CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile; CrExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat; CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions; CrExportOptions.FormatOptions = CrFormatTypeOptions; rptDoc.Export(); }
private void btnExPDFMed_Click(object sender, EventArgs e) { try { RPT.RPT_Single_Category RPT = new RPT.RPT_Single_Category(); //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:\CategoryDetails.pdf"; //Options EXO = RPT.ExportOptions; // EXO.ExportDestinationType = ExportDestinationType.DiskFile; // EXO.ExportFormatType = ExportFormatType.PortableDocFormat; // EXO.ExportFormatOptions = PDFFormat; // EXO.ExportDestinationOptions = DFDO; //Refresh RPT.Refresh(); //Get parameter RPT.SetParameterValue("@ID", txtID.Text); //Export RPT.Export(); //Show message MessageBox.Show("تم تصدير اللائحة بنجاح", "عملية التصدير", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch { MessageBox.Show("حدث خطأ ما", "خطأ", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void bntExprtPDF_Click(object sender, EventArgs e) { // todo : fix the save file problem (fixed and now works properly) Emad .. Feb 2, 2018 try { lblState.Text = "جاري الحفظ ..."; Reports.rpt_all_products allProductsCrystalRpt = new Reports.rpt_all_products(); // refresh the report (clear any binded params, if the report was used before and already has a binded param) allProductsCrystalRpt.Refresh(); //create export report options ExportOptions exprtOpts = new ExportOptions(); DiskFileDestinationOptions dfOptions = new DiskFileDestinationOptions(); PdfFormatOptions pdfFrmtOps = new PdfFormatOptions(); SaveFileDialog sfd = new SaveFileDialog(); sfd.Title = "حفظ قائمة المنتجات"; sfd.Filter = "PDF files (*.pdf)|*.pdf|All files (*.*)|*.*"; sfd.CheckPathExists = true; sfd.ShowDialog(); //MessageBox.Show(sfd.FileName); // bind the result "address of file as a string" to the dfOptions object of (DiskFileDestinationOptions dfOptions = new DiskFileDestinationOptions();) dfOptions.DiskFileName = sfd.FileName; exprtOpts = allProductsCrystalRpt.ExportOptions; exprtOpts.ExportDestinationType = ExportDestinationType.DiskFile; exprtOpts.ExportFormatType = ExportFormatType.PortableDocFormat; exprtOpts.ExportFormatOptions = pdfFrmtOps; exprtOpts.ExportDestinationOptions = dfOptions; allProductsCrystalRpt.Export(); lblState.Text = "تم الحفظ بنجاح"; } catch (UnauthorizedAccessException) { MessageBox.Show("ليس لديك صلاحية لحفظ الملف في هذا المسار. من فضلك اختر مسار مختلف", "خطا بالصلاحية", MessageBoxButtons.OK, MessageBoxIcon.Error); lblState.Text = ".."; } }
private void sveAllCats_Click(object sender, EventArgs e) { RPRT.CrystalReport_All_CAT cat = new RPRT.CrystalReport_All_CAT(); ExportOptions export = new ExportOptions(); DiskFileDestinationOptions Dist = new DiskFileDestinationOptions(); PdfFormatOptions pdf = new PdfFormatOptions(); Dist.DiskFileName = @"C: \Users\hima\Desktop\\PDF_All_Cat.pdf"; export = cat.ExportOptions; export.ExportDestinationType = ExportDestinationType.DiskFile; export.ExportFormatType = ExportFormatType.PortableDocFormat; export.ExportFormatOptions = pdf; export.ExportDestinationOptions = Dist; cat.Refresh(); cat.Export(); MessageBox.Show("File Exported on Desktop Successfully", "INFO", MessageBoxButtons.OK); }
public void Export_Report() { rptDoc = new Abstractor_Reports.Abstractor_Payment(); Logon_To_Crystal(); rptDoc.SetParameterValue("@Abstractor_Monthly_Invoice_ID", Monthly_Invoice_Id); ExportOptions CrExportOptions; Download_Ftp_File("AbstractorReport.pdf", "ftp://titlelogy.com/Ftp_Application_Files/OMS/Abstractor_Files/Abstractor_Monthly_Payement.pdf"); FileInfo newFile = new FileInfo("C:\\OMS\\Temp" + "\\" + "Abstractor_Monthly_Payement.pdf"); DiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions(); PdfFormatOptions CrFormatTypeOptions = new PdfFormatOptions(); CrDiskFileDestinationOptions.DiskFileName = newFile.ToString(); CrExportOptions = rptDoc.ExportOptions; CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile; CrExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat; CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions; CrExportOptions.FormatOptions = CrFormatTypeOptions; rptDoc.Export(); }
private void exportToPdfCurrent_Click(object sender, EventArgs e) { RPT.rpt_single_category myrep_single_categories_to_pdf = new RPT.rpt_single_category(); //Create export options ExportOptions export = new ExportOptions(); //Create object to save destination DiskFileDestinationOptions dfOptions = new DiskFileDestinationOptions(); PdfFormatOptions pdfFormat = new PdfFormatOptions(); // set destination name dfOptions.DiskFileName = @"T:\FCAI\My Projects\DB\CategoriesListWithProducts.pdf"; export = myrep_single_categories_to_pdf.ExportOptions; export.ExportDestinationType = ExportDestinationType.DiskFile; export.ExportFormatType = ExportFormatType.PortableDocFormat; export.ExportFormatOptions = pdfFormat; export.ExportDestinationOptions = dfOptions; myrep_single_categories_to_pdf.SetParameterValue("@id", Convert.ToInt32(txtID.Text)); myrep_single_categories_to_pdf.Export(); MessageBox.Show("تم تصدير جميع الاصناف ومنتجاتهم الى ملف PDF.", "تصدير PDF", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void exportToPdfAll_Click(object sender, EventArgs e) { RPT.rpt_all_categories myrep_all_categories_to_pdf = new RPT.rpt_all_categories(); //Create export options ExportOptions export = new ExportOptions(); //Create object to save destination DiskFileDestinationOptions dfOptions = new DiskFileDestinationOptions(); PdfFormatOptions pdfFormat = new PdfFormatOptions(); // set destination name dfOptions.DiskFileName = @"T:\FCAI\My Projects\DB\CategoriesList.pdf"; export = myrep_all_categories_to_pdf.ExportOptions; export.ExportDestinationType = ExportDestinationType.DiskFile; export.ExportFormatType = ExportFormatType.PortableDocFormat; export.ExportFormatOptions = pdfFormat; export.ExportDestinationOptions = dfOptions; myrep_all_categories_to_pdf.Refresh(); myrep_all_categories_to_pdf.Export(); MessageBox.Show("تم تصدير جميع الاصناف الى ملف PDF.", "تصدير PDF", MessageBoxButtons.OK, MessageBoxIcon.Information); }
public void Export_Report() { SplashScreenManager.ShowForm(this, typeof(Masters.WaitForm1), true, true, false); try { rptDoc = new InvReport.Invoice_Report(); Logon_To_Crystal(); rptDoc.SetParameterValue("@Order_ID", Order_Id); ExportOptions CrExportOptions; string dirTemp = "C:\\OMS\\Temp"; if (!Directory.Exists(dirTemp)) { var dirInfo = Directory.CreateDirectory(dirTemp); } string sourcePath = "ftp://" + Ftp_Domain_Name + "/Ftp_Application_Files/OMS/Invoice_Reports/Invoice.pdf"; Download_Ftp_File("Invoice.pdf", sourcePath); string Abstractor_Name = "00001"; string File_Name = "0001.pdf"; string dest_path1 = dirTemp + "\\" + Abstractor_Name + "\\" + File_Name; FileInfo newFile = new FileInfo(dest_path1); DiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions(); PdfFormatOptions CrFormatTypeOptions = new PdfFormatOptions(); CrDiskFileDestinationOptions.DiskFileName = newFile.ToString(); CrExportOptions = rptDoc.ExportOptions; CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile; CrExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat; CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions; CrExportOptions.FormatOptions = CrFormatTypeOptions; rptDoc.Export(); } catch (Exception ex) { SplashScreenManager.CloseForm(false); MessageBox.Show("Error Occured Please Check With Administrator"); } finally { SplashScreenManager.CloseForm(false); } }
private void btnExport_Click(object sender, EventArgs e) { RPT.rpt_single_category myReport = new RPT.rpt_single_category(); PdfFormatOptions pdfformat = new PdfFormatOptions(); //crate export qptions ExportOptions export = new ExportOptions(); //create object for destination DiskFileDestinationOptions dfoptions = new DiskFileDestinationOptions(); //set the path of destination dfoptions.DiskFileName = @"F:\المحاسبة\Program\ProductsHB\Categories.pdf"; export = myReport.ExportOptions; export.ExportDestinationType = ExportDestinationType.DiskFile; export.ExportFormatType = ExportFormatType.PortableDocFormat; export.ExportFormatOptions = pdfformat; export.ExportDestinationOptions = dfoptions; myReport.SetParameterValue("@id", Convert.ToInt32(txtID.Text)); myReport.Export(); MessageBox.Show("!تم حفظ اللائحة بنجاح", "تم", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void sveCatWprd_Click(object sender, EventArgs e) { RPRT.CrystalReport_Sngle_Cat cat = new RPRT.CrystalReport_Sngle_Cat(); cat.SetParameterValue("@ID", int.Parse(textBox_CatID.Text)); ExportOptions export = new ExportOptions(); DiskFileDestinationOptions Dist = new DiskFileDestinationOptions(); PdfFormatOptions pdf = new PdfFormatOptions(); Dist.DiskFileName = @"C: \Users\hima\Desktop\\PDF_Cat.pdf"; export = cat.ExportOptions; export.ExportDestinationType = ExportDestinationType.DiskFile; export.ExportFormatType = ExportFormatType.PortableDocFormat; export.ExportFormatOptions = pdf; export.ExportDestinationOptions = Dist; cat.Refresh(); cat.SetParameterValue("@ID", int.Parse(textBox_CatID.Text)); cat.Export(); MessageBox.Show("File Exported on Desktop Successfully", "INFO", MessageBoxButtons.OK); }
private void btnSelectPdf_Click(object sender, EventArgs e) { RPT.RPT_SINGLE_CATEGORE myreport = new RPT.RPT_SINGLE_CATEGORE(); //create export options ExportOptions expoert = new ExportOptions(); //create object for destination DiskFileDestinationOptions dfoptions = new DiskFileDestinationOptions(); PdfFormatOptions pdfformat = new PdfFormatOptions(); //set the path of destionation SaveFileDialog ofd = new SaveFileDialog(); ofd.Filter = "ملفات pdf | *.pdf"; if (ofd.ShowDialog() == DialogResult.OK) { dfoptions.DiskFileName = ofd.FileName; } expoert = myreport.ExportOptions; expoert.ExportDestinationType = ExportDestinationType.DiskFile; expoert.ExportFormatType = ExportFormatType.PortableDocFormat; expoert.ExportFormatOptions = pdfformat; expoert.ExportDestinationOptions = dfoptions; // set parameters myreport.SetParameterValue("@ID", Convert.ToInt32(txtID.Text)); // make refresh // myreport.Refresh(); myreport.Export(); MessageBox.Show("تم حفظ الملف بنجاح", "الحفظ", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void btnSaveCatPro_Click(object sender, EventArgs e) { saveFileDialog1.Title = "Save to:"; saveFileDialog1.FileName = "Categories Details.pdf"; saveFileDialog1.Filter = "PDF file |*.pdf"; if (saveFileDialog1.ShowDialog() == DialogResult.OK) { string Path = saveFileDialog1.FileName; RPT.RPT_SINGLE_CATEGORIE myReport = new RPT.RPT_SINGLE_CATEGORIE(); // 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.SetParameterValue("@ID", Convert.ToInt32(txtID.Text)); myReport.Export(); MessageBox.Show("Liste Exportée avec Succès", "Export", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void btnSaveAll_Click(object sender, EventArgs e) { RPT.rpt_all_categories rpt = new RPT.rpt_all_categories(); ExportOptions export = new ExportOptions(); export = rpt.ExportOptions; DiskFileDestinationOptions dfoptions = new DiskFileDestinationOptions(); string PdfReportsPath = Application.StartupPath.Substring(0, (Application.StartupPath.Length - 10)) + @"\PdfReports\"; dfoptions.DiskFileName = PdfReportsPath + "AllCategoryList-" + DateTime.Now.ToString("dddd, dd MMMM yyyy") + ".pdf"; export.ExportDestinationOptions = dfoptions; export.ExportDestinationType = ExportDestinationType.DiskFile; PdfFormatOptions pdf = new PdfFormatOptions(); export.ExportFormatOptions = pdf; export.ExportFormatType = ExportFormatType.PortableDocFormat; rpt.Refresh(); rpt.Export(); MessageBox.Show("All Category List Exported Successfully", "Export", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void btnFinish_Click(object sender, EventArgs e) { try { ExportOptions ExpOpts; DiskFileDestinationOptions DFDO = new DiskFileDestinationOptions(); PdfFormatOptions PFO = new PdfFormatOptions(); DFDO.DiskFileName = pdfFile; ExpOpts = repdoc.ExportOptions; ExpOpts.ExportDestinationType = ExportDestinationType.DiskFile; ExpOpts.ExportFormatType = ExportFormatType.PortableDocFormat; ExpOpts.DestinationOptions = DFDO; ExpOpts.FormatOptions = PFO; repdoc.Export(); SendMail(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
public void ExportReport(string fullPathXmlFileName, string fullPathReportGeneratorFileName, string fullPathEndOfRunReportPdfFileName) { if (string.IsNullOrEmpty(fullPathXmlFileName) || string.IsNullOrEmpty(fullPathReportGeneratorFileName) || string.IsNullOrEmpty(fullPathEndOfRunReportPdfFileName)) { return; } try { if (FormatReport(fullPathXmlFileName, fullPathReportGeneratorFileName) == false) { return; } // Declare variables and get the export options. ExportOptions exportOpts = new ExportOptions(); PdfFormatOptions pdfFormatOpts = new PdfFormatOptions(); DiskFileDestinationOptions diskOpts = new DiskFileDestinationOptions(); exportOpts = cryRptDoc.ExportOptions; // Set the pdf format options. exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat; exportOpts.FormatOptions = pdfFormatOpts; // Set the disk file options and export. exportOpts.ExportDestinationType = ExportDestinationType.DiskFile; diskOpts.DiskFileName = fullPathEndOfRunReportPdfFileName; exportOpts.DestinationOptions = diskOpts; cryRptDoc.Export(); // Close the report cryRptDoc.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnSaveCat_Click(object sender, EventArgs e) { RPT.rpt_single_category rpt = new RPT.rpt_single_category(); rpt.SetParameterValue("@id", Int32.Parse(txtCatId.Text)); ExportOptions export = new ExportOptions(); export = rpt.ExportOptions; DiskFileDestinationOptions dfoptions = new DiskFileDestinationOptions(); string PdfReportsPath = Application.StartupPath.Substring(0, (Application.StartupPath.Length - 10)) + @"\PdfReports\"; dfoptions.DiskFileName = PdfReportsPath + "CategoryList-" + DateTime.Now.ToString("dddd, dd MMMM yyyy") + ".pdf"; export.ExportDestinationOptions = dfoptions; export.ExportDestinationType = ExportDestinationType.DiskFile; PdfFormatOptions pdf = new PdfFormatOptions(); export.ExportFormatOptions = pdf; export.ExportFormatType = ExportFormatType.PortableDocFormat; rpt.Export(); MessageBox.Show("Category Product List Exported Successfully", "Export", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void exportpdfbtn_Click(object sender, EventArgs e) { All_Cat_Report report = new All_Cat_Report(); ExportOptions export = new ExportOptions(); DiskFileDestinationOptions dfoption = new DiskFileDestinationOptions(); PdfFormatOptions pdf = new PdfFormatOptions(); SaveFileDialog save = new SaveFileDialog(); save.Filter = "ملف اكسيل | *.pdf"; save.InitialDirectory = @"C:\"; if (save.ShowDialog() == DialogResult.OK) { dfoption.DiskFileName = save.FileName; export = report.ExportOptions; export.ExportDestinationType = ExportDestinationType.DiskFile; export.ExportFormatType = ExportFormatType.PortableDocFormat; export.ExportFormatOptions = pdf; export.ExportDestinationOptions = dfoption; report.Refresh(); report.Export(); MessageBox.Show("تمت العملية بنجاح", "معلومة", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void ExportToPdfCurrent_Click(object sender, EventArgs e) { RPT.rpt_single_category myReport = new RPT.rpt_single_category(); //Create Export Options ExportOptions export = new ExportOptions(); //Create Object For destination DiskFileDestinationOptions dfoptions = new DiskFileDestinationOptions(); //Create Object For Excel Format PdfFormatOptions pdfformat = new PdfFormatOptions(); //Set the path of destination dfoptions.DiskFileName = @"E:\CategoryDetails.pdf"; //Set Report Options to crystal export options export = myReport.ExportOptions; //Set Destination type export.ExportDestinationType = ExportDestinationType.DiskFile; //Set the type of document export.ExportFormatType = ExportFormatType.PortableDocFormat; //format the excel document export.ExportFormatOptions = pdfformat; //Set Destination option export.ExportDestinationOptions = dfoptions; myReport.SetParameterValue("@id", Convert.ToInt32(txtID.Text)); //Export the report myReport.Export(); MessageBox.Show("List Exported Successfully !", "Export", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void button7_Click(object sender, EventArgs e) { this.dataGridView1.DataSource = prd.GET_ALL_PRODUCTS(); RPT.RPT_ALL_PRD myReport = new RPT.RPT_ALL_PRD(); //Create Export Options ExportOptions export = new ExportOptions(); //Create Object For Destination DiskFileDestinationOptions dfOptionXLS = new DiskFileDestinationOptions(); DiskFileDestinationOptions dfOptionPDF = new DiskFileDestinationOptions(); PdfFormatOptions pdfFormat = new PdfFormatOptions(); ExcelFormatOptions excelFormat = new ExcelFormatOptions(); //Set The Path of Destination For XLS saveFileDialog1.Filter = "Text Files | *.XLS"; saveFileDialog1.InitialDirectory = "D:\\"; if (saveFileDialog1.ShowDialog() == DialogResult.OK) { dfOptionXLS.DiskFileName = saveFileDialog1.FileName; } //dfOptionXLS.DiskFileName = @"D:\PRODUCTLIST.xls"; export = myReport.ExportOptions; export.ExportDestinationType = ExportDestinationType.DiskFile; export.ExportFormatType = ExportFormatType.Excel; export.ExportFormatOptions = excelFormat; export.ExportDestinationOptions = dfOptionXLS; myReport.Export(); MessageBox.Show("List XLS Exported Successfully", "Export", MessageBoxButtons.OK, MessageBoxIcon.Information); //Set The Path of Destination For PDF //dfOptionPDF.DiskFileName = @"D:\PRODUCTLIST.PDF"; saveFileDialog1.FileName = ""; saveFileDialog1.Filter = "Text Files | *.PDF"; saveFileDialog1.InitialDirectory = "D:\\"; if (saveFileDialog1.ShowDialog() == DialogResult.OK) { dfOptionPDF.DiskFileName = saveFileDialog1.FileName; } export = myReport.ExportOptions; export.ExportDestinationType = ExportDestinationType.DiskFile; export.ExportFormatType = ExportFormatType.PortableDocFormat; export.ExportFormatOptions = pdfFormat; export.ExportDestinationOptions = dfOptionPDF; myReport.Export(); MessageBox.Show("List PDF Exported Successfully", "Export", MessageBoxButtons.OK, MessageBoxIcon.Information); }