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 btnPrintCurrent_Click(object sender, EventArgs e) { RPT.rpt_single_category rpt = new RPT.rpt_single_category(); RPT.FRM_RPT_PRODUCT frm = new RPT.FRM_RPT_PRODUCT(); rpt.SetParameterValue("@id", Convert.ToInt32(txtID.Text)); frm.crystalReportViewer1.ReportSource = rpt; frm.ShowDialog(); }
private void btnrintCurrent_Click(object sender, EventArgs e) { RPT.rpt_single_category my_report_single_cat = new RPT.rpt_single_category(); RPT.FRM_RPT_PRODUCTcs mForm = new RPT.FRM_RPT_PRODUCTcs(); my_report_single_cat.Refresh(); my_report_single_cat.SetParameterValue("@ID", Convert.ToInt32(txtID.Text)); mForm.crystalReportViewer1.ReportSource = my_report_single_cat; mForm.ShowDialog(); }
private void btnPrintCat_Click(object sender, EventArgs e) { // here print the category with its product in that report we use save data to report checked and also we didn't call Refresh() // although the report is changeable but he work will because the sub report that we use in it is call Refresh() RPT.rpt_single_category rpt = new RPT.rpt_single_category(); RPT.RPT_Form frm = new RPT.RPT_Form(); rpt.SetParameterValue("@id", Convert.ToInt32(txtCatId.Text)); frm.Refresh(); frm.crystalReportViewer1.ReportSource = rpt; frm.ShowDialog(); }
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 btnPrintCurrent_Click(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; RPT.rpt_single_category rpt = new RPT.rpt_single_category(); RPT.FRM_RPT_PRODUCT frm = new RPT.FRM_RPT_PRODUCT(); rpt.SetParameterValue("@id", Convert.ToInt32(txtID.Text)); frm.crystalReportViewer1.ReportSource = rpt; frm.ShowDialog(); this.Cursor = Cursors.Default; } catch { MessageBox.Show("الرجاء تحديد القسم", "تنبية", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
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 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 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); }