shravanthid Posted June 18, 2010 Share Posted June 18, 2010 Hello all,This might be simple but I am just not able to understand what is going wrong.I need to set a field name URL based on the value of the field account_id for each row in the report. The data for the report is set using JRBeanCollectionDataSource. URL field is not in this data set.To set the URL field I need to call the scriptlet which in turn will use some other classes and set the URL field.I am not able to figure out how to pass the account id value to the scriptlet.Following is how I have these fields in my jrxml file.<field name="account.actId" class="java.lang.Long"> </field><variable name="ImageGalleryURL" class="java.lang.String" calculation="System"> </variable>in the detail band: <textField isStretchWithOverflow="true"> <reportElement positionType="Float" x="0" y="0" width="100" height="15"/> <box leftPadding="10" rightPadding="10"> <leftPen lineWidth="0.5"/> <bottomPen lineWidth="0.5"/> </box> <textElement/> <textFieldExpression class="java.lang.Long"><![CDATA[$F{account.actId}]]></textFieldExpression> </textField><textField isStretchWithOverflow="true"> <reportElement positionType="Float" x="1405" y="0" width="100" height="15"/> <box leftPadding="10" rightPadding="10"> <leftPen lineWidth="0.5"/> <bottomPen lineWidth="0.5"/> </box> <textFieldExpression class="java.lang.String"><![CDATA[$V{ImageGalleryURL}]]></textFieldExpression> </textField>I am using the beforeDetailEval() in my scriptlet class. How do I pass the account.actId value for each row to the scriptlet class? Thanks Link to comment Share on other sites More sharing options...
lucianc Posted July 1, 2010 Share Posted July 1, 2010 You can fetch field values in the scriptlet by calling getFieldValue(fieldName).HTH,Lucian 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