Hi.
I’m using Aspose.Word 1.6.0.
I am creating a multi page document built up from a number of JasperPrint objects. A PDF export works fine, but the Aspose.Word version is all messed up.
EDIT: Additionaly, my first title page is completely missing.
I have looked at Overlapping Items|Aspose.Words for JasperReports, but I don’t have any overlapping items that I can see.
I am using multiple JasperPrint objects since I require the ability to use both Portrait and Landscape layouts. I have tried playing around with the various configuration options of Aspose.Word without much success.
The current settings I am using are:
public static void exportReportsToWordStream(
final List prints, final FileOutputStream stream)
throws JRException {
JRExporter exporter = JasperExporterFactory
.getInstance(ReportFormat.WORD);
exporter.setParameter(AWExporterParameter.OVERLAP_RESOLUTION_METHOD,
AWExporterParameter.OVERLAP_RESOLUTION_METHOD_PUSH_ITEMS);
exporter.setParameter(AWExporterParameter.USE_EXACT_SPACINGS, true);
exporter.setParameter(AWExporterParameter.EXPORT_RECTANGLES_AS_FRAMES,
true);
exporter.setParameter(AWExporterParameter.SPACING_FACTOR, 0.0);
exportReportsToStream(prints, stream, exporter);
}
private static void exportReportsToStream(final List prints,
final OutputStream stream, final JRExporter exporter)
throws JRException {
try {
exporter.setParameter(JRPdfExporterParameter.JASPER_PRINT_LIST,
prints);
exporter.setParameter(JRPdfExporterParameter.OUTPUT_STREAM, stream);
exporter.exportReport();
} finally {
try {
stream.close();
} catch (Exception e) {
// ignore
}
}
}
The docs mention the use of Flow Layouts by default. How can I switch it to export in absolute layouts instead? What else can I try?
Thanks