Quantcast
Viewing all articles
Browse latest Browse all 3636

Export to PDF with Bookmarks doesn't work on specific RPT files

I'm using Crystal Report 2008 SP3 .NET SDK in order to export an RPT file to PDF with bookmarks using the option "CreateBookmarkFromGroupTree".

While it works for most reports, I have a group of reports that are always exported without any groups, no matter what I set in the ExportOptions.

 

To verify that there is no element in the report that might cause that behavior, I ended up removing all the elements, groups, parameters, formulas and database settings from the report which left me with a completely blank report. when I export it from Crystal Report designer (2008 SP3) using the "CreateBookmarkFromGroupTree" there is one bookmark in the Pdf with the name of the report. doing the same from Visual Studio results a blank PDF with no bookmarks at all.

 

When I do the same test on a newly created report everything works fine. I tried using a recent runtime as well but got the same results.

The only solution I can think of right now is designing the original report from scratch, which is something I would really like to avoid since it is quite a complicated report.

 

Here is an example of the code used to export the report:

 

reportDocument.Load("TestReport.rpt");

ExportOptions exportOptions = newExportOptions();

exportOptions.ExportDestinationType = ExportDestinationType.DiskFile;

exportOptions.ExportDestinationOptions = newDiskFileDestinationOptions()

{

     DiskFileName = "Output.pdf"

};

exportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;

exportOptions.ExportFormatOptions = newPdfFormatOptions()

{

     CreateBookmarksFromGroupTree = true

};

reportDocument.Export(exportOptions);

 

There is no way for me to attach the problematic RPT file using the discussion interface, please guide me if there is any other way.

 

Thanks


Viewing all articles
Browse latest Browse all 3636

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>