I have a subreport that I use in the header over multiple reports. It works fine, except, if I make a change to this subreport (the appearance not the data), compile and publish it, it does not update on any of the reports on the server. It works fine in Studio 6.4.3, the changes show up almost immediately, but they do not on the server. The only way I'm able to get them to appear on the server is to republish each report it belongs to and overwrite the resource. This kind of takes away from the point of using a subreport. I could make those changes on individual reports then. It's not just this subreport either, it's all of them I use throughout the reports.
I'm currently using the expression "repo:Project Packet Sheet Header.jrxml" I've tried pointing to the .jasper and using a subdir parameter like $P{BASE_DIR} + "Project Packet Sheet Header.jasper". There is no difference. I also don't understand why jaspersoft insists on copying every resource into a sub directory for every report in the repository. This is what I'm thinking is the root cause as these don't seem to be updating properly. I've tried doing a refresh on the files in the Repository Explorer in Studio too and that doesn't seem to do anything. Why does it not just point to the place where the original resides in the repository instead of copying the file?
I've searched and read about everything I could find on subreports and all imply this is the correct method and should work. But maybe there's still something wrong in my execution?
Page header call to subreport:
<pageHeader> <band height="122"> <property name="com.jaspersoft.studio.unit.height" value="inch" /> <frame> <reportElement key="" x="22" y="0" width="549" height="121" uuid="0365d8c0-8d9a-4e2b-b7af-be2a1270fc47" /> <staticText> <reportElement style="SimpleField" x="218" y="1" width="295" height="20" uuid="7fe79de1-f522-4b4f-9fd4-738dc91b311a"> <property name="com.jaspersoft.studio.unit.height" value="px" /> </reportElement> <box> <topPen lineWidth="0.0" /> <leftPen lineWidth="0.0" /> <bottomPen lineWidth="0.0" /> <rightPen lineWidth="0.0" /> </box> <textElement textAlignment="Right" verticalAlignment="Middle"> <font size="16" isBold="true" /> </textElement> <text><![CDATA[ENTIRE ORDER]]></text> </staticText> <subreport> <reportElement x="0" y="8" width="549" height="88" uuid="185cba3a-0013-489c-a6ce-8d148579ab8a" /> <subreportParameter name="Order_ID"> <subreportParameterExpression><![CDATA[$P{Order_ID}]]></subreportParameterExpression> </subreportParameter> <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> <subreportExpression><![CDATA["repo:Project Packet Sheet Header.jrxml"]]></subreportExpression> </subreport> </frame> </band> </pageHeader>
Subreport:
<?xml version="1.0" encoding="UTF-8"?> <!-- Created with Jaspersoft Studio version 6.4.3.final using JasperReports Library version 6.4.3 --> <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="ProjectPacketSheetHeader" pageWidth="550" pageHeight="752" columnWidth="550" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="793253aa-7bb3-42ed-8b7a-0bf8a8625b29"> <property name="ireport.jasperserver.url" value="http://cpreport:8080/jasperserver/"/> <property name="ireport.jasperserver.user" value="jasperadmin"/> <property name="ireport.jasperserver.reportUnit" value="/reports/Project_Packet_Sheet_Header"/> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="Order Log"/> <property name="com.jaspersoft.studio.data.sql.tables" value=""/> <property name="com.jaspersoft.studio.data.sql.SQLQueryDesigner.sash.w1" value="0"/> <property name="com.jaspersoft.studio.data.sql.SQLQueryDesigner.sash.w2" value="1000"/> <property name="com.jaspersoft.studio.unit." value="pixel"/> <property name="com.jaspersoft.studio.unit.pageHeight" value="inch"/> <property name="com.jaspersoft.studio.unit.pageWidth" value="inch"/> <property name="com.jaspersoft.studio.unit.topMargin" value="inch"/> <property name="com.jaspersoft.studio.unit.bottomMargin" value="inch"/> <property name="com.jaspersoft.studio.unit.leftMargin" value="inch"/> <property name="com.jaspersoft.studio.unit.rightMargin" value="inch"/> <property name="net.sf.jasperreports.print.create.bookmarks" value="true"/> <property name="com.jaspersoft.studio.report.description" value=""/> <property name="ireport.jasperserver.report.resource" value="/reports/Project_Packet_Sheet_Header_files/main_jrxml"/> <property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/> <property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/> <template><![CDATA["repo:ProjectPacket.jrtx"]]></template> <subDataset name="Customer Orders" uuid="2f22f3a6-9ebc-4bff-8fa0-16d586a8b88c"> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="Order Log"/> <property name="com.jaspersoft.studio.data.sql.tables" value=""/> <parameter name="Order_ID" class="java.lang.String"/> <queryString> <![CDATA[SELECT order_id,level FROM customer_orders where order_id = $P{Order_ID}]]> </queryString> <field name="order_id" class="java.lang.String"> <property name="com.jaspersoft.studio.field.label" value="order_id"/> <property name="com.jaspersoft.studio.field.tree.path" value="customer_orders"/> </field> <field name="level" class="java.lang.Integer"> <property name="com.jaspersoft.studio.field.label" value="level"/> <property name="com.jaspersoft.studio.field.tree.path" value="customer_orders"/> </field> </subDataset> <parameter name="Order_ID" class="java.lang.String"/> <queryString> <![CDATA[SELECT order_id, max( case when field_setup_id = 1634 then order_log_field_values else null end) as 'Job Info - PO Number', max( case when field_setup_id = 450 then order_log_field_values else null end) as 'Job Info - Quote Number', max( case when field_setup_id = 451 then order_log_field_values else null end) as 'Job Info - Sales Person', max( case when field_setup_id = 452 then order_log_field_values else null end) as 'Job Info - Sales Order Number', max( case when field_setup_id = 453 then order_log_field_values else null end) as 'Job Info - Serial Number', max( case when field_setup_id = 1799 then order_log_field_values else null end) as 'Job Info - Order Date', max( case when field_setup_id = 458 then order_log_field_values else null end) as 'Job Info - Duplicate/Similar' FROM order_log_field_setup where order_id = $P{Order_ID}]]> </queryString> <field name="order_id" class="java.lang.String"> <property name="com.jaspersoft.studio.field.label" value="order_id"/> <property name="com.jaspersoft.studio.field.tree.path" value="order_log_field_setup"/> </field> <field name="Job Info - PO Number" class="java.lang.String"> <property name="com.jaspersoft.studio.field.label" value="Job Info - PO Number"/> </field> <field name="Job Info - Quote Number" class="java.lang.String"> <property name="com.jaspersoft.studio.field.label" value="Job Info - Quote Number"/> </field> <field name="Job Info - Sales Person" class="java.lang.String"> <property name="com.jaspersoft.studio.field.label" value="Job Info - Sales Person"/> </field> <field name="Job Info - Sales Order Number" class="java.lang.String"> <property name="com.jaspersoft.studio.field.label" value="Job Info - Sales Order Number"/> </field> <field name="Job Info - Serial Number" class="java.lang.String"> <property name="com.jaspersoft.studio.field.label" value="Job Info - Serial Number"/> </field> <field name="Job Info - Order Date" class="java.lang.String"> <property name="com.jaspersoft.studio.field.label" value="Job Info - Order Date"/> </field> <field name="Job Info - Duplicate/Similar" class="java.lang.String"> <property name="com.jaspersoft.studio.field.label" value="Job Info - Duplicate/Similar"/> </field> <group name="Group1"> <groupExpression><![CDATA[$F{order_id}]]></groupExpression> </group> <summary> <band height="90"> <componentElement> <reportElement x="51" y="53" width="18" height="18" uuid="07df2046-ce9e-4afd-adde-ad7bcb66e57e"/> <jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical"> <datasetRun subDataset="Customer Orders" uuid="2b4342a1-2caf-4210-9a2b-62326e97e256"> <datasetParameter name="Order_ID"> <datasetParameterExpression><![CDATA[$P{Order_ID}]]></datasetParameterExpression> </datasetParameter> <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> </datasetRun> <jr:listContents height="18" width="18"> <textField> <reportElement style="SimpleField" x="0" y="0" width="18" height="18" uuid="d7a1698b-8034-4fc2-96de-59724139eb13"/> <box> <topPen lineWidth="0.0"/> <leftPen lineWidth="0.0"/> <bottomPen lineWidth="0.0"/> <rightPen lineWidth="0.0"/> </box> <textElement textAlignment="Left"> <font size="12" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$F{level}]]></textFieldExpression> </textField> </jr:listContents> </jr:list> </componentElement> <staticText> <reportElement style="SimpleField" x="14" y="53" width="39" height="18" uuid="a9809d8e-2670-4d47-9c84-abb5ceb2b848"> <property name="com.jaspersoft.studio.unit.width" value="inch"/> </reportElement> <box> <topPen lineWidth="0.0"/> <leftPen lineWidth="0.0"/> <bottomPen lineWidth="0.0"/> <rightPen lineWidth="0.0"/> </box> <textElement textAlignment="Left"> <font size="12" isBold="true"/> </textElement> <text><![CDATA[LEVEL]]></text> </staticText> <image bookmarkLevel="1"> <reportElement x="14" y="0" width="504" height="52" uuid="7e2c0e5d-f88e-48db-8fef-bdca264aeb64"> <property name="com.jaspersoft.studio.unit.width" value="inch"/> <property name="com.jaspersoft.studio.unit.height" value="inch"/> <property name="com.jaspersoft.studio.unit.y" value="inch"/> <property name="com.jaspersoft.studio.unit.x" value="inch"/> </reportElement> <imageExpression><![CDATA["repo:/images/CP_Logo_Header_Plain"]]></imageExpression> <anchorNameExpression><![CDATA["Order Sheet"]]></anchorNameExpression> </image> <textField evaluationTime="Master"> <reportElement style="SimpleField" x="444" y="32" width="69" height="15" uuid="3314d7b9-1f0d-4bfc-b42b-da435538fc16"> <property name="com.jaspersoft.studio.unit.width" value="px"/> </reportElement> <box> <topPen lineWidth="0.0"/> <leftPen lineWidth="0.0"/> <bottomPen lineWidth="0.0"/> <rightPen lineWidth="0.0"/> </box> <textElement textAlignment="Right" verticalAlignment="Bottom"/> <textFieldExpression><![CDATA["Page " + $V{MASTER_CURRENT_PAGE} + " of " + $V{MASTER_TOTAL_PAGES}]]></textFieldExpression> </textField> <staticText> <reportElement style="SalesLabel" mode="Opaque" x="388" y="53" width="63" height="18" backcolor="#F2F2F2" uuid="552f8414-73e0-411a-8e92-72617e8094ac"> <property name="com.jaspersoft.studio.unit.height" value="inch"/> <property name="com.jaspersoft.studio.unit.width" value="inch"/> <property name="com.jaspersoft.studio.unit.x" value="inch"/> <property name="com.jaspersoft.studio.unit.y" value="inch"/> </reportElement> <box> <topPen lineWidth="0.0"/> <leftPen lineWidth="0.0"/> <bottomPen lineWidth="0.0"/> <rightPen lineWidth="0.0"/> </box> <textElement textAlignment="Left" verticalAlignment="Middle"> <font size="12" isBold="true"/> </textElement> <text><![CDATA[REVISION:]]></text> </staticText> <staticText> <reportElement key="" style="SalesLabel" x="0" y="71" width="49" height="18" uuid="2f14731b-33b3-4fba-9e9b-85da8bd4789d"> <property name="com.jaspersoft.studio.unit.height" value="inch"/> <property name="com.jaspersoft.studio.unit.width" value="inch"/> <property name="com.jaspersoft.studio.unit.x" value="inch"/> <property name="com.jaspersoft.studio.unit.y" value="inch"/> </reportElement> <box> <topPen lineWidth="1.5"/> <leftPen lineWidth="1.5"/> <bottomPen lineWidth="1.5"/> </box> <text><![CDATA[QUOTE #:]]></text> </staticText> <textField pattern="MM/dd/yyyy"> <reportElement style="SimpleField" x="451" y="53" width="77" height="18" uuid="e0d41006-65a5-449c-ba0b-49093ee885a6"> <property name="com.jaspersoft.studio.unit.height" value="inch"/> <property name="com.jaspersoft.studio.unit.width" value="inch"/> <property name="com.jaspersoft.studio.unit.x" value="inch"/> <property name="com.jaspersoft.studio.unit.y" value="inch"/> </reportElement> <box> <topPen lineWidth="0.0"/> <leftPen lineWidth="0.0"/> <bottomPen lineWidth="0.0"/> <rightPen lineWidth="0.0"/> </box> <textElement textAlignment="Left" verticalAlignment="Middle"> <font size="12"/> </textElement> <textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression> </textField> <textField> <reportElement style="SimpleField" mode="Opaque" x="248" y="71" width="57" height="18" uuid="417d3b7c-1eb8-4978-bffe-454857e433c0"> <property name="com.jaspersoft.studio.unit.height" value="inch"/> <property name="com.jaspersoft.studio.unit.width" value="inch"/> <property name="com.jaspersoft.studio.unit.x" value="inch"/> <property name="com.jaspersoft.studio.unit.y" value="inch"/> </reportElement> <box> <topPen lineWidth="1.5"/> <bottomPen lineWidth="1.5"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle"/> <textFieldExpression><![CDATA[$F{Job Info - Sales Order Number}]]></textFieldExpression> </textField> <textField> <reportElement style="SimpleField" mode="Opaque" x="355" y="71" width="64" height="18" uuid="dce0c913-8a7c-4485-b55b-fb0133beeabf"> <property name="com.jaspersoft.studio.unit.height" value="inch"/> <property name="com.jaspersoft.studio.unit.width" value="inch"/> <property name="com.jaspersoft.studio.unit.x" value="inch"/> <property name="com.jaspersoft.studio.unit.y" value="inch"/> </reportElement> <box> <topPen lineWidth="1.5"/> <bottomPen lineWidth="1.5"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle"/> <textFieldExpression><![CDATA[$F{Job Info - Serial Number}]]></textFieldExpression> </textField> <textField> <reportElement style="SimpleField" x="133" y="71" width="36" height="18" uuid="da49d6e1-aec6-4beb-a1d1-fb16573a6102"> <property name="com.jaspersoft.studio.unit.height" value="inch"/> <property name="com.jaspersoft.studio.unit.width" value="inch"/> <property name="com.jaspersoft.studio.unit.x" value="inch"/> <property name="com.jaspersoft.studio.unit.y" value="inch"/> </reportElement> <box> <topPen lineWidth="1.5"/> <bottomPen lineWidth="1.5"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle"/> <textFieldExpression><![CDATA[$F{Job Info - Sales Person}]]></textFieldExpression> </textField> <textField> <reportElement key="" style="SimpleField" x="49" y="71" width="57" height="18" uuid="77c38927-5d18-4a21-9632-afbe0856aa4a"> <property name="com.jaspersoft.studio.unit.height" value="inch"/> <property name="com.jaspersoft.studio.unit.width" value="inch"/> <property name="com.jaspersoft.studio.unit.x" value="inch"/> <property name="com.jaspersoft.studio.unit.y" value="inch"/> </reportElement> <box> <topPen lineWidth="1.5"/> <bottomPen lineWidth="1.5"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle"/> <textFieldExpression><![CDATA[$F{Job Info - Quote Number}]]></textFieldExpression> </textField> <staticText> <reportElement style="SalesLabel" x="305" y="71" width="50" height="18" uuid="b80489cd-77c3-4cb5-8a0e-27898ab0e69e"> <property name="com.jaspersoft.studio.unit.height" value="inch"/> <property name="com.jaspersoft.studio.unit.width" value="inch"/> <property name="com.jaspersoft.studio.unit.x" value="inch"/> <property name="com.jaspersoft.studio.unit.y" value="inch"/> </reportElement> <box> <topPen lineWidth="1.5"/> <leftPen lineWidth="0.5"/> <bottomPen lineWidth="1.5"/> </box> <textElement> <paragraph lineSpacing="AtLeast"/> </textElement> <text><![CDATA[SERIAL #:]]></text> </staticText> <textField> <reportElement style="SimpleField" x="487" y="71" width="62" height="18" uuid="31a6425c-e745-4375-9ba8-d3f02eea4876"> <property name="com.jaspersoft.studio.unit.height" value="inch"/> <property name="com.jaspersoft.studio.unit.width" value="inch"/> <property name="com.jaspersoft.studio.unit.x" value="inch"/> <property name="com.jaspersoft.studio.unit.y" value="inch"/> </reportElement> <box> <topPen lineWidth="1.5"/> <bottomPen lineWidth="1.5"/> <rightPen lineWidth="1.5"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle"> <font fontName="Calibri TTF"/> </textElement> <textFieldExpression><![CDATA[$F{Job Info - Order Date}]]></textFieldExpression> </textField> <staticText> <reportElement style="SalesLabel" x="419" y="71" width="68" height="18" uuid="72c1f960-10d9-428c-b017-611a3349055f"> <property name="com.jaspersoft.studio.unit.height" value="inch"/> <property name="com.jaspersoft.studio.unit.width" value="inch"/> <property name="com.jaspersoft.studio.unit.x" value="inch"/> <property name="com.jaspersoft.studio.unit.y" value="inch"/> </reportElement> <box> <topPen lineWidth="1.5"/> <leftPen lineWidth="0.5"/> <bottomPen lineWidth="1.5"/> </box> <text><![CDATA[ORDER DATE:]]></text> </staticText> <staticText> <reportElement style="SalesLabel" mode="Opaque" x="106" y="71" width="27" height="18" backcolor="#F2F2F2" uuid="08d81ace-3b87-42e5-9b86-44daf1af790e"> <property name="com.jaspersoft.studio.unit.height" value="inch"/> <property name="com.jaspersoft.studio.unit.width" value="inch"/> <property name="com.jaspersoft.studio.unit.x" value="inch"/> <property name="com.jaspersoft.studio.unit.y" value="inch"/> </reportElement> <box> <topPen lineWidth="1.5"/> <leftPen lineWidth="0.5"/> <bottomPen lineWidth="1.5"/> </box> <textElement verticalAlignment="Middle"> <font isBold="true"/> </textElement> <text><![CDATA[SP:]]></text> </staticText> <staticText> <reportElement style="SalesLabel" x="169" y="71" width="79" height="18" uuid="0fd54760-c2f1-4e7c-ab2e-aa8e3015ad49"> <property name="com.jaspersoft.studio.unit.height" value="inch"/> <property name="com.jaspersoft.studio.unit.width" value="inch"/> <property name="com.jaspersoft.studio.unit.x" value="inch"/> <property name="com.jaspersoft.studio.unit.y" value="inch"/> </reportElement> <box> <topPen lineWidth="1.5"/> <leftPen lineWidth="0.5"/> <bottomPen lineWidth="1.5"/> </box> <text><![CDATA[SALES ORDER #:]]></text> </staticText> </band> </summary> </jasperReport>
4 Answers:
Hi
I am not sure if this is relevant or not but I had a similar issue but with
shared images.
For some reason the images were removed from the base "ROLE_USER" user role so
although the user was part of that role, the role itself did not have permission
to access the images. ( actually only the administrator had access.)