Skip to Content
0
Former Member
Jun 01, 2010 at 08:27 PM

Need help setting export options

22 Views

I'm working on replacing our old RDC component with the new Java SDK.

I purchased Crystal Reports 2008 and downloaded the SDK. Now I'm trying to run a simple example exporting a report to word. I've built it off of the other export examples I've seen on the site. None of them seem to give me an up to date example of how to set export options though.

Exporting seems to work when I export using this:

ByteArrayInputStream byteArrayInputStream = (ByteArrayInputStream) report.getPrintOutputController().export(ReportExportFormat.MSWord);

But not when I do this:

ExportOptions opt = new ExportOptions();

opt.setExportFormatType(ReportExportFormat.MSWord);

RTFWordExportFormatOptions myOptions = new RTFWordExportFormatOptions();

opt.setFormatOptions(myOptions);

ByteArrayInputStream byteArrayInputStream = (ByteArrayInputStream) report.getPrintOutputController().export(opt);

Is there something I'm missing? I want to be able to explicitly set my export options - especially for other export formats like excel.