Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
|
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 16th, 2005, 06:17 AM
Authorized User
 
Join Date: Nov 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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!


 
Old March 17th, 2005, 01:46 AM
Authorized User
 
Join Date: Nov 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have find out the reason :)
The field object in report must have enough space, then it will display correctly in pdf,doc as well as in the CrystalReportViewer.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Working on Doc Array inside another Doc Array? chriscym XSLT 5 April 4th, 2007 05:56 AM
Copy text from 1 doc to other doc thru vba in word itchock Word VBA 2 December 29th, 2006 02:47 AM
subreport srnarla Crystal Reports 1 August 31st, 2006 10:48 AM
subreport bib Visual Basic 2005 Basics 0 August 25th, 2006 12:56 AM
A subreport cannot contain a subreport. dkells Crystal Reports 0 March 3rd, 2005 06:05 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.