Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JasperReports -- excel issue

 
Grazia Lassner
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The .excel version of my report seems

a) not to recognize number formats (defined them as BigDecimal -- I have already set the JRXlsExporterParameter.IS_DETECT_CELL_TYPERXlsExporterParameter.IS_DETECT_CELL_TYPE property to TRUE, but no luck !)

b) not to recognize the functions/formula.

In my report, I am using a crosstab, which displays totals in its last row from the defined measures.

For instance, my actual_degree_qtyMeasure is defined as follows (exerpt from .jrxml):

<measure name="ACTUAL_DEGREE_QTYMeasure" class="java.math.BigDecimal" calculation="Sum">
<measureExpression><![CDATA[$F{ACTUAL_DEGREE_QTY}]]></measureExpression>
</measure>

The total $V{actual_degree_qtyMeasure} is defined as follows in the .jrxml

<textField>
<reportElement style="Crosstab Data Text" mode="Opaque" x="0" y="-29" width="25" height="29" backcolor="#CCCCFF"/>
<textElement verticalAlignment="Middle">
<font size="7"/>
</textElement>
<textFieldExpression class="java.math.BigDecimal"><![CDATA[$V{ACTUAL_DEGREE_QTYMeasure} == null ? "0" : $V{ACTUAL_DEGREE_QTYMeasure}]]></textFieldExpression>
</textField>

Now, when I generate the excel file, the numbers are printed in the cells, but they are recognized as "general" format, not numbers, and obviously if I increase one of these data, the totals do not change.

Any help, please ?



 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Version of Jasper? Version of Excel you're aiming to export for?
 
Grazia Lassner
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JasperReports 3.7.1
Excel 2007
 
Grazia Lassner
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JasperReports 3.7.1 uses POI 3.5
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't use these products but from what I've read in these forums the versions of libs you're using should make what you're trying to do possible. Is it that you're defining it as a <textField>?
 
Grazia Lassner
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I generated teh sample report "Groups" that comes with iReports 3.7.1, and the data you can see are rendered as Currency, and the total in "Total freight in this country" gives the correct total, but it is no longer a updatable formula that reflects the changes in the data it is supposed to sum.
I wonder whether there is a bug in 3.7.1
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic