aspose file tools*
The moose likes Other Open Source Projects and the fly likes JasperReports -- excel issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "JasperReports -- excel issue" Watch "JasperReports -- excel issue" New topic
Author

JasperReports -- excel issue

Grazia Lassner
Greenhorn

Joined: Apr 26, 2010
Posts: 19
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

Joined: Jun 24, 2003
Posts: 3274
    
    5

Version of Jasper? Version of Excel you're aiming to export for?


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Grazia Lassner
Greenhorn

Joined: Apr 26, 2010
Posts: 19
JasperReports 3.7.1
Excel 2007
Grazia Lassner
Greenhorn

Joined: Apr 26, 2010
Posts: 19
JasperReports 3.7.1 uses POI 3.5
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

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

Joined: Apr 26, 2010
Posts: 19
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JasperReports -- excel issue