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 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 wasy 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>
add another subreport that just prints a static text (no need to pass Datasource) and see if your server can handle that. This is to know if the problem is subreports as a whole or the datasource only.
I did that and it printed the text. I removed the data source expression and added the connection expression and it worked. So its probably the data source.
put some static text in the detail band of one of your subreports, near the dynamic text fields. Check if the static part is being printed, or nothing is printed at all.
Nothing is printed at all
put some static text in the "No data" band and set "When no data type" to "No Data Section". To check if some data is reaching the subreport
I added a static text in the subreport in the no data band with the "When No Data Type" to "No Data Section" and it printed the static text. Is there any other i can iterate a string/colection without using jrbean?
This means your subreport is getting no data from the datasource.