cancel
Showing results for 
Search instead for 
Did you mean: 

saveAsCSV() truncating leading zeros

Former Member
0 Kudos

Hi

We have used applet call saveAsCSV() and are experiencing the typical "leading zero" truncation since the value is being treated as numberic.

I would like to know if there is any way of specifying certain fields as text other than inserting a character to force it to be a text field

Thanks

Deepa

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Deepa

This is actually a Microsoft Excel issue. You cannot save a leading 0 in an csv file.

I have tried doing this external to xMII and got to the conclusion that the file type CSV does not allow for leading zero's (I think this is the case with special characters in CSV files as well).

Your best bet is to call a function to add leading zero's (something like a padding/stretch function) once you open the saved file.

Regards

Former Member
0 Kudos

In excel if you use Data->Import rather than File->Open to load your csv then Excel uses the Text Import wizard, so you can then indicate which fields to treat as text/numeric/etc.

You can achieve the same by saving as .txt rather than .csv, but either way there is a bit of user intervention required.

Former Member
0 Kudos

Thanks for the answers. I understand that this is Excel issue. I had suggested the Text Import solution and I'm waiting for User to confirm if that was acceptable.

In the meanwhile, I was wondering if exporting can be done to excel file from xMII rather than to a csv file. Since excel allows formats to be set, it may not have these limitations.

I was thinking if a webservice can be called from BLS that can convert xml to excel form. But again I am not sure how the user can gain control to save the excel file or how the interaction can happen. Any ideas around that if that can be done

Thanks

Deepa