Issue
- Cannot generate reports on Liferay 6.2 and Amazon S3
- Hitting multipart upload error when creating CSV file
Scenario - With an S3 bucket configured for use and a data-definition in place, we find that when attempting to generate a report (.csv format), it is possible to encounter the following error:
multipart upload failed
Environment
- Liferay Portal 6.2
Resolution
This is known behavior with the S3 API when uploading an empty file (0 bytes). See: https://github.com/aws/aws-sdk-php/issues/1649
1. This workaround involves a tweak to our configuration of Jasper Reports. It is better to have empty sections or no-data sections, over having an empty file generated.
For a report template, set attribute "When No Data Type" instead to "No Data Section" or "All Sections No Detail"
Screenshot uses Jaspersoft Studio 6.9.0
2. To your data-definition file add the corresponding component into the <jasperReport> tag:
whenNoDataType="AllSectionsNoDetail"or
whenNoDataType="NoDataSection"
*Further attributes can be added to the <noData></noData> tags. For example:
<noData>
<band height="10">
<staticText>
<reportElement x="" y="" width="" height="" uuid=""/>
<box>
<bottomPen lineWidth="" lineColor=""/>
</box>
<text><![CDATA[message here]]></text>
</staticText>
</band>
</noData>
Additional Information