How To Format Cell In Excel When Exporting

Pramod Nair

Member
I want to format a cell in excel when export from the code. Original value to show in the cell is
00012345, 00012346, 00012347 which is a single field value in my temptable now when exported to the excel the cell value has 12345,000,12346,000,000,000.

My Procedure

PUT STREAM CSVSTREAM UNFORMATTED ttmytemp.Numbers.


Help Needed
 

Cringer

ProgressTalk.com Moderator
Staff member
Ok you have 2 problems.
1) The value you are exporting contains commas. Are they meant to be separate fields in the CSV?
2) Excel doesn't handle CSV files properly. It tries to be clever. If you look at the contents of the file in a text editor BEFORE opening in Excel you should see the values are correct.
 

Pramod Nair

Member
I want to format a cell in excel when export from the code. Original value to show in the cell is
00012345, 00012346, 00012347 which is a single field value in my temptable now when exported to the excel the cell value has 12345,000,12346,000,000,000.

My Procedure

PUT STREAM CSVSTREAM UNFORMATTED ttmytemp.Numbers.


Help Needed
Issue resolved the problem was in my procedure.
Thanks for the suggestion and your valuable time @Cringer
 

joey.jeremiah

ProgressTalk Moderator
Staff member
You might want to try the free Docxfactory project Excel library.

You can add formating, pictures, graphs etc. and it's just one command to export your temp-tables, queries, datasets etc.

The project can also take your Progress formats, labels etc. and convert them to Excel formats, labels etc.

Disclosure: I wrote the project.
 
Top