コード例 #1
0
 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();
 }
コード例 #2
0
        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");
        }