2006 IR Open Dicussion Posted August 27, 2006 Share Posted August 27, 2006 By: Brad Balmer - bbalmer Error evaluating expression 2006-06-20 07:12I'm attempting to include my first subreport and am running into a problem. In the the master report I'm passing a Map of data. Based on the id, I want to use the value from the map as the data for the subreport. The error I'm receiving is: Error evaluating expression : Source text : $P{WEEK_STATUS_DTL_DATA}.get($F{id}) Any help woulld be GREATLY appreciated. Thanks. WEEK_STATUS_DTL_DATA is a Map and id is a value (if I remove the subreport the report runs fine and displays the id for each line.) Master Report: <?xml version="1.0" encoding="UTF-8"?> <!-- Created using JasperAssistant (http://www.jasperassistant.com) --> <!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="weekStatusHdr" pageWidth="791" pageHeight="612" orientation="Landscape" whenNoDataType="AllSectionsNoDetail" columnWidth="771" leftMargin="10" rightMargin="10" topMargin="10" bottomMargin="10"> <property name="com.jasperassistant.designer.Grid" value="true" /> <property name="com.jasperassistant.designer.SnapToGrid" value="true" /> <property name="com.jasperassistant.designer.GridWidth" value="4" /> <property name="com.jasperassistant.designer.GridHeight" value="4" /> <property name="com.jasperassistant.designer.Margins" value="true" /> <property name="com.jasperassistant.designer.Rulers" value="true" /> <property name="com.jasperassistant.designer.SnapToGuides" value="true" /> <property name="com.jasperassistant.designer.DataSource" value="WebPromoHdr" /> <property name="com.jasperassistant.designer.VGuides.Column Header" value="3,6" /> <reportFont name="Header" isDefault="false" fontName="Times New Roman" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Times-Bold" pdfEncoding="Cp1252" isPdfEmbedded="true" /> <reportFont name="Detail" isDefault="false" fontName="Times New Roman" size="9" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Times-Roman" pdfEncoding="Cp1252" isPdfEmbedded="true" /> <parameter name="pitPromWeek" class="com.peapod.newton.model.PitPromWeek"> <defaultValueExpression> <![CDATA[new com.peapod.newton.model.PitPromWeek()]]> </defaultValueExpression> </parameter> <parameter name="WEEK_STATUS_DTL_DATA" class="java.util.HashMap" /> <parameter name="WEEK_STATUS_DTL_RPT" class="net.sf.jasperreports.engine.JasperReport" /> <field name="id" class="java.lang.Integer" /> <field name="pitPromHdr" class="app.web.promo.model.PitPromHdr" /> <field name="weekErr" class="app.web.promo.model.dto.WeekErr" /> <title> <band height="65"> <staticText> <reportElement x="4" y="4" width="765" height="37" /> <textElement textAlignment="Center" verticalAlignment="Middle"> <font fontName="Times New Roman" size="26" /> </textElement> <text> <![CDATA[Promotion Week Status]]> </text> </staticText> <textField> <reportElement x="8" y="40" width="761" height="21" /> <textElement textAlignment="Center" verticalAlignment="Middle"> <font fontName="Times New Roman" size="14" /> </textElement> <textFieldExpression class="java.lang.String"> <![CDATA[$P{pitPromWeek}.getWeekLongDescription() + " - " + $P{pitPromWeek}.getCurrStatCd()]]> </textFieldExpression> </textField> <line> <reportElement x="4" y="64" width="765" height="1" /> <graphicElement /> </line> </band> </title> <columnHeader> <band height="21"> <staticText> <reportElement x="12" y="8" width="29" height="13" /> <textElement textAlignment="Center" verticalAlignment="Middle"> <font reportFont="Header" fontName="Times New Roman" isBold="true" isUnderline="false" isPdfEmbedded="false" /> </textElement> <text> <![CDATA[Prom ID]]> </text> </staticText> <staticText> <reportElement x="40" y="8" width="169" height="13" /> <textElement textAlignment="Center" verticalAlignment="Middle"> <font reportFont="Header" fontName="Times New Roman" isBold="true" isUnderline="false" isPdfEmbedded="false" /> </textElement> <text> <![CDATA[Description]]> </text> </staticText> <staticText> <reportElement x="220" y="8" width="49" height="13" /> <textElement textAlignment="Center" verticalAlignment="Middle"> <font reportFont="Header" fontName="Times New Roman" isBold="true" isUnderline="false" isPdfEmbedded="false" /> </textElement> <text> <![CDATA[sale Type]]> </text> </staticText> <staticText> <reportElement x="276" y="8" width="53" height="13" /> <textElement textAlignment="Center" verticalAlignment="Middle"> <font reportFont="Header" fontName="Times New Roman" isBold="true" isUnderline="false" isPdfEmbedded="false" /> </textElement> <text> <![CDATA[Prom Type]]> </text> </staticText> <staticText> <reportElement x="392" y="8" width="169" height="13" /> <textElement textAlignment="Center" verticalAlignment="Middle"> <font reportFont="Header" fontName="Times New Roman" isBold="true" isUnderline="false" isPdfEmbedded="false" /> </textElement> <text> <![CDATA[issue]]> </text> </staticText> <staticText> <reportElement x="584" y="8" width="169" height="13" /> <textElement textAlignment="Center" verticalAlignment="Middle"> <font reportFont="Header" fontName="Times New Roman" isBold="true" isUnderline="false" isPdfEmbedded="false" /> </textElement> <text> <![CDATA[Detail]]> </text> </staticText> <line> <reportElement x="4" y="20" width="765" height="1" /> <graphicElement /> </line> <staticText> <reportElement x="336" y="8" width="53" height="13" /> <textElement textAlignment="Center" verticalAlignment="Middle"> <font reportFont="Header" fontName="Times New Roman" isBold="true" isUnderline="false" isPdfEmbedded="false" /> </textElement> <text> <![CDATA[ignorable?]]> </text> </staticText> </band> </columnHeader> <detail> <band height="20"> <textField> <reportElement x="12" y="4" width="29" height="13" /> <textElement textAlignment="Left" verticalAlignment="Middle"> <font reportFont="Detail" fontName="Times New Roman" /> </textElement> <textFieldExpression class="java.lang.String"> <![CDATA[integer.toString($F{pitPromHdr}.getPromId())]]> </textFieldExpression> </textField> <textField isStretchWithOverflow="true"> <reportElement x="40" y="5" width="169" height="12" /> <textElement textAlignment="Left" verticalAlignment="Middle"> <font reportFont="Detail" fontName="Times New Roman" /> </textElement> <textFieldExpression class="java.lang.String"> <![CDATA[$F{pitPromHdr}.getPromDescTx()]]> </textFieldExpression> </textField> <textField isBlankWhenNull="true"> <reportElement x="220" y="5" width="49" height="13" /> <textElement textAlignment="Left" verticalAlignment="Middle"> <font reportFont="Detail" fontName="Times New Roman" /> </textElement> <textFieldExpression class="java.lang.String"> <![CDATA[$F{pitPromHdr}.getSaleTypeCd()]]> </textFieldExpression> </textField> <textField isBlankWhenNull="true"> <reportElement x="276" y="4" width="53" height="13" /> <textElement textAlignment="Left" verticalAlignment="Middle"> <font reportFont="Detail" fontName="Times New Roman" /> </textElement> <textFieldExpression class="java.lang.String"> <![CDATA[$F{pitPromHdr}.getPromTypeCd()]]> </textFieldExpression> </textField> <textField isStretchWithOverflow="true"> <reportElement x="392" y="4" width="169" height="13" /> <textElement textAlignment="Left" verticalAlignment="Middle"> <font reportFont="Detail" fontName="Times New Roman" /> </textElement> <textFieldExpression class="java.lang.String"> <![CDATA[$F{weekErr}.getErrTx()]]> </textFieldExpression> </textField> <rectangle> <reportElement x="0" y="8" width="9" height="9" /> <graphicElement /> </rectangle> <textField> <reportElement x="337" y="4" width="52" height="13" /> <textElement textAlignment="Center" verticalAlignment="Middle"> <font reportFont="Detail" /> </textElement> <textFieldExpression class="java.lang.String"> <![CDATA[$F{weekErr}.getIgnrCd()]]> </textFieldExpression> </textField> <textField> <reportElement x="564" y="4" width="13" height="13" /> <textElement textAlignment="Right"> <font reportFont="Detail" /> </textElement> <textFieldExpression class="java.lang.Integer"> <![CDATA[$F{id}]]> </textFieldExpression> </textField> <subreport> <reportElement x="584" y="3" width="185" height="14" /> <subreportParameter name="id"> <subreportParameterExpression> <![CDATA[$P{WEEK_STATUS_DTL_DATA}.get($F{id})]]> </subreportParameterExpression> </subreportParameter> <dataSourceExpression> <![CDATA[$P{WEEK_STATUS_DTL_DATA}.get($F{id})]]> </dataSourceExpression> <subreportExpression class="net.sf.jasperreports.engine.JasperReport"> <![CDATA[$P{WEEK_STATUS_DTL_RPT}]]> </subreportExpression> </subreport> </band> </detail> <pageFooter> <band height="16"> <textField pattern="M/d/yy h:mm:ss a"> <reportElement x="0" y="4" width="161" height="12" /> <textElement textAlignment="Left" verticalAlignment="Middle"> <font reportFont="Header" fontName="Times New Roman" /> </textElement> <textFieldExpression class="java.util.Date"> <![CDATA[new Date()]]> </textFieldExpression> </textField> <textField> <reportElement x="662" y="4" width="85" height="12" /> <textElement textAlignment="Right" verticalAlignment="Middle"> <font reportFont="Header" /> </textElement> <textFieldExpression class="java.lang.String"> <![CDATA["Page " +$V{PAGE_NUMBER}.toString() + " of "]]> </textFieldExpression> </textField> <textField evaluationTime="Report"> <reportElement x="748" y="4" width="22" height="12" /> <textElement verticalAlignment="Middle"> <font reportFont="Header" /> </textElement> <textFieldExpression class="java.lang.Integer"> <![CDATA[$V{PAGE_NUMBER}]]> </textFieldExpression> </textField> <line> <reportElement x="0" y="3" width="770" height="1" /> <graphicElement /> </line> </band> </pageFooter> </jasperReport> Detail Report: <?xml version="1.0" encoding="UTF-8"?> <!-- Created using JasperAssistant (http://www.jasperassistant.com) --> <!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="weekStatusDtl" pageWidth="612" pageHeight="791" whenNoDataType="BlankPage" columnWidth="612" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0"> <property name="com.jasperassistant.designer.DataSource" value="WebPromoDtl"/> <property name="com.jasperassistant.designer.Grid" value="true"/> <property name="com.jasperassistant.designer.SnapToGrid" value="false"/> <property name="com.jasperassistant.designer.GridWidth" value="4"/> <property name="com.jasperassistant.designer.GridHeight" value="4"/> <property name="com.jasperassistant.designer.Margins" value="true"/> <property name="com.jasperassistant.designer.Rulers" value="true"/> <property name="com.jasperassistant.designer.SnapToGuides" value="true"/> <reportFont name="DtlErr" isDefault="false" fontName="Times New Roman" size="9" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Times-Roman" pdfEncoding="Cp1252" isPdfEmbedded="true"/> <field name="dtlErrTx" class="java.lang.String"/> <field name="dtlId" class="java.lang.Integer"/> <field name="promLvlCd" class="java.lang.String"/> <detail> <band height="22"> <textField isStretchWithOverflow="true" isBlankWhenNull="true"> <reportElement x="2" y="2" width="606" height="20"/> <textElement> <font reportFont="DtlErr"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{dtlErrTx}]]></textFieldExpression> </textField> </band> </detail> </jasperReport> 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