如何以Excel格式或Excel工作表导出Crystal报表数据 [英] How to export crystal report data in excel format or in excel sheet

查看:112
本文介绍了如何以Excel格式或Excel工作表导出Crystal报表数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友们...

我正在使用C#.net在桌面应用程序中工作.在其中,我正在使用Crystal Report,DataSet和CrystalReportViewer.我想知道如何将Excel报表数据转换为Excel格式或新的Excel工作表.

Randeep Chauhan

Hi friends...

I am working in desktop application using C#.net.In which i am using crystal report,dataset and crystalreportviewer .i want to know how convert crystal report data in excel format or in a new excel worksheet.

Randeep Chauhan

推荐答案

可以使用

You Can Use

ReportDocument Report = new ReportDocument();
     Report.Load("PATH EX C:\\Report1.rpt");
     Report.SetDataSource(YOURDATASET);
     Report.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.Excel, "EXPORT FILE PATH EX C:\\Test.xls");


// Declare variables and get the export options.
ExportOptions exportOpts = new ExportOptions();
ExcelFormatOptions excelFormatOpts = new ExcelFormatOptions ();
DiskFileDestinationOptions diskOpts = new DiskFileDestinationOptions();
exportOpts = Report.ExportOptions;
// Set the excel format options.
excelFormatOpts.ExcelUseConstantColumnWidth = true;
exportOpts.ExportFormatType = ExportFormatType.Excel;
exportOpts.FormatOptions = excelFormatOpts;
// Set the disk file options and export.
exportOpts.ExportDestinationType = ExportDestinationType.DiskFile;
diskOpts.DiskFileName = fileName;
exportOpts.DestinationOptions = diskOpts;
Report.Export ();



参考链接:-自定义导出选项[ 链接-[如何从Crystal报表导出到excel文件示例代码] [



Reference Link:- Customizing Export Options[^]

or try to navigate This link-[how to export from crystal report to excel file example code][^] having same question with complete solution.


在这里去

C#Crystal Reports导出到Excel [在Crystal Reports .NET中导出为Excel-完美的Excel导出 [ ^ ]
从Crystal Reports导出为PDF, Word,Excel和HTML [
Here you go

C# Crystal Reports Export to Excel[^]
Exporting to Excel in Crystal Reports .NET - Perfect Excel Exports[^]
Exporting from Crystal Reports to PDF, Word, Excel and HTML[^]


这篇关于如何以Excel格式或Excel工作表导出Crystal报表数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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