Skip to Content
Former Member
Aug 29, 2008 at 10:36 AM

Problem with a page (orientation landscape) in the pdf export through JAVA



I use Crystal Report 2008 v12.0.0.683

I have created a report .rpt with differents sections in the "Section Expert":

-> I have 7 "Group headers" sections

-> I have 7 "Details" sections

In the tab "Paging" I put the orientation of the section as default (portrait) except the 5th section (Group headers and details" which has an orientation = landscape.

Now If I export "locally" in the pdf format, I have no problem:

-> The pages 1-2-3-4 and 5-7 have the orientation = portrait

-> The page 5 have the orientation = landscape.

That is exactly what I expect.

But now if I generate the same .rpt template trough the java application and I export in pdf format, all the pages (including the page #5) have the orientation portrait.

Do I need to change options in the .rpt file or in the code.

Please find below the code that I use to generate this pdf trough JAVA:

reportClientDoc = new ReportClientDocument();

String templatePath = reportTemplatePath();

if (templatePath != null) {, 0);

ParameterFieldController parameterFieldController = reportClientDoc.getDataDefController().getParameterFieldController();

DatabaseController databaseController = reportClientDoc.getDatabaseController();

//connectDatabaseControllerToISTDatabase(databaseController, messageHandler);

databaseController.logon("XXXX", "ppppp");

isReportOpen = true;

// reportClientDoc.verifyDatabase(); // check if connection is good

parameterFieldController.setCurrentValue("" , "ID", documentGenerationNumber().intValue());

ExportOptions exportOptions = new ExportOptions();

exportOptions.setExportFormatType(documentFormat()); // PDF doc format

//Export report and obtain an input stream that can be written to disk.

//See the Java Reporting Component Developer's Guide for more information on the supported export format enumerations

//possible with the JRC.

InputStream byteArrayInputStream = reportClientDoc.getPrintOutputController().export(documentFormat());

//Release report.


isReportOpen = false;

Thanks for the support,