lknueve Posted August 9, 2011 Share Posted August 9, 2011 Hello. I have a report that I am exporting to Excel and for the most part it's working great now. There is one issue however that I can't seem to figure out. I have a few columns that are exporting excel formulas (using net.sf.jasperreports.export.xls.formula) and they are working, but one of the columns is not formatted properly? I have the expression class set to java.math.BigDecimal, with a field of the same type in the Text field expression, and the formula is doing a subtraction of date/times to find how long something took. However, when exporting the report, this field keeps returning 0 for all records. Since none of the records should be greater than 1, this may be valid, but we need to see the decimal points to find out the actual length of time.Is there any way to force excel to format a cell to Number with 6 decimal places? Link to comment Share on other sites More sharing options...
lknueve Posted August 9, 2011 Author Share Posted August 9, 2011 Oh! I forgot to mention that I do have the net.sf.jasperreports.export.xls.detect.cell.type set to true Link to comment Share on other sites More sharing options...
lknueve Posted August 9, 2011 Author Share Posted August 9, 2011 for anyone who may come across this same issue, here's how I did it: it was a modification to the excel formula. Here's what I had originally for example in the Excel formula: "=IF(\$A$1=\$A2, \$B2, 0)"I modified it to do the following: "=TEXT(IF(\$A$1=\$A2, \$B2, 0), \"#,##0.000000\")" 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