Exported word report messed up

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

Hi there,


Thanks for your inquiry.

I have tested the scenario and have not found the shared issue while using latest version of Aspose.Words for JasperReports. I would suggest you please upgrade to the latest version of Aspose.Words for JasperReports 1.9.0 from here and let us know how it goes on your side. I have attached the output Doc/Docx files with this post for your reference.

However, I have logged the issue related to table’s border. The table’s border are not correctly rendered in ouput Doc/Docx file. I have logged this issue as WORDSJSP-122 in our issue tracking system. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.