I am try to save a SQL result to filesytem using QTP. The result sheet should be saved as a required format. For number, it must be saved as 1,234,567.89. For date, is must be saved as dd.mm.yyyy
Can DataTable.ExportSheet method do it? Or I have to write addtional script for it?
Thanks in advance
rst.Open arrRetString (cnt), objRSConnect
'Fetch all the field names to the Datatable
for each fields in rst.fields
DataTable.AddSheet("sql_test").AddParameter fields.Name, ""
' Fetch all the rows to Datatable
Do Until rst.EOF
For i = 1 To rst.Fields.Count
DataTable.Value(i, "sql_test")= rst.Fields.Item(i-1)
Re: DataTable.ExportSheet Question?
Datatable does not support that kind of formatting. You need to write to an excel and format the columns as per your requirement either manually or thru code.