subReport export to doc,Urgency!
I develop a report(name is oRpt) which contain a subReport,I using the following code to export the report sheet to a word page:
CrystalDecisions.Shared.ExportOptions myExportOptions ; CrystalDecisions.Shared.DiskFileDestinationOptions myDiskFileDestinationOptions
string myExportFile = "a.doc";
if ( ! System.IO.Directory.Exists( myExportFile ) ) { System.IO.Directory.CreateDirectory( myExportFile );
}
myDiskFileDestinationOptions = new CrystalDecisions.Shared.DiskFileDestinationOptions (); myDiskFileDestinationOptions.DiskFileName = myExportFile;
myExportOptions = oRpt.ExportOptions;
myExportOptions.DestinationOptions = myDiskFileDestinationOptions;
myExportOptions.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.Disk File;
myExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.WordForWi ndows;
oRpt.Export();
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application/vnd.ms-word";
Response.Redirect( "a.doc", false );
Response.Flush();
Response.Close();
The Master Report display correctly in the word page, but the sub report can not display the data from datasouce,only the txtObject in it can be seen.
And both the Master report and subreport display well in the CrystalReportViewer.
Can anybody help me about this? Expect for your reply ! Thanks first!
|