Mar Porteza

Mar Porteza

  • NA
  • 4
  • 0

How to Export Crystal Reports in Excel in proper format.....

Aug 9 2007 6:57 PM

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!!!!


Answers (2)

0
Deepak Bhatia

Deepak Bhatia

  • 0
  • 369
  • 15.7k
Sep 18 2009 8:04 AM
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.
0
savio

savio

  • 0
  • 33
  • 0
Jun 10 2009 7:13 AM

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.