|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Monday, November 30, 2009 8:07 PM
Points: 15,
Visits: 40
|
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Friday, January 14, 2011 2:11 AM
Points: 24,
Visits: 43
|
|
Please, can you explane how do you create ExcelFileName and TAB variable. I can't see it cleary from the picture.
radovan
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Tuesday, June 11, 2013 1:10 PM
Points: 1,191,
Visits: 1,254
|
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, June 18, 2010 12:14 PM
Points: 8,
Visits: 22
|
|
you can simple use output from your SQL Server and call xp_cmdshell to modify/re-massage/rename/move/.. your xls file.
I did it even within Unix (Excel will open your tab delimited output when you add xls extension to your file).
I did not like DTS, but SSIS can do the same, but I still prefer to use combination of batch file with ISQL and xp_..
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Today @ 4:08 PM
Points: 56,
Visits: 156
|
|
Can you post more detail on how you get the filename created and the tab names. Can't really make anything out in the pictures
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Thursday, January 31, 2008 9:20 AM
Points: 10,
Visits: 24
|
|
Check this link. It has a more detailed sample. http://rafael-salas.blogspot.com/2006/12/import-header-line-tables-into-dynamic_22.html
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Thursday, June 13, 2013 5:00 PM
Points: 16,
Visits: 249
|
|
What version of SQL Server?
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Monday, November 30, 2009 8:07 PM
Points: 15,
Visits: 40
|
|
Hopefully here are some answers to the questions:
1. The filename actually is a variable. The variable was populated in the first Execute SQL task BEFORE the Foreach Loop. (Like a cursor). You dump values from a table into a variable.
Set the Excel Connection (notice that usually you specific connection 1, connection 2 etc but here NO specified number) to use a New Property expression. In the New Property expression and add the variable defined for the Excelsheet name. This variable references back to the cursor (called in this case 'Region' from the Execute SQL task).
As to the tabs...it is the same thing. A cursor is populated in the Execute SQL task called 'subregion'. This populated cursor is then used in a variable statement in the Foreach loop allowing the tabs to be created. Use the 'User:ListofSubgroups' value in the Variable name field within the Excel Destination Editor to create the tabs on the fly.
Now...as a 'heads up' To be able to create the Excel Destination the first time when developing the solution an actual Excel workbook with at least one tab must exist.
2. As with any solution there are definitely more ways than this one to 'skin a cat' and do this operation. This solution does not discuss how to push to 2007 Excel (we have just figured that one out). AND there is actually a way to totally code creation of an excel spreadsheet and tabs and population of same. It is not mine so I will not post here. This solution is for those that use SSIS packages preferentially.
The original motivator was to be able to do this WITHOUT having a template sitting on some filesystem. To that end we are one step closer to keeping everything in a SSIS solution.
Hoping the above helps....please keep the questions coming
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Monday, November 30, 2009 8:07 PM
Points: 15,
Visits: 40
|
|
Radovan:
Were you able to pull down an actual version of the article? If so, you should be able to expand the screen prints. As well, I have posted more explanation here....
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Friday, June 14, 2013 11:05 AM
Points: 48,
Visits: 268
|
|
Hello, I like this article. Do you think that I could target a SharePoint portal document library? Also, I would like the possibility to create a VBA module in addition to the excel tab. Thanks Philippe
BI Guy
|
|
|
|