p1461591 Posted June 6, 2017 Share Posted June 6, 2017 Hey Guys,i have a Masterreport wich gets his Data through a JavaBean (Collection) . Same with my Subreport. When i create static textFields in my Subreport, they got perfectly displayed in the Masterreport. But when i try to use fields (parameters) like name, number and so on, all of them getting a null value if i start my Masterreport, but when i start my subreport the show like they should.Here is my XML from the Masterreport:..insert your code<?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.3.1.final using JasperReports Library version 6.3.1 --><!-- 2017-06-06T10:05:11 --><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="MasterReport" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" whenResourceMissingType="Empty" uuid="05b90855-70c1-42bf-b39b-d791fc94d01b"> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="src/dataset1.xml"/> <queryString> <![CDATA[]]> </queryString> <field name="reportName" class="java.lang.String"> <fieldDescription><![CDATA[reportName]]></fieldDescription> </field> <field name="workdirectory" class="java.lang.String"> <fieldDescription><![CDATA[workdirectory]]></fieldDescription> </field> <field name="konectorStatus" class="java.lang.String"> <fieldDescription><![CDATA[konectorStatus]]></fieldDescription> </field> <field name="connectionStatus" class="java.lang.String"> <fieldDescription><![CDATA[connectionStatus]]></fieldDescription> </field> <field name="stuckedCard" class="java.lang.String"> <fieldDescription><![CDATA[stuckedCard]]></fieldDescription> </field> <field name="description" class="java.lang.String"> <fieldDescription><![CDATA[description]]></fieldDescription> </field> <field name="testSteps" class="java.util.List"> <fieldDescription><![CDATA[testSteps]]></fieldDescription> </field> <field name="shortDescription" class="java.lang.String"> <fieldDescription><![CDATA[shortDescription]]></fieldDescription> </field> <field name="testResult" class="java.lang.String"> <fieldDescription><![CDATA[testResult]]></fieldDescription> </field> <field name="class" class="java.lang.Class"> <fieldDescription><![CDATA[class]]></fieldDescription> </field> <field name="authentication" class="java.lang.String"> <fieldDescription><![CDATA[authentication]]></fieldDescription> </field> <field name="steps" class="java.util.ArrayList"> <fieldDescription><![CDATA[steps]]></fieldDescription> </field> <variable name="Subreport_Reps" class="java.lang.Integer"/> <background> <band splitType="Stretch"/> </background> <title> <band height="79" splitType="Stretch"> <staticText> <reportElement x="0" y="0" width="400" height="30" uuid="14526df0-5139-4b43-8480-bdff9f7a6473"/> <textElement> <font size="16" isBold="false"/> </textElement> <text><![CDATA[Konnektorsimmulator Testfall Protokoll: ]]></text> </staticText> <textField> <reportElement x="0" y="30" width="553" height="30" uuid="66ad908b-3b5e-47db-bed0-be369b5a42bf"/> <textElement> <font size="14" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$F{reportName}]]></textFieldExpression> </textField> <line> <reportElement positionType="FixRelativeToBottom" x="0" y="70" width="551" height="1" uuid="eab62835-b5ff-4058-838a-f54ff27ed5f5"/> </line> <image> <reportElement x="400" y="-5" width="153" height="65" uuid="863524c1-809d-4571-8679-184a26d07612"/> <imageExpression><![CDATA["/home/r4ff1/Dropbox/Arbeit/image.2UJ5YY.png"]]></imageExpression> </image> </band> </title> <detail> <band height="281" splitType="Stretch"> <textField> <reportElement x="102" y="70" width="449" height="40" uuid="4b59780d-be91-4bba-8db2-0612276959d1"/> <textFieldExpression><![CDATA[$F{description}]]></textFieldExpression> </textField> <textField> <reportElement x="200" y="120" width="353" height="31" uuid="cb189914-510e-474e-8061-091947731153"/> <textFieldExpression><![CDATA[$F{konectorStatus}]]></textFieldExpression> </textField> <line> <reportElement positionType="FixRelativeToBottom" x="2" y="280" width="551" height="1" uuid="d3daea99-635b-4589-b870-b5ca98f2a8ea"/> </line> <staticText> <reportElement x="0" y="7" width="100" height="30" uuid="6b1202e5-9a2d-4419-ae63-f1ba228bbc79"/> <text><![CDATA[Name]]></text> </staticText> <textField> <reportElement x="200" y="210" width="351" height="30" uuid="99806143-5e32-4a3c-9df1-44a66d42e3ba"/> <textFieldExpression><![CDATA[$F{workdirectory}]]></textFieldExpression> </textField> <staticText> <reportElement x="100" y="120" width="100" height="30" uuid="4f079a28-774e-499e-98cb-51fa00e4aef3"/> <text><![CDATA[Konnektor Status: ]]></text> </staticText> <staticText> <reportElement x="100" y="180" width="100" height="30" uuid="98ea438b-ae71-4cff-94ae-73b2eacef337"/> <text><![CDATA[Authentifizierung: ]]></text> </staticText> <staticText> <reportElement x="2" y="70" width="100" height="30" uuid="d2070b01-f44d-4f9a-a4ae-d7a1a35414db"/> <text><![CDATA[beschreibung:]]></text> </staticText> <textField> <reportElement x="390" y="240" width="161" height="30" uuid="4462a8e6-602a-4467-b8ad-8abbc743ce07"/> <textFieldExpression><![CDATA[$F{stuckedCard}]]></textFieldExpression> </textField> <staticText> <reportElement x="100" y="210" width="100" height="30" uuid="1e9ea53e-a3b7-4388-8841-b091de8906a6"/> <text><![CDATA[Dienstverzeichnis]]></text> </staticText> <staticText> <reportElement x="100" y="150" width="100" height="30" uuid="6b440e1e-9db4-4ab8-a1ab-aa11feea4363"/> <text><![CDATA[Verbindungsstatus: ]]></text> </staticText> <staticText> <reportElement x="0" y="121" width="100" height="30" uuid="adfc9883-0b2f-46dd-b05c-e47921e54dbe"/> <text><![CDATA[Eingangsdaten: ]]></text> </staticText> <textField> <reportElement x="200" y="180" width="351" height="30" uuid="72655912-a589-4bd1-8a74-6b0e38d3b526"/> <textFieldExpression><![CDATA[$F{authentication}]]></textFieldExpression> </textField> <staticText> <reportElement x="2" y="37" width="100" height="30" uuid="bbc94511-d090-4546-b306-65cedea561d4"/> <text><![CDATA[Kurzbeschreibung:]]></text> </staticText> <staticText> <reportElement x="102" y="240" width="288" height="30" uuid="daaf24e8-308b-4f0d-842e-f73317ca737c"/> <textElement> <font isBold="true"/> </textElement> <text><![CDATA[Gesteckte Karten(Mandat > Terminal < Karte): ]]></text> </staticText> <textField> <reportElement x="100" y="7" width="453" height="30" uuid="55a63fef-c00b-43a8-8fb8-122563ca8ed4"/> <textElement> <font size="12" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$F{reportName}]]></textFieldExpression> </textField> <textField> <reportElement x="200" y="150" width="351" height="30" uuid="a6e317cc-b6af-44db-aa1c-72e36e604d2f"/> <textFieldExpression><![CDATA[$F{connectionStatus}]]></textFieldExpression> </textField> <textField> <reportElement x="100" y="37" width="453" height="33" uuid="b9f07c20-decf-4e7e-bae6-7f9594daf7e0"/> <textFieldExpression><![CDATA[$F{shortDescription}]]></textFieldExpression> </textField> </band> <band height="470"> <subreport> <reportElement x="10" y="50" width="510" height="410" uuid="12e112e6-b5ec-4335-afaa-e6521a823ff6"/> <subreportParameter name="stuckedCard"> <subreportParameterExpression><![CDATA[$F{stuckedCard}]]></subreportParameterExpression> </subreportParameter> <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.JREmptyDataSource()]]></dataSourceExpression> <subreportExpression><![CDATA["Report_1.jasper"]]></subreportExpression> </subreport> </band> <band height="455"> <textField> <reportElement x="120" y="90" width="198" height="74" uuid="034d2903-bc61-4ba1-84ae-dbe02b6bac8f"/> <textFieldExpression><![CDATA[$F{steps}]]></textFieldExpression> </textField> <staticText> <reportElement x="20" y="90" width="100" height="30" uuid="ae4f7530-013b-41dd-b4b1-9ccd8e28f880"/> <text><![CDATA[steps]]></text> </staticText> </band> </detail> <summary> <band height="42" splitType="Stretch"/> </summary></jasperReport> here..[/code]And here the XMl from my Subreport:..insert your code here<?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.3.1.final using JasperReports Library version 6.3.1 --><!-- 2017-06-06T09:17:52 --><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_1" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" isFloatColumnFooter="true" uuid="2f6e4db4-9f8f-4ffe-9759-6e1fd142f492"> <property name="template.type" value="columnar"/> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="src/dataset1.xml"/> <property name="net.sf.jasperreports.print.create.bookmarks" value="false"/> <style name="Title" forecolor="#000000" fontName="Times New Roman" fontSize="50" isBold="false"/> <style name="SubTitle" forecolor="#666666" fontName="Times New Roman" fontSize="18" isBold="false"/> <style name="Column header" forecolor="#666666" fontName="Times New Roman" fontSize="14" isBold="true"/> <style name="Detail" mode="Transparent" fontName="Times New Roman"/> <style name="Row" mode="Transparent" fontName="Times New Roman" pdfFontName="Times-Roman"> <conditionalStyle> <conditionExpression><![CDATA[$V{REPORT_COUNT}%2 == 0]]></conditionExpression> <style mode="Opaque" backcolor="#F0EFEF"/> </conditionalStyle> </style> <subDataset name="Dataset1" uuid="bcf9a7c3-f040-47c7-b8b0-ffdf33b6fd91"> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="src/dataset1.xml"/> <queryString> <![CDATA[]]> </queryString> </subDataset> <queryString> <![CDATA[]]> </queryString> <field name="reportName" class="java.lang.String"> <fieldDescription><![CDATA[reportName]]></fieldDescription> </field> <field name="workdirectory" class="java.lang.String"> <fieldDescription><![CDATA[workdirectory]]></fieldDescription> </field> <field name="konectorStatus" class="java.lang.String"> <fieldDescription><![CDATA[konectorStatus]]></fieldDescription> </field> <field name="connectionStatus" class="java.lang.String"> <fieldDescription><![CDATA[connectionStatus]]></fieldDescription> </field> <field name="stuckedCard" class="java.lang.String"> <fieldDescription><![CDATA[stuckedCard]]></fieldDescription> </field> <field name="description" class="java.lang.String"> <fieldDescription><![CDATA[description]]></fieldDescription> </field> <field name="testSteps" class="java.util.List"> <fieldDescription><![CDATA[testSteps]]></fieldDescription> </field> <field name="shortDescription" class="java.lang.String"> <fieldDescription><![CDATA[shortDescription]]></fieldDescription> </field> <field name="testResult" class="java.lang.String"> <fieldDescription><![CDATA[testResult]]></fieldDescription> </field> <field name="class" class="java.lang.Class"> <fieldDescription><![CDATA[class]]></fieldDescription> </field> <field name="authentication" class="java.lang.String"> <fieldDescription><![CDATA[authentication]]></fieldDescription> </field> <field name="readable" class="java.lang.Boolean"> <fieldDescription><![CDATA[readable]]></fieldDescription> </field> <field name="cardStucked" class="java.lang.Boolean"> <fieldDescription><![CDATA[cardStucked]]></fieldDescription> </field> <field name="actualSlot" class="java.util.ArrayList"> <fieldDescription><![CDATA[actualSlot]]></fieldDescription> </field> <field name="stuckedThisQuarter" class="java.lang.Boolean"> <fieldDescription><![CDATA[stuckedThisQuarter]]></fieldDescription> </field> <field name="errorMessage" class="java.lang.String"> <fieldDescription><![CDATA[errorMessage]]></fieldDescription> </field> <field name="checkUpdate" class="java.lang.Boolean"> <fieldDescription><![CDATA[checkUpdate]]></fieldDescription> </field> <field name="memberKnown" class="java.lang.Boolean"> <fieldDescription><![CDATA[memberKnown]]></fieldDescription> </field> <field name="memberData" class="java.util.ArrayList"> <fieldDescription><![CDATA[memberData]]></fieldDescription> </field> <field name="memberDataInconsistent" class="java.lang.Boolean"> <fieldDescription><![CDATA[memberDataInconsistent]]></fieldDescription> </field> <field name="action" class="java.lang.String"> <fieldDescription><![CDATA[action]]></fieldDescription> </field> <columnHeader> <band splitType="Stretch"/> </columnHeader> <detail> <band height="377"> <textField> <reportElement x="70" y="10" width="198" height="30" uuid="5e106c9e-09c0-4ba7-808d-314c7a656795"/> <textElement> <font size="14" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$F{action}]]></textFieldExpression> </textField> <textField> <reportElement x="100" y="310" width="435" height="67" uuid="c228a931-b5ad-4930-9a6f-025b7d62552c"/> <textFieldExpression><![CDATA[$F{testResult}]]></textFieldExpression> </textField> <staticText> <reportElement x="0" y="90" width="288" height="30" uuid="8532c474-1482-4c34-881d-ce4f3f98db7c"/> <textElement> <font isBold="true"/> </textElement> <text><![CDATA[Gesteckte Karten(Mandat > Terminal < Karte): ]]></text> </staticText> <textField> <reportElement x="100" y="150" width="100" height="30" uuid="c48f94c3-0ce8-4586-83de-408297fbca89"/> <textElement> <font size="12"/> </textElement> <textFieldExpression><![CDATA[$F{memberKnown}]]></textFieldExpression> </textField> <staticText> <reportElement x="0" y="240" width="100" height="30" uuid="0baf9c93-8dd6-4681-a1c6-5bd6f579a0a8"/> <textElement> <font isBold="true"/> </textElement> <text><![CDATA[Fehlernachricht]]></text> </staticText> <textField> <reportElement x="290" y="90" width="263" height="30" uuid="bbaa9d13-bde9-4588-8ba4-523b39350a9d"/> <textFieldExpression><![CDATA[$F{stuckedCard}]]></textFieldExpression> </textField> <staticText> <reportElement x="0" y="10" width="70" height="20" uuid="2f8cf0b0-ea31-4f61-9a4e-c29e57492688"/> <textElement> <font size="14" isBold="true"/> </textElement> <text><![CDATA[schritt:]]></text> </staticText> <staticText> <reportElement x="0" y="290" width="330" height="20" uuid="4c9f56a3-b18e-48ed-ba6e-f21034b2789a"/> <textElement> <font isBold="true"/> </textElement> <text><![CDATA[Prüfungsergebnis zu Schritt: ]]></text> </staticText> <staticText> <reportElement x="0" y="180" width="200" height="30" uuid="95db1771-0d13-41fe-896d-a0b36cb0fe1f"/> <textElement> <font isBold="true"/> </textElement> <text><![CDATA[Dieses Quartsl schon eingelesen:]]></text> </staticText> <textField> <reportElement x="82" y="120" width="100" height="30" uuid="cec11d4b-1cfa-40ac-82e0-1b9b53d925c0"/> <textElement> <font size="12"/> </textElement> <textFieldExpression><![CDATA[$F{readable}]]></textFieldExpression> </textField> <staticText> <reportElement x="0" y="50" width="551" height="40" uuid="54c38ce4-a8a4-4b41-998b-640763f0244d"/> <text><![CDATA[Das Primärsystem führt beim ersten Stecken der Karte im Quartal automatisch eine online-Prüfung und Aktualisierung der eGK durch. Update nötig: ]]></text> </staticText> <textField> <reportElement x="220" y="60" width="100" height="20" uuid="793ce7be-95cc-411c-b709-f465bb8dc3c0"/> <textElement> <font size="12" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$F{checkUpdate}]]></textFieldExpression> </textField> <staticText> <reportElement x="0" y="120" width="82" height="30" uuid="80358ec5-38fb-4e80-b2b4-5191c38a0625"/> <textElement> <font isBold="true"/> </textElement> <text><![CDATA[Karte lesbar: ]]></text> </staticText> <staticText> <reportElement x="0" y="150" width="100" height="30" uuid="f969a2e4-34c8-4450-9da3-10439ac60b68"/> <textElement> <font isBold="true"/> </textElement> <text><![CDATA[Mitglied bekannt: ]]></text> </staticText> <staticText> <reportElement x="0" y="210" width="100" height="30" uuid="3a52ec2b-7a82-478c-9250-27a8a3b0dd2c"/> <textElement> <font isBold="true"/> </textElement> <text><![CDATA[Mitgliedsdaten: ]]></text> </staticText> <textField> <reportElement x="100" y="210" width="100" height="30" uuid="f6d355a8-8091-4188-9dfb-471b56fddac5"/> <textFieldExpression><![CDATA[$F{memberData}]]></textFieldExpression> </textField> <textField> <reportElement x="200" y="180" width="100" height="30" uuid="7c6ee7f9-d515-4c01-afef-d9da7778ea98"/> <textElement> <font size="12"/> </textElement> <textFieldExpression><![CDATA[$F{stuckedThisQuarter}]]></textFieldExpression> </textField> <staticText> <reportElement x="0" y="310" width="100" height="30" uuid="7a979b58-5f14-4026-921c-507976972f35"/> <text><![CDATA[Testergebnise: ]]></text> </staticText> </band> </detail> <columnFooter> <band height="253" splitType="Stretch"> <frame> <reportElement mode="Opaque" x="-20" y="240" width="555" height="13" forecolor="#D0B48E" backcolor="#9DB1B8" uuid="bfdca178-800d-445c-9a31-bb616a00e8ce"/> <textField evaluationTime="Report"> <reportElement style="Column header" x="513" y="0" width="40" height="13" forecolor="#FFFFFF" uuid="2fba0f87-635e-476d-858f-d102b26146fe"/> <textElement verticalAlignment="Middle"> <font size="10" isBold="false"/> </textElement> <textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression> </textField> <textField> <reportElement style="Column header" mode="Transparent" x="433" y="0" width="80" height="13" forecolor="#FFFFFF" uuid="e454d23d-bcfc-4c79-a399-0ef520a3150a"/> <textElement textAlignment="Right" verticalAlignment="Middle"> <font size="10" isBold="false"/> </textElement> <textFieldExpression><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression> </textField> <textField pattern="EEEEE dd MMMMM yyyy"> <reportElement style="Column header" x="2" y="0" width="197" height="13" forecolor="#FFFFFF" uuid="14d8de1e-8695-4078-a67f-0e69172574d5"/> <textElement verticalAlignment="Middle"> <font size="10" isBold="false"/> </textElement> <textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression> </textField> </frame> </band> </columnFooter></jasperReport>..[/code]I hope that somebody have a solution.Thanks in advanceChristina Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now