in
http://blog.9cbs.net/juwuyi/archive/2004/10/18/141255.aspx
An example of a TDC provided is added to the following functions to save the data into Excel.
Function savetoexcel () {
Var Rst = TDCComposers.Recordset;
VAR XLAPP = New ActiveXObject ("Excel.Application");
VAR XLWB = XLapp.Workbooks.Add ();
VAR XLWS = XLWB.Worksheets ("Sheet1");
// Show Excel
XLapp.visible = "1";
XLAPP.USERCONTROL = "1";
// Add column to Excel
Var fldcount = Rst.fields.count;
For (var iCol = 1; icol <= fldcount; icol ) {
Xlws.cells (1, icol) .value = rst.fields (iCol - 1) .name;
}
// Excel 2000 OR 2002: Uses CopyFromRecordset
XLWS.CELLS (2, 1) .copyFromRecordset (RST);
XLapp.selection.currentregion.columns.autofit ();
XLapp.Selection.currentRegion.Rows.autofit ();
XLWS = NULL;
XLWB = NULL;
XLAPP = NULL;
}
script>