on 03-28-2015 12:02 AM
Hi.
i would like to know if Data Services can generate a spreadsheet (excel) as target.
i know how can i use a flat file as source, but not sure i could be a target.
thanks in advance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Gerardo,
As Dirk mentioned DS cannot generate an XLS or XLSX file but we can use the scripting technique to generate an excel file on the drive
/***Declare a Global Variable for the Location of Xcel file
$G_PROCESSED_LOCATION ='\\\XYZ_Location\ Excel_Location';
exec('cscript','[$G_PROCESSED_LOCATION]\Excel_create.vbs', 8);
The script for Excel_create.vbs should be something like below:
strFileName
= "c:\test.xls"
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
Set objWorkbook = objExcel.Workbooks.Add()
objWorkbook.SaveAs(strFileName)
objExcel.Quit
Regards
Arun Sasi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Avinash,
You need to call this in a script in Data Services job before the job finishes. Use a try catch block to catch exceptions and errors.
/***Declare a Global Variable for the Location of Excel file
$G_PROCESSED_LOCATION ='\\\XYZ_Location\ Excel_Location';
exec('cscript','[$G_PROCESSED_LOCATION]\Excel_create.vbs', 8);
Make sure that you place the VB script in the location \\XYZ_Location\ Excel_Location\\Excel_create.vbs. Location can be any where... I have just shown a sample location.
The Excel_create.vbs script as it is
strFileName
= "c:\test.xls"
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
Set objWorkbook = objExcel.Workbooks.Add()
objWorkbook.SaveAs(strFileName)
objExcel.Quit
Regards
Arun Sasi
DS cannot generate Excel files, but it can generate flat files (eg. .csv). If you search this forum, you'll find discussions on how to generate an Excel from a .csv using VB.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.