mike Posted December 11, 2006 Share Posted December 11, 2006 Hello, someones knows the way to export to excel this String value "0000119786" withouteliminate the left zeros ? I try to enable "Is Detect Cell Type" but is doesnt work. Any help is greatly appreciated. Link to comment Share on other sites More sharing options...
mike Posted December 11, 2006 Author Share Posted December 11, 2006 For you interest i am using iReport-1.2.7 but IS_DETECT_CELL_TYPE dosesnt work. Link to comment Share on other sites More sharing options...
lucianc Posted December 11, 2006 Share Posted December 11, 2006 I think you need to doCode:xlsExporter.setParameter(JRXlsExporterParameter.IS_AUTO_DETECT_CELL_TYPE, Boolean.FALSE); This flag is set by default, even though it has been deprecated by the new IS_DETECT_CELL_TYPE flag. We might reconsider this matter in the future and decide that the flag should be unset by default. Regards,Lucian Link to comment Share on other sites More sharing options...
jtotaf Posted December 15, 2006 Share Posted December 15, 2006 Hi! Mike I've tried IS_DETECT_CELL_TYPE but this has the down side that fields that you want to be numbers in the spreadsheet are saved as text. So rather than using IS_DETECT_CELL_TYPE, I've used IS_AUTO_DETECT_CELL_TYPE so that numbers are saved as numbers and any numeric fields that require the leading zeroes I simply prepend a "'" (single quote) which signals to Excel to format the number as text. But please note that for some reason when initially opening the spreadsheet the single quote is displayed until I click on the cell and its text in the toolbar. Mike or Lucian, in a forum item I posted Dec 7/06 I explain that I'm getting a 'cannot resolve symbol' error when setting the IS_DETECT_CELL_TYPE (to set IS_DETECT_CELL_TYPE as described above I had to change the defaults in the code and recompile). Any ideas on what I'm doing wrong. Thanks,john Link to comment Share on other sites More sharing options...
sh23195 Posted April 20, 2018 Share Posted April 20, 2018 Use "t" + {field_name} in textfield, to retain leading 0's 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