nsimonnet Posted May 21, 2015 Share Posted May 21, 2015 Hello, Jasper community,I've been working with Jasper Studio for a few weeks now and built a some reports (some include subreports) that look very nice and work perfectly in preview mode.Now I'd like to deploy them on JasperServer and this is where I'm facing my problem.I managed to reproduce it with a simple report and a subreport included twice.In this example report the idea is simple: I have:- a subreport that takes one parameter- a main report that includes two instances of this subreport, and passes them two different values as parameter.The result:- When I include only one instance of the subreport, it works perfectly- When I include it twice (the parameter value does not matter), the execution on jasperserver crashes with the following error :Error filling reportnet.sf.jasperreports.engine.JRException: Resource not found at : tests/srvtest/footersub.jasperI deploy the report ant its subreport with the "publish" button in Jasper Studio.I don't think it's a subreport path issue because with only one instance of it, it's ok. It's only when I put 2 or more instances of the subreport in the main report that the server crashes...It doesn't change the behaviour if I hardcode the parameter value or if I transmit it from the main report's parameters.Do you have an idea?I'm running on Windows 7, with Jasper server v.6.0.1 and JasperStudio 6.0.4Many thanks for your help,NicoHere are the source files of the subreport and the report. Both are stand-alone, they can be run without a data source. <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.0.4.final using JasperReports Library version 6.0.4 --><!-- 2015-05-21T16:17:07 --><jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="footersub" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="094a5941-d53b-4f31-a776-a68a3800223c"> <parameter name="nom" class="java.lang.String" isForPrompting="false"> <defaultValueExpression><![CDATA["Mon nom"]]></defaultValueExpression> </parameter> <queryString> <![CDATA[]]> </queryString> <background> <band splitType="Stretch"/> </background> <summary> <band height="21"> <textField> <reportElement x="150" y="1" width="235" height="20" uuid="b73f03fe-439f-4d1f-b301-8d0f9fa7a799"/> <textElement textAlignment="Center" verticalAlignment="Middle"/> <textFieldExpression><![CDATA["Footer " + $P{nom}]]></textFieldExpression> </textField> </band> </summary></jasperReport>[/code]<?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.0.4.final using JasperReports Library version 6.0.4 --><!-- 2015-05-21T16:21:32 --><jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="rpt" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="ef29a4c5-cefe-4c49-8626-ec7341c9cbab"> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="agora_oracle"/> <property name="ireport.jasperserver.url" value="http://localhost:8585/jasperserver/"/> <property name="ireport.jasperserver.user" value="joeuser|jasperadmin"/> <property name="ireport.jasperserver.report.resource" value="/reports/Tests/rpt_files/main_jrxml"/> <property name="ireport.jasperserver.reportUnit" value="/reports/Tests/rpt"/> <parameter name="sub1" class="java.lang.String"> <defaultValueExpression><![CDATA["sub 1"]]></defaultValueExpression> </parameter> <parameter name="sub2" class="java.lang.String"> <defaultValueExpression><![CDATA["sub 2"]]></defaultValueExpression> </parameter> <queryString> <![CDATA[select * from mgusers]]> </queryString> <background> <band splitType="Stretch"/> </background> <title> <band height="30" splitType="Stretch"> <staticText> <reportElement x="156" y="0" width="243" height="30" uuid="86f84720-da73-442d-84d3-2c04ea97483a"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="18"/> </textElement> <text><![CDATA[Rapport de test]]></text> </staticText> </band> </title> <pageHeader> <band height="35" splitType="Stretch"/> </pageHeader> <pageFooter> <band height="180" splitType="Stretch"> <subreport runToBottom="true"> <reportElement x="0" y="12" width="555" height="28" uuid="890bcdb4-97e8-465a-bee5-a9ef52bc136b"/> <subreportParameter name="nom"> <subreportParameterExpression><![CDATA[$P{sub1}]]></subreportParameterExpression> </subreportParameter> <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> <subreportExpression><![CDATA["tests/srvtest/footersub.jasper"]]></subreportExpression> </subreport> <subreport runToBottom="true"> <reportElement x="1" y="43" width="555" height="28" uuid="2fdad4ca-5e84-4533-b808-0b95d10aae68"/> <subreportParameter name="nom"> <subreportParameterExpression><![CDATA[$P{sub2}]]></subreportParameterExpression> </subreportParameter> <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> <subreportExpression><![CDATA["tests/srvtest/footersub.jasper"]]></subreportExpression> </subreport> </band> </pageFooter></jasperReport>[/code] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now