Dee

Dee

  • NA
  • 3
  • 0

Unable to see the data when exporting to PDF

Dec 3 2009 11:34 AM

Hi,
 
I am having a strange issue with Crystal reports and .NET. My .NET has  a form with calls a cystal template.
 
I have a very simple code where I select a Crystal template and after iterating thru the parms and the tables, want to export the report to a .PDF file. The .PDF file gets generated but it is empty. I am able to see the data in the Crystal viewer and 'am using the same report document object for the viewer as well as for the export assuming that the data is already populated so that I can do the export with the same object.
 
The code is as below:
 
CrystalDecisions.Shared.DiskFileDestinationOptions diskOp = new CrystalDecisions.Shared.DiskFileDestinationOptions();
diskOp.DiskFileName = "c:\\test.pdf";
CrystalDecisions.Shared.ExportOptions exportOpts = _Rpt.ExportOptions;    ==> _RPT is the ReportDocument object
exportOpts.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.PortableDocFormat;
exportOpts.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile;
exportOpts.ExportDestinationOptions = diskOp;
_Rpt.Export(exportOpts);
Any idea why the data is not being populated? The file gets created on my C: drive but it is empty.
Appreciate a quick response...
Thanks,
 
 

Answers (2)