Excel Export Data Type

Excel Export Data Type

  

Hi,


I have an entity in which one of the attribute is of datatype decimal (37,2). Now when I try to export this entity list to an excel file the data is still written as the value is, for example if the value to be written is 75.50, it is written as 75.5 or if it has to be written as 0.00 it is written as just 0

Is there any other way to format this to be written as required. 


Appreciate for the help

Hi Abhi,

Can you export the values as text values?

Justin

Justin Babel wrote:

Hi Abhi,

Can you export the values as text values?

Justin

Hi Justin,


Thanks for the reply. The required format for that particular column is 2 decimal Numeric and I understand that using FormatDecimal gives the result as text. Is there a way where I could get this result as decimal and still retaining the format as for eg: 75.00.  Because after the export clicking on any cells would refresh it to be as 75 in this case as the number is formatted as text. 

Thanks,

Vimal

Abhi N wrote:

Justin Babel wrote:

Hi Abhi,

Can you export the values as text values?

Justin

Hi Justin,


Thanks for the reply. The required format for that particular column is 2 decimal Numeric and I understand that using FormatDecimal gives the result as text. Is there a way where I could get this result as decimal and still retaining the format as for eg: 75.00.  Because after the export clicking on any cells would refresh it to be as 75 in this case as the number is formatted as text. 

Thanks,

Vimal

Decimals don't work like that, they have no concept of formatting.

J.Ja


Justin James wrote:

Abhi N wrote:

Justin Babel wrote:

Hi Abhi,

Can you export the values as text values?

Justin

Hi Justin,


Thanks for the reply. The required format for that particular column is 2 decimal Numeric and I understand that using FormatDecimal gives the result as text. Is there a way where I could get this result as decimal and still retaining the format as for eg: 75.00.  Because after the export clicking on any cells would refresh it to be as 75 in this case as the number is formatted as text. 

Thanks,

Vimal

Decimals don't work like that, they have no concept of formatting.

J.Ja

Thank You!



If you still want to solve this you can do the following.  Using an expression, set the value of the cell to "'" + FormatDecimal(<decimal variable>,2,",",".").  (It's tough to see but the expression starts with double quote, single quote, double quote.)  The single quote preceding anything in Excel tells Excel that this is to be treated as text regardless of its contents.  

Hope this helps,

Curt


Curt Raddatz wrote:

If you still want to solve this you can do the following.  Using an expression, set the value of the cell to "'" + FormatDecimal(<decimal variable>,2,",",".").  (It's tough to see but the expression starts with double quote, single quote, double quote.)  The single quote preceding anything in Excel tells Excel that this is to be treated as text regardless of its contents.  

Hope this helps,

Curt


Appreciate for the reply Curt!