private void button6_Click(object sender, EventArgs e) { All_Prodect_Report report = new All_Prodect_Report(); View_Report_Form prf = new View_Report_Form(); report.Refresh(); prf.crystalReportViewer1.ReportSource = report; prf.ShowDialog(); }
private void button7_Click(object sender, EventArgs e) { All_Prodect_Report report = new All_Prodect_Report(); ExportOptions export = new ExportOptions(); DiskFileDestinationOptions dfoption = new DiskFileDestinationOptions(); ExcelFormatOptions xlsformat = new ExcelFormatOptions(); SaveFileDialog save = new SaveFileDialog(); save.Filter = "ملف اكسيل | *.xls"; save.InitialDirectory = @"C:\"; if (save.ShowDialog() == DialogResult.OK) { dfoption.DiskFileName = save.FileName; export = report.ExportOptions; export.ExportDestinationType = ExportDestinationType.DiskFile; export.ExportFormatType = ExportFormatType.Excel; export.ExportFormatOptions = xlsformat; export.ExportDestinationOptions = dfoption; report.Refresh(); report.Export(); MessageBox.Show("تمت العملية بنجاح", "معلومة", MessageBoxButtons.OK, MessageBoxIcon.Information); } }