Employers - Post Free Jobs
Forum guidelines
  • Home
  • »
  • Reporting
  • »
  • How to Export Crystal Reports in Excel in proper format.....
AuthorQuestion
How to Export Crystal Reports in Excel in proper format.....
Posted on: 09 Aug 2007

I am using Visual Studio 2005 and Crystal Reports XI. I tried to export my report to Excel in Crystal Reports XI, File - Export - Export Report and I can see my reports in Excel (Data Only) the way I want to see them. My problem is when I call my report from my Web Application using VS 2005 and SQL 2005 database, and export my report to excel using the report viewer, it looks different....Is there any way I can use the Excel set up in Crystal Reports...meaning same look what I saw when I tried to export in Crystal reports???...or is there any functions that I forgot to enable??..if this should be done in a code, can you show me or send me a code????..Please.. need your help! Thank you much!!!!


RAM - 323

 

AuthorReply
Re: How to Export Crystal Reports in Excel in proper format.....
Posted on: 10 Jun 2009  

ExcelFormatOptions CrFormatTypeOptions = new ExcelFormatOptions();
CrDiskFileDestinationOptions.DiskFileName = "filename.xls";
CrExportOptions = cryRpt.ExportOptions;
CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
CrExportOptions.ExportFormatType = ExportFormatType.Excel;
CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions;
CrExportOptions.FormatOptions = CrFormatTypeOptions;
cryRpt.Export();
http://csharp.net-informations.com/crystal-reports/csharp-crystal-reports-export-excel.htm
hope it will help u.
 
tks,
savi.

 

Re: How to Export Crystal Reports in Excel in proper format.....
Posted on: 18 Sep 2009  
The same kind of problem was noticed by me, i.e. while exporting the header field value were not shown in the excel file. Solution: Open your crystal report in Visual Studio and make sure all the columns which are being shown are having same height i.e. the boxes which are shown in header as well as the text boxes of details section should have same height. Reason why this happens In Crystal Reports .NET, the Excel export attempts to perform a WYSIWYG translation of the report. This can sometimes lead to some interesting results in Excel, since a Crystal Report places objects using x/y coordinates, but Excel uses line-by-line row/column placements.

Please do not forget to mark answer as accepted if it helped you.

Deepak Bhatia

SPONSORED BY

Offshore Software and Database Development
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.