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

Excel export and cell formatting issue


lknueve

Recommended Posts

 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

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...