private void metroButton7_Click(object sender, EventArgs e) { RPT.rpt_all_products myReport = new RPT.rpt_all_products(); // Create Export options ExportOptions export = new ExportOptions(); // Create object for destination DiskFileDestinationOptions dfoptions = new DiskFileDestinationOptions(); ExcelFormatOptions excelformat = new ExcelFormatOptions(); // Set the path of destination dfoptions.DiskFileName = @"D:\scienses\life with c#\projects\Products Managemnt\Reports\ProductsList.xls"; export = myReport.ExportOptions; export.ExportDestinationType = ExportDestinationType.DiskFile; export.ExportFormatType = ExportFormatType.Excel; export.ExportFormatOptions = excelformat; export.ExportDestinationOptions = dfoptions; myReport.Refresh(); myReport.Export(); MessageBox.Show("List Eported Successfully ", "Export", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void button7_Click(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; RPT.rpt_all_products myReport = new RPT.rpt_all_products(); //Create Export Options خاص باعداد التقرير ExportOptions export = new ExportOptions(); //Create Object For destination خاص بمكان حفظ التقرير DiskFileDestinationOptions dfoptions = new DiskFileDestinationOptions(); ExcelFormatOptions excelformat = new ExcelFormatOptions(); // تحديد مسار التخزين dfoptions.DiskFileName = @"E:\ProductsList.xls"; export = myReport.ExportOptions; export.ExportDestinationType = ExportDestinationType.DiskFile; export.ExportFormatType = ExportFormatType.Excel; export.ExportFormatOptions = excelformat; export.ExportDestinationOptions = dfoptions; myReport.Export(); this.Cursor = Cursors.Default; MessageBox.Show("E: ProductsList : تم حفظ الملف بنجاح ", "Export", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void metroButton6_Click(object sender, EventArgs e) { RPT.rpt_all_products myReport = new RPT.rpt_all_products(); RPT.FRM_RPT_PRODUCT myForm = new RPT.FRM_RPT_PRODUCT(); myForm.crystalReportViewer1.ReportSource = myReport; myForm.ShowDialog(); }
private void btnSave_Click(object sender, EventArgs e) { RPT.rpt_all_products rpt = new RPT.rpt_all_products(); ExportOptions export = new ExportOptions(); export = rpt.ExportOptions; ExcelFormatOptions excelformat = new ExcelFormatOptions(); export.ExportFormatOptions = excelformat; export.ExportFormatType = ExportFormatType.Excel; DiskFileDestinationOptions dfoptions = new DiskFileDestinationOptions(); string ExcelReportsPath = Application.StartupPath.Substring(0, (Application.StartupPath.Length - 10)) + @"\ExcelReports\"; dfoptions.DiskFileName = ExcelReportsPath + "\\ProductsList-" + DateTime.Now.ToString("dddd, dd MMMM yyyy") + ".xls"; export.ExportDestinationOptions = dfoptions; export.ExportDestinationType = ExportDestinationType.DiskFile; rpt.Export(); MessageBox.Show("Products List Exported Successfully", "Export", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void button6_Click(object sender, EventArgs e) { RPT.rpt_all_products my_report_all = new RPT.rpt_all_products(); RPT.FRM_RPT_PRODUCTcs mForm = new RPT.FRM_RPT_PRODUCTcs(); my_report_all.Refresh(); mForm.crystalReportViewer1.ReportSource = my_report_all; mForm.ShowDialog(); }
private void btnPrintAllPro_Click(object sender, EventArgs e) { RPT.rpt_all_products rpt = new RPT.rpt_all_products(); RPT.RPT_Form frm = new RPT.RPT_Form(); rpt.Refresh(); frm.crystalReportViewer1.ReportSource = rpt; frm.ShowDialog(); }
private void button6_Click(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; RPT.rpt_all_products myReport = new RPT.rpt_all_products(); RPT.FRM_RPT_PRODUCT myForm = new RPT.FRM_RPT_PRODUCT(); myForm.crystalReportViewer1.ReportSource = myReport; myForm.ShowDialog(); this.Cursor = Cursors.Default; }
private void button7_Click(object sender, EventArgs e) { RPT.rpt_all_products myReport = new RPT.rpt_all_products(); ExcelFormatOptions excelformat = new ExcelFormatOptions(); //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\Products.xls"; export = myReport.ExportOptions; export.ExportDestinationType = ExportDestinationType.DiskFile; export.ExportFormatType = ExportFormatType.Excel; export.ExportFormatOptions = excelformat; export.ExportDestinationOptions = dfoptions; myReport.Export(); MessageBox.Show("!تم حفظ اللائحة بنجاح", "تم", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void button7_Click(object sender, EventArgs e) { button7.Enabled = false; RPT.rpt_all_products myrep_to_excel = new RPT.rpt_all_products(); //Create export options ExportOptions export = new ExportOptions(); //Create object to save destination DiskFileDestinationOptions dfOptions = new DiskFileDestinationOptions(); ExcelFormatOptions eFormat = new ExcelFormatOptions(); // set destination name dfOptions.DiskFileName = @"T:\FCAI\My Projects\DB\ProductsList.xls"; export = myrep_to_excel.ExportOptions; export.ExportDestinationType = ExportDestinationType.DiskFile; export.ExportFormatType = ExportFormatType.Excel; export.ExportFormatOptions = eFormat; export.ExportDestinationOptions = dfOptions; myrep_to_excel.Export(); MessageBox.Show("تم تصدير جميع المنتجات الى ملف اكسيل.", "تنبيه", MessageBoxButtons.OK, MessageBoxIcon.Information); button7.Enabled = true; }
private void button8_Click(object sender, EventArgs e) { RPT.rpt_all_products myReport = new RPT.rpt_all_products(); //Create Export Options ExportOptions export = new ExportOptions(); //Create Object For destination DiskFileDestinationOptions dfoptions = new DiskFileDestinationOptions(); //Create Object For Excel Format ExcelFormatOptions excelformat = new ExcelFormatOptions(); //Set the path of destination dfoptions.DiskFileName = @"E:\ProductsList.xls"; //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.Excel; //format the excel document export.ExportFormatOptions = excelformat; //Set Destination option export.ExportDestinationOptions = dfoptions; //Export the report myReport.Export(); MessageBox.Show("List Exported Successfully !", "Export", MessageBoxButtons.OK, MessageBoxIcon.Information); }