Iterate Collection on jaspersoft - jasper-reports

I have a report that is simple, it has a few string paramters that receive all the data that i need. The strings are like this "1;2;3", "bob;john;mary". And i just need to show the data in rows. And it is working on jaspersoft. BUT not on jasperserver, when i run the report on jaspersoft server, it doesnt show the data.
I use .split(";") on the strings and cast it to arraylist and use it as datasource for my subreports. It is ugly but works, at least on jaspersoft. But it just doesnt on jasperserver.
The data comes from a angular project, and is filled by the user. I dont have this data on the DB.
I think its a problem on the way im using the datasource on the subreports but im not sure. Im new to jaspersoft. If this is not the way i should be doing this, pls say so, any help is appreciated
Here is my report code:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.13.0.final using JasperReports Library version 6.13.0-46ada4d1be8f3c5985fd0b6146f3ed44caed6f05 -->
<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="OcorrenciasBancarias" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="8fbddf4a-554c-4f04-9941-b9e16c98b10d">
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="RK ERP Devel"/>
<property name="ireport.jasperserver.url" value="http://192.168.0.205:11001/jasperserver/"/>
<property name="ireport.jasperserver.user" value="jasperadmin"/>
<property name="ireport.jasperserver.report.resource" value="/reports/telas/quitacao_multiplas_contas/arquivo_retorno/ocorrenciasBancarias_files/main_jrxml"/>
<property name="ireport.jasperserver.reportUnit" value="/reports/telas/quitacao_multiplas_contas/arquivo_retorno/ocorrenciasBancarias"/>
<parameter name="CLIENTE" class="java.lang.String"/>
<parameter name="DOCUMENTO" class="java.lang.String"/>
<parameter name="NOSSONUMERO" class="java.lang.String"/>
<parameter name="VALOR" class="java.lang.String"/>
<parameter name="VENCIMENTO" class="java.lang.String"/>
<parameter name="OCORRENCIA" class="java.lang.String"/>
<parameter name="CLIENTELIST" class="java.util.List">
<defaultValueExpression><![CDATA[Arrays.asList($P{CLIENTE}.split(";"))]]></defaultValueExpression>
</parameter>
<parameter name="DOCUMENTOLIST" class="java.util.List">
<defaultValueExpression><![CDATA[Arrays.asList($P{DOCUMENTO}.split(";"))]]></defaultValueExpression>
</parameter>
<parameter name="NOSSONUMEROLIST" class="java.util.List">
<defaultValueExpression><![CDATA[Arrays.asList($P{NOSSONUMERO}.split(";"))]]></defaultValueExpression>
</parameter>
<parameter name="VALORLIST" class="java.util.List">
<defaultValueExpression><![CDATA[Arrays.asList($P{VALOR}.split(";"))]]></defaultValueExpression>
</parameter>
<parameter name="VENCIMENTOLIST" class="java.util.List">
<defaultValueExpression><![CDATA[Arrays.asList($P{VENCIMENTO}.split(";"))]]></defaultValueExpression>
</parameter>
<parameter name="OCORRENCIALIST" class="java.util.List">
<defaultValueExpression><![CDATA[Arrays.asList($P{OCORRENCIA}.split(";"))]]></defaultValueExpression>
</parameter>
<queryString language="SQL">
<![CDATA[select 1]]>
</queryString>
<background>
<band splitType="Stretch"/>
</background>
<pageHeader>
<band height="40" splitType="Stretch">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<textField pattern="dd/MM/yyyy">
<reportElement positionType="Float" x="379" y="0" width="80" height="20" forecolor="#27272F" uuid="a29fce94-a139-4d14-b782-9fe95ed43793">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement textAlignment="Right">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
<textField pattern="HH:mm">
<reportElement positionType="Float" x="432" y="0" width="50" height="20" forecolor="#27272F" uuid="22d51de7-fdb2-4681-a3d4-bc3ba4a4cc65">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement textAlignment="Right">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
<frame>
<reportElement positionType="Float" stretchType="ContainerHeight" x="0" y="20" width="554" height="20" isRemoveLineWhenBlank="true" isPrintInFirstWholeBand="true" uuid="58d13352-4653-4587-827c-ea222229bbbe">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<printWhenExpression><![CDATA[new Boolean($V{PAGE_NUMBER} == 1)]]></printWhenExpression>
</reportElement>
<frame>
<reportElement positionType="Float" mode="Opaque" x="0" y="0" width="554" height="20" backcolor="#D9D9D9" uuid="7199097a-7296-410a-91f4-250495caab85">
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.FreeLayout"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<box leftPadding="1" bottomPadding="1" rightPadding="1">
<pen lineColor="#9FEDE5"/>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<staticText>
<reportElement positionType="Float" x="0" y="0" width="552" height="20" forecolor="#27272F" uuid="592cfe50-8cc4-473d-bac5-93c67922aedd">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<box topPadding="1" leftPadding="1" bottomPadding="1" rightPadding="1"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="10" isBold="true"/>
</textElement>
<text><![CDATA[INFO FROM PARAMETERS]]></text>
</staticText>
</frame>
</frame>
<textField evaluationTime="Master">
<reportElement positionType="Float" x="442" y="0" width="112" height="20" forecolor="#27272F" uuid="921629e5-89b3-4d65-886d-fe20c21fa84b">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement textAlignment="Right">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA["Página "+$V{MASTER_CURRENT_PAGE}+" de "+$V{MASTER_TOTAL_PAGES}]]></textFieldExpression>
</textField>
</band>
</pageHeader>
<columnHeader>
<band height="14" splitType="Stretch">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<line>
<reportElement x="0" y="13" width="555" height="1" forecolor="#595959" uuid="34831667-1d80-4cae-a91d-d6651c1cf3f4">
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
</line>
<staticText>
<reportElement x="0" y="0" width="32" height="14" forecolor="#27272F" uuid="549ff20c-f7e6-46b8-b431-d361f478c4a5">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="4a6727e1-e6e7-4a70-8291-1a81b0a10118"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement verticalAlignment="Middle">
<font size="8" isBold="true"/>
</textElement>
<text><![CDATA[Cliente]]></text>
</staticText>
<staticText>
<reportElement x="130" y="0" width="60" height="14" forecolor="#27272F" uuid="835a1ff7-8ed8-4a88-b5f1-00cd6677957c">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="88aaba7a-4029-4a82-b1c2-ee8e93b1feb2"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement verticalAlignment="Middle">
<font size="8" isBold="true"/>
</textElement>
<text><![CDATA[Documento]]></text>
</staticText>
<staticText>
<reportElement x="200" y="0" width="70" height="14" forecolor="#27272F" uuid="dd5bfaf9-d080-4499-86f2-a7e0e4d3b492">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="5c2a2b79-9bac-4851-b7b3-c7642b0976ad"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement verticalAlignment="Middle">
<font size="8" isBold="true"/>
</textElement>
<text><![CDATA[Nosso Número]]></text>
</staticText>
<staticText>
<reportElement x="280" y="0" width="70" height="14" forecolor="#27272F" uuid="33fb80ff-5f98-4c6f-ae62-1695b0b08490">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="d4028cee-3416-4e73-8c8d-56b544671f27"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement verticalAlignment="Middle">
<font size="8" isBold="true"/>
</textElement>
<text><![CDATA[Valor]]></text>
</staticText>
<staticText>
<reportElement x="350" y="0" width="60" height="14" forecolor="#27272F" uuid="056f347b-d9a2-49ee-8674-8d31e9b07ea8">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="8e8f8fed-a90c-4c5b-b2cc-d0ad1c49dc1a"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement verticalAlignment="Middle">
<font size="8" isBold="true"/>
</textElement>
<text><![CDATA[Vencimento]]></text>
</staticText>
<staticText>
<reportElement x="420" y="0" width="134" height="14" forecolor="#27272F" uuid="af29b7ba-2bc2-45be-a78a-f70bda792540">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="8e8f8fed-a90c-4c5b-b2cc-d0ad1c49dc1a"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement verticalAlignment="Middle">
<font size="8" isBold="true"/>
</textElement>
<text><![CDATA[Ocorrência]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="30" splitType="Stretch">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<subreport>
<reportElement x="0" y="0" width="130" height="30" uuid="914c099d-14bb-48a7-a696-73973de7093b">
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{CLIENTELIST})]]></dataSourceExpression>
<subreportExpression><![CDATA["SUBREPORT.jasper"]]></subreportExpression>
</subreport>
<subreport>
<reportElement x="130" y="0" width="70" height="30" uuid="924b44a1-81c6-4634-929d-e0ece1e11e2a">
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{DOCUMENTOLIST})]]></dataSourceExpression>
<subreportExpression><![CDATA["SUBREPORT_VALOR.jasper"]]></subreportExpression>
</subreport>
<subreport>
<reportElement x="200" y="0" width="80" height="30" uuid="c957a547-8e5f-4985-83fd-cc7eebbe8568"/>
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{NOSSONUMEROLIST})]]></dataSourceExpression>
<subreportExpression><![CDATA["SUBREPORT_NUMERO.jasper"]]></subreportExpression>
</subreport>
<subreport>
<reportElement x="280" y="0" width="70" height="30" uuid="735a18c3-59ff-425f-9752-4a54a29b7ccf">
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{VALORLIST})]]></dataSourceExpression>
<subreportExpression><![CDATA["SUBREPORT_VALOR.jasper"]]></subreportExpression>
</subreport>
<subreport>
<reportElement x="350" y="0" width="70" height="30" uuid="417264e1-2694-462b-8cdc-a2768c3ef18c"/>
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{VENCIMENTOLIST})]]></dataSourceExpression>
<subreportExpression><![CDATA["SUBREPORT_VALOR.jasper"]]></subreportExpression>
</subreport>
<subreport>
<reportElement x="420" y="0" width="135" height="30" uuid="5b686650-452c-4286-8513-163fa164f3ce">
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{OCORRENCIALIST})]]></dataSourceExpression>
<subreportExpression><![CDATA["SUBREPORT_OCORRENCIA.jasper"]]></subreportExpression>
</subreport>
</band>
</detail>
</jasperReport>

Similar to what you have already done. But uses a single subreport.
$P{numbers}: 1;2;3
$P{names}: a;b;c
$P{numbersList}: Arrays.asList($P{numbers}.split(";"))
$P{namesList}: Arrays.asList($P{names}.split(";"))
$P{recordsList}: java.util.stream.IntStream.range(0, $P{numbersList}.size()).mapToObj( i -> new String[]{(String)$P{numbersList}.get(i), (String)$P{namesList}.get(i)} ).collect(java.util.stream.Collectors.toList())
The above code takes de 1st element of each list and puts in a single array. Then, takes de 2nd element of each list and so on. In the end you have this:
List[ [1, a], [2, b], [3, c] ]
When calling the subreport, you pass this datasource:
new net.sf.jasperreports.engine.data.ListOfArrayDataSource(
$P{recordsList},
new String[]{"number", "name"}
)
Obviously, in the subreport you must have the fields number and name.
This worked for me in Jaspersoft Studio.
Main.jrxml:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.14.0.final using JasperReports Library version 6.14.0-2ab0d8625be255bf609c78e1181801213e51db8f -->
<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="Main" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="acfc3351-2262-463e-ae8a-dd475abdd1bc">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
<parameter name="numbers" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["1;2;3;4;5;6"]]></defaultValueExpression>
</parameter>
<parameter name="names" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["a;b;c;d;e;f"]]></defaultValueExpression>
</parameter>
<parameter name="numbersList" class="java.util.List" nestedType="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA[Arrays.asList($P{numbers}.split(";"))]]></defaultValueExpression>
</parameter>
<parameter name="namesList" class="java.util.List" nestedType="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA[Arrays.asList($P{names}.split(";"))]]></defaultValueExpression>
</parameter>
<parameter name="recordsList" class="java.util.List" isForPrompting="false">
<defaultValueExpression><![CDATA[java.util.stream.IntStream.range(0, $P{numbersList}.size()).mapToObj( i -> new String[]{(String)$P{numbersList}.get(i), (String)$P{namesList}.get(i)} ).collect(java.util.stream.Collectors.toList())]]></defaultValueExpression>
</parameter>
<queryString>
<![CDATA[]]>
</queryString>
<title>
<band height="30">
<textField>
<reportElement x="0" y="0" width="278" height="30" uuid="3bde936c-9702-404e-9932-68d37a915600"/>
<textFieldExpression><![CDATA[$P{numbersList}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="278" y="0" width="277" height="30" uuid="213c86ad-069a-4bdd-9840-cb71559fa265"/>
<textFieldExpression><![CDATA[$P{namesList}]]></textFieldExpression>
</textField>
</band>
</title>
<detail>
<band height="30" splitType="Stretch">
<subreport>
<reportElement x="0" y="0" width="555" height="30" uuid="8049f4ff-e490-4a1c-8c85-71be6335ba69"/>
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.ListOfArrayDataSource( $P{recordsList}, new String[]{"number", "name"} )]]></dataSourceExpression>
<subreportExpression><![CDATA["Sub.jasper"]]></subreportExpression>
</subreport>
</band>
</detail>
</jasperReport>
Sub.jrxml:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.14.0.final using JasperReports Library version 6.14.0-2ab0d8625be255bf609c78e1181801213e51db8f -->
<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="Sub" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="f06a30d4-cc6b-4ca5-a42f-3dcf791be297">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="NO_DATA_ADAPTER"/>
<queryString>
<![CDATA[]]>
</queryString>
<field name="number" class="java.lang.String"/>
<field name="name" class="java.lang.String"/>
<columnHeader>
<band height="30">
<staticText>
<reportElement x="0" y="0" width="278" height="30" uuid="3705eb7a-891e-4118-bcad-abae96e78171">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="4faf3089-5386-4350-9b8c-6f2f3eac41f7"/>
</reportElement>
<text><![CDATA[number]]></text>
</staticText>
<staticText>
<reportElement x="278" y="0" width="277" height="30" uuid="e194e190-bf9a-4f01-8aef-c2799a240199">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="cf256fba-83b6-4575-9cc7-487a63cfb77b"/>
</reportElement>
<text><![CDATA[name]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="30" splitType="Stretch">
<textField>
<reportElement x="0" y="0" width="278" height="30" uuid="572c825e-3188-4b27-95e1-b24ac2009d6a">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="4faf3089-5386-4350-9b8c-6f2f3eac41f7"/>
</reportElement>
<textFieldExpression><![CDATA[$F{number}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="278" y="0" width="277" height="30" uuid="f1662cf8-13a8-4d5d-b55a-0901b2aabec3">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="cf256fba-83b6-4575-9cc7-487a63cfb77b"/>
</reportElement>
<textFieldExpression><![CDATA[$F{name}]]></textFieldExpression>
</textField>
</band>
</detail>
</jasperReport>

Related

How do I prevent text overflowing into the next cell in a Jasper Report that exports to Excel?

I am creating a jrxml in Jaspersoft Studio that exports a table to Excel. When I view the Excel output, the data in the last column is overflowing into the next cell like so:
I am trying to prevent the data from overflowing into the next cell without wrapping the data in the cell.
I was able to find a reference for why Excel does overflow text: https://www.ablebits.com/office-addins-blog/stop-text-spilling-over-excel/
One of the solutions is to manually Format Cells and change horizontal text alignment to 'Fill'. This gives me the following table, which is exactly what I need:
However, I was not able to find a way to configure my jrxml to obtain this behavior. How may I create my jrxml such that it will export to Excel without overflowing text into adjacent columns (without wrapping the text)?
I don't think text alignment 'Fill' can be set when exporting to XLS.
One (kinda dirty) solution is having a 'blank' cell next to COL2 which will prevent the text in COL2 overflowing into the 'blank' cell.
Your example (modified):
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.20.0.final using JasperReports Library version 6.1.1 -->
<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="Blank_A4" pageWidth="240" pageHeight="400" columnWidth="200" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="af068097-e37b-4e41-9083-4c7b8e13c800">
<property name="com.jaspersoft.studio.unit." value="pixel"/>
<property name="net.sf.jasperreports.export.xls.wrap.text" value="false"/>
<property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/>
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<subDataset name="Dataset1" uuid="f12cc232-2035-43e1-b3e3-a446ee7318bf">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
<queryString>
<![CDATA[select 'abcdefghijklmnopqrstuvwxyz' as data1,
'abcdefghijklmnopqrstuvwxyz' as data2]]>
</queryString>
<field name="data1" class="java.lang.String"/>
<field name="data2" class="java.lang.String"/>
</subDataset>
<queryString>
<![CDATA[select 1]]>
</queryString>
<detail>
<band height="359" splitType="Stretch">
<componentElement>
<reportElement x="0" y="0" width="220" height="60" uuid="6a7376a7-6ee6-4e94-8e7b-024170505320">
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
</reportElement>
<c:table xmlns:c="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">
<datasetRun subDataset="Dataset1" uuid="0fee875c-6568-4a06-a8e4-f7fb34ebd4e5"/>
<c:column width="100" uuid="6517d845-8cbe-44b6-a644-cedfc40576c9">
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Column1"/>
<c:columnHeader height="30" rowSpan="1">
<staticText>
<reportElement mode="Opaque" x="0" y="0" width="100" height="30" forecolor="#FFFFFF" backcolor="#7845D9" uuid="f222fdba-a6db-46dd-97a5-e8e0181aa7e4">
<propertyExpression name="net.sf.jasperreports.export.xls.wrap.text"><![CDATA["true"]]></propertyExpression>
</reportElement>
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="1.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[COL1]]></text>
</staticText>
</c:columnHeader>
<c:detailCell height="30">
<textField isBlankWhenNull="true">
<reportElement mode="Opaque" x="0" y="0" width="100" height="30" uuid="2a235121-a4f3-487b-8138-edc5b5340e50"/>
<box>
<pen lineWidth="0.5"/>
</box>
<textElement verticalAlignment="Middle">
<paragraph leftIndent="3"/>
</textElement>
<textFieldExpression><![CDATA[$F{data1}]]></textFieldExpression>
</textField>
</c:detailCell>
</c:column>
<c:column width="100" uuid="23415ab5-ef42-4f13-9395-cc9bb019149a">
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Column2"/>
<c:columnHeader height="30" rowSpan="1">
<staticText>
<reportElement mode="Opaque" x="0" y="0" width="100" height="30" forecolor="#FFFFFF" backcolor="#7845D9" uuid="8ecbe731-1442-40b4-94a6-f3c57337704c">
<propertyExpression name="net.sf.jasperreports.export.xls.wrap.text"><![CDATA["true"]]></propertyExpression>
</reportElement>
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="1.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[COL2]]></text>
</staticText>
</c:columnHeader>
<c:detailCell height="30">
<textField isBlankWhenNull="true">
<reportElement mode="Opaque" x="0" y="0" width="100" height="30" uuid="c8f16b37-4f63-4043-abc6-d321125c247e"/>
<box>
<pen lineWidth="0.5"/>
</box>
<textElement verticalAlignment="Middle">
<paragraph leftIndent="3"/>
</textElement>
<textFieldExpression><![CDATA[$F{data2}]]></textFieldExpression>
</textField>
</c:detailCell>
</c:column>
<c:column width="20" uuid="4fff907e-9cb8-41d3-a264-b78ca5ed814a">
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Column3"/>
<c:columnHeader height="30" rowSpan="1"/>
<c:detailCell height="30">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<textField>
<reportElement x="0" y="0" width="20" height="30" uuid="eb0dd902-0635-4a55-8f84-03834107f2bf"/>
<textFieldExpression><![CDATA[""]]></textFieldExpression>
</textField>
</c:detailCell>
</c:column>
</c:table>
</componentElement>
</band>
</detail>
</jasperReport>

How on frame keep same behavior when printWhenExpression is false as if it does not exists?

So I have a detail band with two frames, the first frame has several elements including a subreport, the second frame only has a textfield.
The issue I'm having is, if i remove the second frame from the band all the content remains in the same page. If i add the second frame and use the printonly expression to not show it, it changes the entire content to the next page.
Is there a way to force that, if the second frame is empty to maintain the behavior as if didn't exist at all?
<band height="160" splitType="Prevent">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.FreeLayout"/>
<frame>
<reportElement isPrintRepeatedValues="false" x="0" y="1" width="556" height="116" isRemoveLineWhenBlank="true" uuid="3aca49ee-4b55-452c-a8c6-5cc252c4175c">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<subreport>
<reportElement positionType="Float" x="2" y="65" width="160" height="51" uuid="438d3f08-7b8a-4b61-b17f-19993aa5abe4">
<property name="local_mesure_unitx" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="cm"/>
</reportElement>
<subreportParameter name="DOC_ID">
<subreportParameterExpression><![CDATA[$P{DOC_ID}]]></subreportParameterExpression>
</subreportParameter>
<subreportParameter name="IS_RUNNING_LOCAL">
<subreportParameterExpression><![CDATA[$P{IS_RUNNING_LOCAL}]]></subreportParameterExpression>
</subreportParameter>
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.JREmptyDataSource()]]></dataSourceExpression>
<subreportExpression><![CDATA[$P{IS_RUNNING_LOCAL} ? "/Reports/Common/xxxxxxxxxxxxxxSub.jasper" : "repo:/Reports/Common/xxxxxxxxxxxxxxSub"]]></subreportExpression>
</subreport>
<textField isStretchWithOverflow="true">
<reportElement style="Default" positionType="Float" mode="Transparent" x="1" y="1" width="552" height="30" isRemoveLineWhenBlank="true" forecolor="#000000" backcolor="#FFFFFF" uuid="837c85bf-7a2a-4eb5-919d-bd16d4bc64f2">
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="local_mesure_unity" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="cm"/>
<property name="local_mesure_unitheight" value="pixel"/>
</reportElement>
<box padding="0" topPadding="0" leftPadding="0" bottomPadding="0" rightPadding="0"/>
<textElement textAlignment="Justified" verticalAlignment="Top" rotation="None" markup="html">
<font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single" lineSpacingSize="1.0" firstLineIndent="0" leftIndent="0" rightIndent="0" spacingBefore="0" spacingAfter="0" tabStopWidth="40"/>
</textElement>
<textFieldExpression><![CDATA["xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"]]></textFieldExpression>
</textField>
<textField>
<reportElement style="Default" positionType="Float" mode="Transparent" x="2" y="43" width="511" height="17" forecolor="#000000" backcolor="#FFFFFF" uuid="3e1c3952-6578-4d5f-85a3-d706fc5a5fbb">
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="local_mesure_unitx" value="cm"/>
<property name="com.jaspersoft.studio.unit.x" value="cm"/>
<property name="local_mesure_unitheight" value="pixel"/>
</reportElement>
<box padding="0" topPadding="0" leftPadding="0" bottomPadding="0" rightPadding="0"/>
<textElement textAlignment="Justified" verticalAlignment="Top" rotation="None" markup="html">
<font fontName="Arial" size="9" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single" lineSpacingSize="1.0" firstLineIndent="0" leftIndent="0" rightIndent="0" spacingBefore="0" spacingAfter="0" tabStopWidth="40"/>
</textElement>
<textFieldExpression><![CDATA["testetestestestestestes"]]></textFieldExpression>
</textField>
</frame>
<frame>
<reportElement positionType="Float" x="1" y="120" width="555" height="40" isRemoveLineWhenBlank="true" uuid="c3bf96ce-dd19-41f1-bf13-fe1dd46d8d4e">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<printWhenExpression><![CDATA[$P{COD_DOC}.equals("xx_xxx_xxx")]]></printWhenExpression>
</reportElement>
<textField isBlankWhenNull="true">
<reportElement positionType="Float" isPrintRepeatedValues="false" mode="Transparent" x="1" y="0" width="551" height="39" isRemoveLineWhenBlank="true" uuid="c1ab35b8-31a6-41e9-a260-71bbcab8692e">
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<printWhenExpression><![CDATA[$P{COD_DOC}.equals("xx_xxx_xxx")]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Justified">
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA["PS: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"]]></textFieldExpression>
</textField>
</frame>
</band>
Is there a way to force that, if the second frame is empty to maintain the behavior as if didn't exist at all?
The solution to this is to use multiple detail bands and set the printWhenExpression to the detail band
<?xml version="1.0" encoding="UTF-8"?>
<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="TestParams" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="f85bc6aa-5060-4485-bd99-bd5de1734ef1">
<queryString>
<![CDATA[]]>
</queryString>
<detail>
<band height="116">
<break>
<reportElement x="0" y="5" width="100" height="1" uuid="fb9c89cd-1b6a-44f5-82a9-99e9996229e3">
<printWhenExpression><![CDATA[$P{COD_DOC}.equals("xx_xxx_xxx")]]></printWhenExpression>
</reportElement>
</break>
<frame>
<reportElement x="0" y="10" width="200" height="116" uuid="e6890adf-6ff1-49f6-9c47-ba6f171a2c60"/>
</frame>
</band>
<band height="40">
<printWhenExpression><![CDATA[$P{COD_DOC}.equals("xx_xxx_xxx")]]></printWhenExpression>
<frame>
<reportElement x="0" y="0" width="200" height="40" uuid="d9f8ba4a-e435-49ff-9ff7-d23e55aecc52"/>
</frame>
</band>
</detail>
</jasperReport>
This way if second component is not showing/printed the whole band (height) will be removed and it will behave as only first band exists.

Jaspersoft page wrong orientation on print

I have a jasper report to print a little invoice in portrait orientation, but whem I send to print, it's in landscape and takes up a lot of space at the A4 page.
How can I do to fix the orientation to maintain as portrait?
I've tryed to put the code of my jrxml here, but i'ts big, so, on the link you can download the .jxrml or by pastebin.
invoice.jrxml
Invoice by pastebin
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.5.1.final using JasperReports Library version 6.5.1 -->
<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="recibo" pageWidth="538" pageHeight="842" columnWidth="518" leftMargin="10" rightMargin="10" topMargin="10" bottomMargin="10" isIgnorePagination="true" uuid="11534e1c-358a-479d-bf93-b6f8c442b8f6">
<property name="ireport.zoom" value="2.479338842975207"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="131"/>
<property name="com.jaspersoft.studio.unit." value="cm"/>
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
<property name="com.jaspersoft.studio.unit.pageWidth" value="cm"/>
<property name="com.jaspersoft.studio.unit.topMargin" value="cm"/>
<property name="com.jaspersoft.studio.unit.bottomMargin" value="cm"/>
<property name="com.jaspersoft.studio.unit.leftMargin" value="cm"/>
<property name="com.jaspersoft.studio.unit.rightMargin" value="cm"/>
<property name="com.jaspersoft.studio.unit.columnWidth" value="cm"/>
<property name="com.jaspersoft.studio.unit.columnSpacing" value="cm"/>
<parameter name="LOGO_EMITENTE" class="java.lang.Object" isForPrompting="false"/>
<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false"/>
<queryString>
<![CDATA[]]>
</queryString>
<field name="tit.identificacao" class="java.lang.String"/>
<field name="tit.valor" class="java.lang.Double"/>
<field name="tit.valor_ext" class="java.lang.String"/>
<field name="pag.nome" class="java.lang.String"/>
<field name="tit.dtPag" class="java.lang.String"/>
<field name="emit.fant" class="java.lang.String"/>
<field name="emit.xNome" class="java.lang.String"/>
<field name="emit.xLgr" class="java.lang.String"/>
<field name="emit.nro" class="java.lang.String"/>
<field name="emit.xCpl" class="java.lang.String"/>
<field name="emit.xBairro" class="java.lang.String"/>
<field name="emit.cep" class="java.lang.String"/>
<field name="emit.xMun" class="java.lang.String"/>
<field name="emit.uf" class="java.lang.String"/>
<field name="emit.fone" class="java.lang.String"/>
<field name="emit.nrDocumento" class="java.lang.String"/>
<field name="emit.ie" class="java.lang.String"/>
<field name="emit.im" class="java.lang.String"/>
<field name="tit.dtPagExtenso" class="java.lang.String"/>
<field name="rec.nome" class="java.lang.String"/>
<detail>
<band height="180">
<property name="com.jaspersoft.studio.layout"/>
<frame>
<reportElement stretchType="RelativeToBandHeight" x="0" y="0" width="518" height="180" uuid="c0e55f85-87e9-440d-ae9b-b3c4567027e5">
<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>
<box leftPadding="0" bottomPadding="0" rightPadding="0">
<pen lineWidth="0.0"/>
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="1.0"/>
</box>
<staticText>
<reportElement x="121" y="9" width="270" height="20" uuid="1e5ac468-8b43-444b-9b66-fb0e81427f12">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Top">
<font fontName="Monospaced" size="14" isBold="true"/>
</textElement>
<text><![CDATA[RECIBO]]></text>
</staticText>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="Float" x="80" y="32" width="435" height="20" uuid="dc2e375a-32f1-4ca7-8094-abcd3198af0e"/>
<textElement textAlignment="Left" verticalAlignment="Top">
<font fontName="Monospaced" size="8" isBold="true" isUnderline="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{pag.nome}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00;¤ -#,##0.00" isBlankWhenNull="true">
<reportElement positionType="Float" x="396" y="8" width="119" height="20" uuid="90210ce2-92ef-418d-bde0-8e9f5b675576"/>
<textElement textAlignment="Right" verticalAlignment="Top">
<font fontName="Monospaced" size="12" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{tit.valor}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="¤#,##0.00;¤-#,##0.00" isBlankWhenNull="true">
<reportElement positionType="Float" x="60" y="83" width="454" height="20" uuid="35a3c249-1a76-43ce-a290-eb754bee83af">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
</reportElement>
<textElement textAlignment="Left" verticalAlignment="Top">
<font fontName="Monospaced" size="8" isBold="true" isUnderline="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{tit.identificacao}]]></textFieldExpression>
</textField>
<staticText>
<reportElement positionType="Float" x="459" y="172" width="52" height="8" uuid="7a716ed8-4f4e-44d4-a699-275510648c8a"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="Monospaced" size="5" isItalic="true"/>
</textElement>
<text><![CDATA[www.sentus.com.br]]></text>
</staticText>
</frame>
<staticText>
<reportElement x="2" y="32" width="78" height="12" uuid="19cd0546-23ff-4e55-b549-822b7a737b09"/>
<textElement textAlignment="Left" verticalAlignment="Top">
<font fontName="Monospaced" size="8"/>
</textElement>
<text><![CDATA[Recebi(emos) de]]></text>
</staticText>
<staticText>
<reportElement positionType="Float" x="2" y="52" width="58" height="12" uuid="88baf49a-023a-42ce-821e-7ef6bcd17b95"/>
<textElement textAlignment="Left" verticalAlignment="Top">
<font fontName="Monospaced" size="8"/>
</textElement>
<text><![CDATA[a quantia de]]></text>
</staticText>
<textField isStretchWithOverflow="true" pattern="¤#,##0.00;¤-#,##0.00" isBlankWhenNull="true">
<reportElement positionType="Float" x="60" y="52" width="455" height="24" uuid="ea680987-de0f-4766-89fc-f1fce0b2f47b">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
</reportElement>
<textElement textAlignment="Left" verticalAlignment="Top">
<font fontName="Monospaced" size="8" isBold="true" isUnderline="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{tit.valor_ext}]]></textFieldExpression>
</textField>
<staticText>
<reportElement positionType="Float" x="2" y="83" width="58" height="12" uuid="753a6211-5cf0-4bc8-a703-14a204e80e60">
<property name="com.jaspersoft.studio.unit.y" value="pixel"/>
</reportElement>
<textElement textAlignment="Left" verticalAlignment="Top">
<font fontName="Monospaced" size="8"/>
</textElement>
<text><![CDATA[referente à]]></text>
</staticText>
<staticText>
<reportElement positionType="Float" stretchType="RelativeToTallestObject" x="2" y="107" width="204" height="12" uuid="854cc28e-80fe-4fd2-9d55-0c5c9b850075"/>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font fontName="Monospaced" size="8"/>
</textElement>
<text><![CDATA[e para clareza firmo(amos) o presente.]]></text>
</staticText>
<textField isBlankWhenNull="true">
<reportElement positionType="Float" x="153" y="130" width="220" height="12" uuid="c8231b66-f3f2-42b8-bcc0-7f6c29acfb58"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Monospaced" size="8" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{emit.xMun} + ", " + $F{tit.dtPagExtenso}]]></textFieldExpression>
<patternExpression><![CDATA[$F{emit.xMun}]]></patternExpression>
</textField>
<line>
<reportElement positionType="FixRelativeToBottom" x="193" y="158" width="149" height="1" uuid="4d95856f-f0ec-427d-bfc6-bc012da4f236"/>
<graphicElement>
<pen lineWidth="0.5"/>
</graphicElement>
</line>
<staticText>
<reportElement positionType="Float" x="163" y="170" width="204" height="10" uuid="a839d66e-220b-48e5-a15b-7021aac21b25"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Monospaced" size="7" isBold="false"/>
</textElement>
<text><![CDATA[Assinatura]]></text>
</staticText>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="Float" x="163" y="160" width="204" height="10" uuid="3287959a-43aa-472d-8589-c1e777b8a146"/>
<textElement textAlignment="Center" verticalAlignment="Top">
<font fontName="Monospaced" size="7" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{rec.nome}]]></textFieldExpression>
</textField>
</band>
</detail>
</jasperReport>
Thank you
I solved the problem creating a new report with the correct A4 size, and inside of it, I put my old report invoice.jrxml that I mentioned in the question.
It worked perfectly.
invoice_A4.jrxml
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.5.1.final using JasperReports Library version 6.5.1 -->
<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="recibo_A4" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" whenResourceMissingType="Empty" uuid="97db2eb7-eacb-4a72-af21-544bfd5ffe59">
<property name="com.jaspersoft.studio.unit." value="cm"/>
<property name="com.jaspersoft.studio.unit.pageHeight" value="cm"/>
<property name="com.jaspersoft.studio.unit.pageWidth" value="cm"/>
<property name="com.jaspersoft.studio.unit.topMargin" value="cm"/>
<property name="com.jaspersoft.studio.unit.bottomMargin" value="cm"/>
<property name="com.jaspersoft.studio.unit.leftMargin" value="cm"/>
<property name="com.jaspersoft.studio.unit.rightMargin" value="cm"/>
<property name="com.jaspersoft.studio.unit.columnWidth" value="cm"/>
<property name="com.jaspersoft.studio.unit.columnSpacing" value="cm"/>
<queryString>
<![CDATA[]]>
</queryString>
<field name="recibos" class="java.lang.Object"/>
<detail>
<band height="802" splitType="Stretch">
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
<frame>
<reportElement key="" x="0" y="0" width="555" height="802" uuid="7896b407-46da-4b1a-a3c7-835e45d14bc5">
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
</reportElement>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<subreport>
<reportElement x="0" y="0" width="555" height="802" uuid="ca317fd4-37db-4802-be56-943b67fd4189"/>
<dataSourceExpression><![CDATA[$F{recibos}]]></dataSourceExpression>
<subreportExpression><![CDATA["reports/recibo.jasper"]]></subreportExpression>
</subreport>
</frame>
</band>
</detail>
</jasperReport>

Shift the complete content to next page if it is not getting adjusted in previous page

I have a scenario where I have to shift the complete content to next page if it is not getting adjusted to previous page. Currently the content getting broken up between pages. I tried to put the contents inside the frame element but didn't work.
Screenshot:
And Here is the jrxml file
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.3.0.final using JasperReports Library version 6.3.0 -->
<!-- 2017-08-10T12:25:01 -->
<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="note11-pledgedassets" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="0" uuid="eff89e48-1135-41dd-b056-b42855f2ba3d">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
<property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/>
<style name="style2">
<conditionalStyle>
<conditionExpression><![CDATA[$F{label}.equals("Summa ställda säkerheter :")]]></conditionExpression>
<style fontName="SegoeUI" isItalic="true"/>
</conditionalStyle>
</style>
<queryString>
<![CDATA[]]>
</queryString>
<field name="label" class="java.lang.String"/>
<field name="amount" class="java.lang.String"/>
<field name="count" class="java.lang.Integer"/>
<field name="number" class="java.lang.Integer"/>
<field name="financialYearEndDate" class="java.lang.String"/>
<field name="text" class="java.lang.String"/>
<detail>
<band height="90" splitType="Prevent">
<frame>
<reportElement positionType="Float" x="21" y="1" width="530" height="89" isRemoveLineWhenBlank="true" uuid="c171bfff-1a99-40f3-a010-9429cae01a9c">
<property name="com.jaspersoft.studio.unit.x" value="pixel"/>
</reportElement>
<box>
<topPen lineWidth="3.0" lineStyle="Solid"/>
<leftPen lineWidth="3.0" lineStyle="Solid"/>
<bottomPen lineWidth="3.0" lineStyle="Solid"/>
<rightPen lineWidth="3.0" lineStyle="Solid"/>
</box>
<textField isBlankWhenNull="true">
<reportElement style="style2" positionType="Float" x="1" y="28" width="364" height="15" isRemoveLineWhenBlank="true" uuid="693a615c-58a8-4b74-859f-31da16548c0f">
<property name="com.jaspersoft.studio.unit.y" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
<printWhenExpression><![CDATA[$F{amount}!=null && !$F{amount}.equals("0")]]></printWhenExpression>
</reportElement>
<textElement verticalAlignment="Bottom">
<font fontName="SegoeUI" size="9"/>
</textElement>
<textFieldExpression><![CDATA[$F{label}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement style="style2" positionType="Float" x="384" y="28" width="100" height="15" isRemoveLineWhenBlank="true" uuid="e1094881-70b8-47af-b7d4-a52b16285a12">
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<printWhenExpression><![CDATA[$F{amount}!=null && !$F{amount}.equals("0")]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Right" verticalAlignment="Bottom">
<font fontName="SegoeUI" size="9"/>
</textElement>
<textFieldExpression><![CDATA[$F{amount}]]></textFieldExpression>
</textField>
<staticText>
<reportElement positionType="Float" x="1" y="15" width="100" height="13" isRemoveLineWhenBlank="true" uuid="82c2a4cc-07ca-4252-99c9-a497c7664c23">
<property name="com.jaspersoft.studio.unit.y" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<printWhenExpression><![CDATA[$F{count}==1]]></printWhenExpression>
</reportElement>
<text><![CDATA[]]></text>
</staticText>
<staticText>
<reportElement positionType="Float" x="1" y="43" width="270" height="31" isRemoveLineWhenBlank="true" uuid="c0fac058-23f1-47e2-a57b-f8d8111437d6">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<printWhenExpression><![CDATA[$F{text}!=null]]></printWhenExpression>
</reportElement>
<textElement verticalAlignment="Bottom">
<font fontName="SegoeUI" size="9" isItalic="true"/>
</textElement>
<text><![CDATA[Säkerheter till förmål för styrelse, vd mfl]]></text>
</staticText>
<textField isBlankWhenNull="true">
<reportElement positionType="Float" x="1" y="74" width="474" height="15" isRemoveLineWhenBlank="true" uuid="385ae7d5-4c0e-437e-b04c-64f925c275df">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<printWhenExpression><![CDATA[$F{text}!=null]]></printWhenExpression>
</reportElement>
<textElement verticalAlignment="Bottom">
<font fontName="SegoeUI" size="9"/>
</textElement>
<textFieldExpression><![CDATA[$F{text}]]></textFieldExpression>
</textField>
<frame>
<reportElement mode="Opaque" x="0" y="1" width="490" height="14" isRemoveLineWhenBlank="true" backcolor="#CCCCCC" uuid="2dd91d48-f783-422b-9a4c-956f93f62590">
<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"/>
<property name="com.jaspersoft.studio.unit.x" value="pixel"/>
<printWhenExpression><![CDATA[$F{count}==1]]></printWhenExpression>
</reportElement>
</frame>
<staticText>
<reportElement mode="Opaque" x="2" y="1" width="40" height="14" isRemoveLineWhenBlank="true" backcolor="#CCCCCC" uuid="d25eb93c-cf83-449b-8a64-b08b3662dfb7">
<property name="com.jaspersoft.studio.unit.y" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="pixel"/>
<printWhenExpression><![CDATA[$F{count}==1]]></printWhenExpression>
</reportElement>
<textElement verticalAlignment="Middle">
<font fontName="SegoeUI-SemiBold" size="9"/>
</textElement>
<text><![CDATA[Not]]></text>
</staticText>
<textField isBlankWhenNull="true">
<reportElement mode="Opaque" x="384" y="1" width="100" height="14" isRemoveLineWhenBlank="true" backcolor="#CCCCCC" uuid="442d41c6-ab53-4af4-a17c-e48f27a60bba">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="pixel"/>
<printWhenExpression><![CDATA[$F{count}==1]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="SegoeUI-SemiBold" size="9"/>
</textElement>
<textFieldExpression><![CDATA[$F{financialYearEndDate}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement mode="Opaque" x="29" y="1" width="40" height="14" isRemoveLineWhenBlank="true" backcolor="#CCCCCC" uuid="1b39f3a4-56a6-4b41-af03-01dbed404c68">
<property name="com.jaspersoft.studio.unit.y" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="pixel"/>
<printWhenExpression><![CDATA[$F{count}==1]]></printWhenExpression>
</reportElement>
<textElement verticalAlignment="Middle">
<font fontName="SegoeUI-SemiBold" size="9"/>
</textElement>
<textFieldExpression><![CDATA[$F{number}]]></textFieldExpression>
</textField>
<staticText>
<reportElement mode="Opaque" x="69" y="1" width="296" height="14" isRemoveLineWhenBlank="true" backcolor="#CCCCCC" uuid="8c1f2b48-7417-494b-9143-08145e05939f">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="pixel"/>
<printWhenExpression><![CDATA[$F{count}==1]]></printWhenExpression>
</reportElement>
<textElement verticalAlignment="Middle">
<font fontName="SegoeUI-SemiBold" size="9"/>
</textElement>
<text><![CDATA[Ställda säkerheter]]></text>
</staticText>
</frame>
</band>
</detail>
</jasperReport>
Put that particual content in separate details section and set the split type as prevent for that detail section.

Jasper SubReport doesnt' show in Master

I asked a similar question a year ago and didn't discover a resolution. The subreport I am working on now is in the detail band of the master, although I did try it in others just in case.
<detail>
<band height="34" splitType="Stretch">
<subreport>
<reportElement stretchType="RelativeToTallestObject" isPrintRepeatedValues="false" mode="Transparent" x="0" y="0" width="555" height="34" uuid="6318f4b9-c420-4294-a63f-1a83d338f755">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<subreportParameter name="item_id">
<subreportParameterExpression><![CDATA[$F{item_id}]]></subreportParameterExpression>
</subreportParameter>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression><![CDATA["report.jasper"]]></subreportExpression>
</subreport>
</band>
</detail>
I checked the path to the subreport is correct. In the subreport the parameter_name is exactly the same. The .jasper file is compiled successfully.
The master report has a call to a stored procedure, and I am using one of the fields it is returning as the subreport parameter. I called it 'item_id' here. I used the wizard to map that to the subreport parameter with the same name. The idea is that the subreport should return additional information about each of the item_ids returned by the SP in the master report.
When I run the subreport on it's own it returns data for a particular item_id. I created a variable in the master to track how many rows the SP itself returns and when I run the master it shows the correct number of rows exist but no data displays on the master report. It also leaves enough empty space to appear to indicate that something is being returned but just not displayed. When I set 'remove line when blank' for the subreport element in properties from the master report I get no rows - so apparently it is returning a blank line 44 times - one for each row. Or is it?
One suggestion was to remove the connection_expression and replace it with parameters_map_expression but that didn't help either.
My best guess is that the subreport data is not getting to the master for some reason. If anyone has any suggestions I am open to anything I can do with JasperSoftStudio 6.3.
Master report:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 5.6.2.final using JasperReports Library version 5.6.1 -->
<!-- 2016-09-07T10:21:37 -->
<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="ITEMMRPT" language="groovy" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="1aa96e89-cb24-464e-90bf-0d12bc48a516">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="staging"/>
<parameter name="billing_year" class="java.lang.Integer">
<defaultValueExpression><![CDATA[2015]]></defaultValueExpression>
</parameter>
<parameter name="billing_month" class="java.lang.Integer">
<defaultValueExpression><![CDATA[9]]></defaultValueExpression>
</parameter>
<parameter name="billing_day" class="java.lang.Integer">
<defaultValueExpression><![CDATA[1]]></defaultValueExpression>
</parameter>
<parameter name="report_type" class="java.lang.String">
<defaultValueExpression><![CDATA["DAILY"]]></defaultValueExpression>
</parameter>
<parameter name="area_cd" class="java.lang.String">
<defaultValueExpression><![CDATA["TACM"]]></defaultValueExpression>
</parameter>
<queryString language="SQL">
<![CDATA[exec createitembillingReport;1 #billing_year = $P{billing_year}, #billing_month = $P{billing_month}, #billing_day = $P{billing_day},#report_type=$P{report_type},#area_cd = $P{area_cd}]]>
</queryString>
<field name="item_id" class="java.lang.String"/>
<field name="item_name" class="java.lang.String"/>
<variable name="total" class="java.lang.Integer" calculation="Count">
<variableExpression><![CDATA[$F{item_id}]]></variableExpression>
</variable>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="67">
<staticText>
<reportElement x="60" y="33" width="242" height="17" uuid="06a14aaf-07b9-4894-bc60-0f5b3b254826">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement>
<font size="11"/>
</textElement>
<text><![CDATA[Item Listing]]></text>
</staticText>
<staticText>
<reportElement x="60" y="50" width="78" height="17" uuid="365238e1-9e5f-471b-92aa-aadab4fcfc31">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement>
<font size="11" isBold="true"/>
</textElement>
<text><![CDATA[Billable as of :]]></text>
</staticText>
<textField>
<reportElement x="138" y="50" width="180" height="17" uuid="c735ec59-4e96-4b22-bf70-08af130efed9"/>
<textElement>
<font size="11" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{billing_month}+"/"+$P{billing_day}+"/"+$P{billing_year}]]></textFieldExpression>
</textField>
</band>
</title>
<columnHeader>
<band height="18">
<staticText>
<reportElement x="16" y="0" width="70" height="17" uuid="79476ab9-e5ea-40ec-b382-b22a0c5d355a">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement>
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Item ID]]></text>
</staticText>
<staticText>
<reportElement x="479" y="0" width="61" height="17" uuid="adb588f3-ed71-439a-acde-d812acee6a94">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement>
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Location]]></text>
</staticText>
<staticText>
<reportElement x="260" y="0" width="97" height="17" uuid="243ce68e-c532-4056-958e-08f7a0f83d2a">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement>
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Pull Date]]></text>
</staticText>
<staticText>
<reportElement x="89" y="0" width="87" height="17" uuid="ca299eb7-2aba-4529-ae76-3dfa4c6abe29">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement>
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Order Date]]></text>
</staticText>
<staticText>
<reportElement x="380" y="0" width="86" height="17" uuid="c220e72b-bd29-416a-95fc-c6c8a10ab081">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement>
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Ship Date]]></text>
</staticText>
<staticText>
<reportElement x="168" y="0" width="92" height="17" uuid="2ea414c5-4484-48dc-a6b5-52d4ab3ebd97">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement>
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Description]]></text>
</staticText>
<line>
<reportElement x="0" y="17" width="555" height="1" uuid="ab7d193f-96d3-454a-8fdd-5e0027425d42">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
</line>
</band>
</columnHeader>
<detail>
<band height="20" splitType="Stretch">
<subreport>
<reportElement isPrintRepeatedValues="false" mode="Transparent" x="0" y="4" width="555" height="16" uuid="6318f4b9-c420-4294-a63f-1a83d338f755">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<subreportParameter name="item_id">
<subreportParameterExpression><![CDATA[$F{item_id}]]></subreportParameterExpression>
</subreportParameter>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression><![CDATA["report.jasper"]]></subreportExpression>
</subreport>
<textField>
<reportElement x="10" y="-1" width="100" height="16" uuid="91285585-7366-46c3-b248-9dbaf0c80839"/>
<textFieldExpression><![CDATA[$F{item_id}]]></textFieldExpression>
</textField>
</band>
</detail>
<pageFooter>
<band height="15">
<textField>
<reportElement x="110" y="0" width="100" height="15" uuid="54e9321a-c062-49f4-8b32-02f4c41458c0"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA["Page " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement x="210" y="0" width="100" height="15" uuid="00b215e9-ba28-413b-ad44-4c4a3aac7fdd"/>
<textElement textAlignment="Left"/>
<textFieldExpression><![CDATA[" of " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="400" y="-1" width="50" height="15" uuid="0dae2a30-28fe-4a71-9dc9-ec906ec05c78"/>
<text><![CDATA[Run Date :]]></text>
</staticText>
<textField pattern="MMMMM dd, yyyy">
<reportElement x="450" y="1" width="100" height="13" uuid="34cfa033-e43d-4668-852d-3019f322ea5a"/>
<textFieldExpression><![CDATA[new SimpleDateFormat("MMM dd, yyyy").format(TODAY())]]></textFieldExpression>
</textField>
</band>
</pageFooter>
<summary>
<band height="18">
<textField>
<reportElement x="120" y="2" width="50" height="16" uuid="4a336320-9341-42dd-98c4-1cec2c2d6a15"/>
<textFieldExpression><![CDATA[$V{total}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="10" y="2" width="100" height="13" uuid="00887a5b-9421-402b-98b8-b041f08959f0">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<text><![CDATA[Total Items]]></text>
</staticText>
</band>
</summary>
Subreport:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 5.6.2.final using JasperReports Library version 5.6.1 -->
<!-- 2016-09-07T10:37:50 -->
<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="report" pageWidth="555" pageHeight="802" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="9014add6-11f0-4647-97ec-9b9f3f78afce">
<parameter name="item_id" class="java.lang.String" isForPrompting="false"/>
<queryString language="SQL">
<![CDATA[select b.item_id,
b.order_dt,
cpnv.item_desc,
cpnv.pull_dt,
b.ship_dt,
location = (select bjc.location_cd
from warehouse_location bjc
where bjc.item = b.item_id
and bjc.location_start_dt =
(select max(location_start_dt)
from warehouse_location
where item_id = b.item_id))
from item_names cpnv
join items b
ON cpnv.sub_id = b.sub_id
where (ship_dt is null or ship_dt >= '1-24-16 22:00')
and b.item_id = $P{item_id}]]>
</queryString>
<field name="item_id" class="java.lang.String"/>
<field name="order_dt" class="java.sql.Timestamp"/>
<field name="item_desc" class="java.lang.String"/>
<field name="pull_dt" class="java.sql.Timestamp"/>
<field name="ship_dt" class="java.sql.Timestamp"/>
<field name="location" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<detail>
<band height="41" splitType="Stretch">
<textField isStretchWithOverflow="true" evaluationTime="Band" isBlankWhenNull="false">
<reportElement x="9" y="11" width="67" height="20" isPrintWhenDetailOverflows="true" uuid="12d147f8-532b-4ed5-a249-e03661099e4f">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$F{item_id}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" evaluationTime="Band" isBlankWhenNull="false">
<reportElement x="89" y="11" width="78" height="20" isPrintWhenDetailOverflows="true" uuid="76ea3e37-9b7a-44e3-a1ae-5850072b90ef">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[new SimpleDateFormat("MM/dd/yy hh:mm").format($F{order_dt})]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" evaluationTime="Band" isBlankWhenNull="false">
<reportElement x="168" y="11" width="156" height="20" isPrintWhenDetailOverflows="true" uuid="9ab7bd73-e633-4d51-8271-00c673750a38">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$F{item_desc}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" evaluationTime="Band" isBlankWhenNull="false">
<reportElement x="326" y="11" width="48" height="20" isPrintWhenDetailOverflows="true" uuid="b0ac4ef7-e951-4fb2-ab80-3b6dc3103764">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[new SimpleDateFormat("MM/dd/yy").format($F{pull_dt})]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" evaluationTime="Band" isBlankWhenNull="false">
<reportElement x="380" y="11" width="69" height="20" isPrintWhenDetailOverflows="true" uuid="83cb0048-4b23-42a9-a48d-63501a9f242d">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[new SimpleDateFormat("MM/dd/yy hh:mm").format($F{ship_dt})]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" evaluationTime="Band" isBlankWhenNull="false">
<reportElement x="479" y="11" width="54" height="20" isPrintWhenDetailOverflows="true" uuid="67a5bd0d-cd6d-4910-83d0-396fc36781d3">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$F{location}]]></textFieldExpression>
</textField>
</band>
</detail>
I changed some of the names of things for proprietary reasons. Hopefully they are consistent. If something doesn't jive it was probably lost in translation.
As noted the query works fine in the subreport. When i give it one of the item_ids from the procedure in the master report it displays all the fields correctly for that item. It just won't come through to the master report.
You could try to print the subreport parameter $P{item_id} in the title band of the subreport to check if the parameter passing works correctly.
Depending on the height of the main reports detail band, Maybe you have to remove the top and bottom margin of the subreport.