将Crystal Report数据导出到Excel文件中,还需要“打印”按钮 [英] Export Crystal Report data into Excel file and also need Print button

查看:84
本文介绍了将Crystal Report数据导出到Excel文件中,还需要“打印”按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以提出我的建议



i希望在Crystal Reports中做两件事

1.导出到Excel

2.打印

can any one give my suggestion

i want to do two things in Crystal Reports
1. Export to Excel
2. Print

推荐答案

试用excel文件



Try this for excel file

private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                ExportOptions CrExportOptions ;
                  
                DiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions();
                ExcelFormatOptions CrFormatTypeOptions = new ExcelFormatOptions();
                CrDiskFileDestinationOptions.DiskFileName = "c:\\myfile.xls";
                CrExportOptions = cryRpt.ExportOptions;
                CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
                CrExportOptions.ExportFormatType = ExportFormatType.Excel;
                CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions;
                CrExportOptions.FormatOptions = CrFormatTypeOptions;
                cryRpt.Export();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }





您可以在



You can chance tye at

ExportFormatType.Excel;

到PDF(由你决定)


这篇关于将Crystal Report数据导出到Excel文件中,还需要“打印”按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆