cesare.brizio Posted April 11, 2007 Share Posted April 11, 2007 In the detail band of my report, I have to display a substring extracted from a string field.The field $F{GIO} is always displayed and printed, my substring variable TRENTASEIESIMO_CAR, with an expression like:$F{GIO}.substring(36,36)is never displayed, no matter how I set the available options (like reset group and the such). I tried to put it in different bands like group and report footer - to no avail, it gets NEVER displayed, contrary to other variables I defined containing group totals, that work fine. Why this particular detail substring semems not to work?What did I miss?? Thank you very much Cesare Brizio ====================================variable declaration====================================<variable name="TRENTASEIESIMO_CAR" class="java.lang.String" resetType="None" calculation="Nothing"><variableExpression><![CDATA[$F{GIO}.substring(36,36)]]></variableExpression><initialValueExpression><![CDATA[$F{GIO}.substring(36,36)]]></initialValueExpression></variable> ====================================textfield tag in the detail section==================================== <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" ><reportElementx="97"y="82"width="65"height="18"forecolor="#000000"backcolor="#FFFFFF"key="textField-1"/><box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/><textElement textAlignment="Left" verticalAlignment="Middle"><font fontName="Arial Narrow" pdfFontName="Helvetica" size="8" isBold="false" pdfEncoding ="Cp1252"/></textElement><textFieldExpression class="java.lang.String"><![CDATA[$V{TRENTASEIESIMO_CAR}]]></textFieldExpression></textField> Link to comment Share on other sites More sharing options...
kaunietiss Posted April 11, 2007 Share Posted April 11, 2007 $F{GIO}.substring(36,36) the lenght of this substring is 0. Try $F{GIO}.substring(36,37) Link to comment Share on other sites More sharing options...
cesare.brizio Posted April 11, 2007 Author Share Posted April 11, 2007 You were right in saying that I was extracting 0 characters - I should be very ashamed!!! It's the first time ever that I use java, pardon me and many many thanks. Cesare Brizio 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