arnyo911 Posted April 30, 2020 Share Posted April 30, 2020 Hello, I have a report with a table into a subReport, I try to remove some columns if it's necessary, but the variable didn't find, <jr:column width="66" uuid="cdbf56d1-49b3-4bc7-9100-4147e1942eaa"> <property name="com.jaspersoft.studio.components.table.model.column.name" value="Colonne8"/> <printWhenExpression><![CDATA[$F{myFieldMap}.containsKey( "x1" )]]></printWhenExpression> <jr:columnHeader style="Table_TH" height="30" rowSpan="1"> <staticText> <reportElement x="0" y="0" width="66" height="30" uuid="9f0a82df-9776-4f43-813f-07da5cc852f5"/> <textElement textAlignment="Center" verticalAlignment="Middle"/> <text><![CDATA[X1]]></text> </staticText> </jr:columnHeader> <jr:columnFooter style="Table_CH" height="30" rowSpan="1"> <textField> <reportElement x="0" y="0" width="66" height="30" uuid="3c953992-5d30-48fa-86cd-4e2850b34937"/> <textElement textAlignment="Center" verticalAlignment="Middle"/> <textFieldExpression><![CDATA[$F{myFieldMap}.get("x1")]]></textFieldExpression> </textField> </jr:columnFooter> <jr:detailCell style="Table_TD" height="30"> <textField> <reportElement x="0" y="0" width="66" height="30" uuid="adf5155c-305d-4f11-842c-a2f2912c114e"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="8"/> </textElement> <textFieldExpression><![CDATA[$F{myFieldMap}.get("x1")]]></textFieldExpression> </textField> </jr:detailCell> </jr:column>with "<textFieldExpression><![CDATA[$F{myFieldMap}.get("x1")]]></textFieldExpression> " : I have no problem but with the "<printWhenExpression><![CDATA[$F{myFieldMap}.containsKey( "x1" )]]></printWhenExpression>", I have the following error : net.sf.jasperreports.engine.design.JRValidationException: Report design not valid : 1. Field not found : myFieldMap at net.sf.jasperreports.engine.design.JRAbstractCompiler.verifyDesign(JRAbstractCompiler.java:280) at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:152) Thanks And Regards ;) Link to comment Share on other sites More sharing options...
I am Leo Posted May 7, 2020 Share Posted May 7, 2020 You haven't defined this field yet. That is the reason why your report can not find your field. 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