CMDBuild Forum

Upload report fails

Hello,

I have created a report in Jaspersoft Studio 6.3.0 (compatibility mode 3.7.2) with 2 images and 3 subreports.  i used the green_leaf template for the main report, and blanco_A4 for the subreports.  All works fine and report is shown in Jaspersoft.

When i try to upload the report to CMDBuild (2.4.0 and 2.4.1) i get following error:

Call: services/json/schema/modreport/importjasperreport
--------------------------------------------------------
Error: org.cmdbuild.exception.ReportException: REPORT_UPLOAD_ERROR Expected jasper report 'SubreportOverviewHostingServers.jasper' not found in uploaded data
	at org.cmdbuild.exception.ReportException$ReportExceptionType.createException(ReportException.java:13)
	at org.cmdbuild.servlets.json.schema.ModReport.importSubreportsAndImages(ModReport.java:632)
	at org.cmdbuild.servlets.json.schema.ModReport.importJasperReport(ModReport.java:551)
When i looked at the server, i see that second image is not uploaded. 
All subreports are uploaded?
-rw-r--r-- 1 root root 505442 Oct 28 12:36 upload_029ce2ce_88fc_4009_85d7_e8cc01f9ed7b_00000007.tmp
-rw-r--r-- 1 root root  26610 Oct 28 12:36 upload_029ce2ce_88fc_4009_85d7_e8cc01f9ed7b_00000009.tmp
-rw-r--r-- 1 root root  25842 Oct 28 12:36 upload_029ce2ce_88fc_4009_85d7_e8cc01f9ed7b_00000010.tmp
-rw-r--r-- 1 root root  26683 Oct 28 12:36 upload_029ce2ce_88fc_4009_85d7_e8cc01f9ed7b_00000011.tmp
d-cmdsrv:/usr/share/apache-tomcat-8.0.33/temp #
The second image should probabely be file "upload....0000008.tmp".
The first image is indeed 505.442 bytes in size, the second image is only
9.849 bytes in size.
Files xxx9.tmp upto xxx11.tmp are the 3 subreports.

Are you using independent subreport sor one inside the other?
The second case is not managed by CMDBuild otherwise it must work.
CMDBuild Team

Previously Tecnoteca wrote:

Are you using independent subreport sor one inside the other?
The second case is not managed by CMDBuild otherwise it must work.
CMDBuild Team

 

I created the subreports also with Jaspersoft studio, the main report contains these 3 subreports. Below is part of the mainreport:
<detail>
<band height="165" splitType="Stretch">
<staticText>
<reportElement x="0" y="4" width="100" height="15" forecolor="#364AB3">
<property name="com.jaspersoft.studio.unit.x" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
</reportElement>
<textElement lineSpacing="Single">
<font fontName="Arial" size="12" isBold="true"/>
</textElement>
<text><![CDATA[Hosting Servers]]></text>
</staticText>
<subreport>
<reportElement x="0" y="21" width="555" height="30">
<property name="com.jaspersoft.studio.unit.x" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
</reportElement>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression class="java.lang.String"><![CDATA["Subreport Overview Hosting Servers.jasper"]]></subreportExpression>
</subreport>
<staticText>
<reportElement positionType="Float" x="0" y="61" width="100" height="15" forecolor="#364AB3">
<property name="com.jaspersoft.studio.unit.x" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
</reportElement>
<textElement lineSpacing="Single">
<font fontName="Arial" size="12" isBold="true"/>
</textElement>
<text><![CDATA[Standard Servers]]></text>
</staticText>
<subreport>
<reportElement positionType="Float" x="0" y="78" width="555" height="30">
<property name="com.jaspersoft.studio.unit.x" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="pixel"/>
</reportElement>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression class="java.lang.String"><![CDATA["Subreport Overview Standard Servers.jasper"]]></subreportExpression>
</subreport>
<staticText>
<reportElement positionType="Float" x="0" y="118" width="100" height="15" forecolor="#364AB3">
<property name="com.jaspersoft.studio.unit.x" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
</reportElement>
<textElement lineSpacing="Single">
<font fontName="Arial" size="12" isBold="true"/>
</textElement>
<text><![CDATA[Virtual Servers]]></text>
</staticText>
<subreport>
<reportElement key="" positionType="Float" x="0" y="135" width="555" height="30" isRemoveLineWhenBlank="true" isPrintInFirstWholeBand="true" isPrintWhenDetailOverflows="true">
<property name="com.jaspersoft.studio.unit.x" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
</reportElement>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression class="java.lang.String"><![CDATA["Subreport Overview Virtual Servers.jasper"]]></subreportExpression>
</subreport>
</band>
</detail>
 
However, the problem isn't the working of the report, but the failing upload.  I have created more reports in the past with one or more subreports without any problem uploading and running them.

Previously Eric wrote:

Previously Tecnoteca wrote:
Are you using independent subreport sor one inside the other?
The second case is not managed by CMDBuild otherwise it must work.
CMDBuild Team

 

I created the subreports also with Jaspersoft studio, the main report contains these 3 subreports. Below is part of the mainreport:
<detail>
<band height="165" splitType="Stretch">
<staticText>
<reportElement x="0" y="4" width="100" height="15" forecolor="#364AB3">
<property name="com.jaspersoft.studio.unit.x" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
</reportElement>
<textElement lineSpacing="Single">
<font fontName="Arial" size="12" isBold="true"/>
</textElement>
<text><![CDATA[Hosting Servers]]></text>
</staticText>
<subreport>
<reportElement x="0" y="21" width="555" height="30">
<property name="com.jaspersoft.studio.unit.x" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
</reportElement>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression class="java.lang.String"><![CDATA["Subreport Overview Hosting Servers.jasper"]]></subreportExpression>
</subreport>
<staticText>
<reportElement positionType="Float" x="0" y="61" width="100" height="15" forecolor="#364AB3">
<property name="com.jaspersoft.studio.unit.x" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
</reportElement>
<textElement lineSpacing="Single">
<font fontName="Arial" size="12" isBold="true"/>
</textElement>
<text><![CDATA[Standard Servers]]></text>
</staticText>
<subreport>
<reportElement positionType="Float" x="0" y="78" width="555" height="30">
<property name="com.jaspersoft.studio.unit.x" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="pixel"/>
</reportElement>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression class="java.lang.String"><![CDATA["Subreport Overview Standard Servers.jasper"]]></subreportExpression>
</subreport>
<staticText>
<reportElement positionType="Float" x="0" y="118" width="100" height="15" forecolor="#364AB3">
<property name="com.jaspersoft.studio.unit.x" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
</reportElement>
<textElement lineSpacing="Single">
<font fontName="Arial" size="12" isBold="true"/>
</textElement>
<text><![CDATA[Virtual Servers]]></text>
</staticText>
<subreport>
<reportElement key="" positionType="Float" x="0" y="135" width="555" height="30" isRemoveLineWhenBlank="true" isPrintInFirstWholeBand="true" isPrintWhenDetailOverflows="true">
<property name="com.jaspersoft.studio.unit.x" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
</reportElement>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression class="java.lang.String"><![CDATA["Subreport Overview Virtual Servers.jasper"]]></subreportExpression>
</subreport>
</band>
</detail>
 
However, the problem isn't the working of the report, but the failing upload.  I have created more reports in the past with one or more subreports without any problem uploading and running them.

 

Problem is solved
I solved the problem by replacing the " " in the name of the subreports by "_".  It looks like CMDBuild is stripping the spaces from the subreport name although the names are between double quote's.  This wasn't the case in previous versions.
 
Eric