Exporting to Excel with %DisplayFormatted
Hi Guys,
I'm using the below to export a query result to excel file and the only file type is .csv (100) but the resulting has two problems,
first the row header is including the field type and second the resulting file is a tab delimited so columns aren't properly separated (see attached below)
set st = ##class(%SQL.Statement).%New(2,"Sample")
set sql = "select ID, name from MyClass"
do st.%Prepare(.sql)
set type="csv"
set rs = st.%Execute()
do rs.%DisplayFormatted(type,"C:\Temp\report")
Thanks
Product version: Caché 2014.1