Excel Export Issue

  • 7 February 2018
  • 1 reply
  • 6 views

Hi, I am implementing export functionality using excel export control, but facing an issue i.e. when Smart Object returns numeric value it gets converted into text value in exported excel. I want to save numeric value as number only without any conversion to text in excel. Please share any suggestion over this. Regards, Sonali Jain

1 reply

Hi,
It sounds like your data might be exported as string. On Advance Editor -> External Columns, all your decimal columns might have Unicode string[DT_WSTR] datatype.
Try and change this datatype and make sure that did indeed change.

Refer to link below:
http://sqlserversolutions.blogspot.in/2011/10/numeric-gets-converted-to-text-in-excel.html

If the datatype is not able to change you might need a Script Task. As soon as the data is exported to the excel file, this script task will read the excel file and format the column as Number or decimal.

Refer to link below that contains a source code to achieve this:
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/7f79cfde-2f1f-4cad-94f8-07397b998296/delete-data-in-excel-using-openrowset?forum=transactsql

K2 will not accept any liability for any issues arising from actions taken in respect of the information provided by any forum member.

Reply