private void BTNPRINTALL_Click(object sender, EventArgs e) { RPT.FRM_REPORTS frm = new RPT.FRM_REPORTS(); RPT.RPT_ALLPRODUCT PRODUCTS = new RPT.RPT_ALLPRODUCT(); frm.crystalReportViewer1.ReportSource = PRODUCTS; frm.ShowDialog(); }
private void BTNSAVETOEXCEL_Click(object sender, EventArgs e) { RPT.RPT_ALLPRODUCT report = new RPT.RPT_ALLPRODUCT(); DiskFileDestinationOptions Destination = new DiskFileDestinationOptions(); Destination.DiskFileName = "G:\\report.xls"; ExcelFormatOptions excelformat = new ExcelFormatOptions(); ExportOptions export = new ExportOptions(); export = report.ExportOptions; export.ExportDestinationType = ExportDestinationType.DiskFile; export.ExportFormatType = ExportFormatType.Excel; export.ExportDestinationOptions = Destination; export.ExportFormatOptions = excelformat; report.Export(); MessageBox.Show("Export success"); }