Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Data triming while exporting the report output to .csv
vijay_kota
Hi All,<br />
<br />
When i export the report out put to .csv format the leading zero in the column is getting trimmed.<br />
<br />
I am using BIRT 2.3.2. <br />
<br />
The datatype of the column is string and i am using same datatype in my report.<br />
<br />
I have exported the report in excel also. But its not causing any problem.<br />
<br />
<strong class='bbc'>Column Itemnum is getting trimmed if the columns contains zero in the begining.</strong><br />
<br />
Say for example <strong class='bbc'>04257869</strong>. After exporting into csv and opening using MS Excel the value will be diplayed as <br />
<br />
<strong class='bbc'>4257869.</strong><br />
<br />
Please suggest how can i avoid this....!!!<br />
<br />
Regards,<br />
<br />
Vijay
Find more posts tagged with
Comments
micajblock
When you edit the file using a text editor is the '0' in the file?
vijay_kota
Yes,
When open the file using Notepad "0" is coming.
Issue comes when i open the same using excel.
micajblock
<blockquote class='ipsBlockquote' data-author="'vijay_kota'" data-cid="84413" data-time="1319179667" data-date="20 October 2011 - 11:47 PM"><p>
Issue comes when i open the same using excel.<br /></p></blockquote>
<br />
This is how Excel works! Excel assumes all data with only numbers is numeric. The only thing I can think of is changing the data (I am not sure that is a good idea), by adding quotes around the numbers.
vijay_kota
Hi mblock,
If that is the case, when i export the report in excel same thing should happen right...??
But that is not the case here.
If i export the report in .csv and open it in Excel it gets trimmed. But same report if i export directly
into Excel i am getting proper output.
Please suggest me any other work around...
micajblock
<blockquote class='ipsBlockquote' data-author="'vijay_kota'" data-cid="84446" data-time="1319227774" data-date="21 October 2011 - 01:09 PM"><p>
If that is the case, when i export the report in excel same thing should happen right...??<br /></p></blockquote>
<br />
Wrong! Excel format is not CSV. With an Excel file one can tell the cell what kind of data is in the cell. With CSV even if you put the column type in the header Excel does what it wants. Once in Excel you can try and format it using special formatting.<br />
<br />
See here article from Microsoft on the topic.<br />
<br />
<a class='bbc_url' href='
http://office.microsoft.com/en-us/excel-help/how-to-handle-leading-zeros-and-precision-in-number-codes-HA010274823.aspx'>http://office.microsoft.com/en-us/excel-help/how-to-handle-leading-zeros-and-precision-in-number-codes-HA010274823.aspx</a>
;
vijay_kota
Thank you mblock....
That's cleared my issue...