Jump to content
We've recently updated our Privacy Statement, available here ×

gstephens

Members
  • Posts

    4
  • Joined

  • Last visited

gstephens's Achievements

Rookie

Rookie (2/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. I found an example of what jahp00 was referring to in the ShipmentsReport.jrxml sample included with iReport and it worked. Thanks. <textFieldExpression class="java.lang.String"><![CDATA[msg("{0,number,##0.0%}", new Float($V{cat_value}.floatValue() / $V{total_cat}.floatValue()))]]></textFieldExpression> Post Edited by gstephens at 10/18/2009 15:39
  2. total_cat (show above) is a variable I created to calculate the total. cat_PCT is the variable where I divide the individual value into the category (however it's a float, not a string as you suggested). If I change it to a string I get an "error evaluating expression".
  3. Each row of a report has a category with a value. I'd like to display on each row, the percentage of the total that the value represents: CatA 10% 100 CatB 78% 780 CatC 12% 120 Total 1,000 I can't get the percentage field to calculate correctly. I've tried setting different evaluationTime's for the textfield. <variable name="cat_PCT" class="java.lang.Float" resetType="Group" resetGroup="cat_class"> <variableExpression><![CDATA[$V{cat_value}.doubleValue()/$V{total_cat}.doubleValue()]]></variableExpression> </variable> <variable name="total_cat" class="java.math.BigDecimal" calculation="Sum"> <variableExpression><![CDATA[$F{cat_value}.plus()]]></variableExpression> </variable> <textField evaluationTime="Auto" pattern="#,##0.0 %"> <reportElement x="415" y="0" width="39" height="20"/> <textElement textAlignment="Right"/> <textFieldExpression class="java.lang.Float"><![CDATA[$V{cat_PCT}]]></textFieldExpression> </textField> <textField evaluationTime="Report"> <reportElement x="254" y="0" width="100" height="20"/> <textElement textAlignment="Right"/> <textFieldExpression class="java.math.BigDecimal"><![CDATA[$V{total_cat}]]></textFieldExpression> </textField>
  4. I'm a new user trying to pass a date as a parameter receiving this Incompatible java.lang.String error from a groovy .gsp page Here's the .gsp fragment where importDate is a groovy Date: <g:jasperReport jasper="reportSec3" format="HTML" name="Securities by Class"> <input type="hidden" name="importDate" value="${holdingImportDateInstance.importDate}"/> </g:jasperReport> and the jrxml <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="Sec3" language="groovy" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20"> <parameter name="importDate" class="java.util.Date"> <defaultValueExpression><![CDATA[]]></defaultValueExpression> </parameter> <queryString> <![CDATA[sELECT holding.`symbol_id` AS holding_symbol_id, holding.`market_value` AS holding_market_value, security.`asset_class` AS security_asset_class, security.`symbol` AS security_symbol, holding_import_date.`import_date` AS holding_import_date_import_date, security.`name` AS security_name, holding.`date_id` AS holding_date_id, holding_import_date.`id` AS holding_import_date_id FROM `security` security INNER JOIN `holding` holding ON security.`id` = holding.`symbol_id` INNER JOIN `holding_import_date` holding_import_date ON holding.`date_id` = holding_import_date.`id` WHERE holding_import_date.`import_date` = $P{importDate}
×
×
  • Create New...