This topic is locked

Export number to Excel

3/30/2007 10:10:28 AM
ASPRunnerPro General questions
H
Happening author

I've a project with an acces database (linked tables to oracle).
When I export a list to excel (with a field with View as settings Number) this field doesn't have number properties in excel.
In Excel the field is text/string so we can't calculate this field.

Sergey Kornilov admin 4/3/2007

ASPRunnerPro don't support setting column properties in export files.
You can change column properties to Number in Excel itself after the export.

H
Happening author 4/13/2007

When I change the properties in Excel, the field is a textnumber and then you can't calculate. We have to loop through all the fields to activate the number-setting. And when you export a lot of records you don't want to do that.
So I've searched for another solution:
in *export.asp I've changed:
response.Write "<td x:str>"

TO

response.Write "<td x:num>"

for the field. Then I works!

H
Happening author 4/17/2007

because we have dutch language settings the solution doesn't work voor decimals.
I add in commonfunctions the bold code:
ElseIf fformat = FORMAT_NUMBER Then

ret = FormatNumber(CDbl(data(field)))
if REQUEST("type")="excel" then

ret1 = replace(ret, ".", "")

ret2 = replace(ret1, ",", ".")

ret = ret2

end if

and then it also works for decimals.