Use SSRS exported Excel as SSIS Excel Destination? - sql-server

I have an SSRS report that exports to Excel in xlsx format. I'm trying to then use SSIS to export a large dataset as a new tab to that report, but when I try to use the SSRS exported xlsx file as an Excel Destination in SSIS I get a bunch of errors and it won't recognize the source.
But, if i open the xlsx file exported from SSRS and manually save it again as xlsx, then it will work.
Any idea why this is happening? Is it not possible to use an SSRS exported xlsx file as an Excel Destination in SSIS?
Thanks.

I faced the same issue after using a SSRS-exported excel file as Excel Source in SSIS. It seems SSRS encode the file and include several SSRS specific characters that Excel doesn't interpret and aren't visible from Excel.
You can export the report as a plain text file then use a Flat file connection to flow the data.
Let me know if this helps you.

Related

How to configure input columns when using dynamic Excel connection managers in SSIS

After creating a dynamic Excel connection manager with Visual Studio 2015 SSIS and iterating through multiple Excel files in a directory I have run into the problem of not being able to change the number of columns in the connection manager. The Excel files do not have the same number of columns (or heading names/locations). I'm passing the data from the connection manager straight into a script component in order to handle this.
I tried creating an Excel connection manager with more columns they I will ever use before switching it to a Package Connection and setting the Expressions ExcelFilePath to my For/Each loop variable but this doesn't seem to work. I've received the VS_NEEDSNEWMETADATA error after this and, after rebuilding, received a
"Column "F18" cannot be found at the datasource"
error when an Excel sheet with fewer than 18 columns was passed through the for/each loop.
Any suggestions or assistance would be appreciated. Thank you.
If the columns count are different between Excel files, you cannot use the same Excel source to import them. You will always get theƗVS_NEEDSNEWMETADATA exception that you mentioned.
If you are handling Excel files with same structure but with different columns order you can refer to my detailed answer on the link below:
Importing excel files having variable headers
If you have the choice to convert Excel files to Flat files, there are many links that describe the full process on how to import files with different structure.
If you don't have this choice, you must think on automating packages creation which is more complex (using BIML or DTS wrappers)
Update 1
Some links about converting Excel to csv:
Script task for converting Excel to CSV
Convert XLS to CSV on command line
Auto convert Xls to CSV
Convert xlsx file to csv using batch
Batch convert xls-Files to csv
SSIS process for saving .xlsx file as .csv file
SSIS using Script task - Convert XLS to CSV

Exporting Data to excel using SSIS and Data error

I have two different issues
1). I am trying to export data to excel from SQL Server database. The package will create a new excel file each day and insert the data from database to excel.
I want the column name to also be updated in the excel file. One way is to use a template and insert data into it. I don't want to use any kind of template as I want to create a new excel file daily. Is there any other method available ????
2). I am trying to export data from server to excel. DATATYPE in server database is numeric. I am using a data conversion and changing to unicode string and then inserting it to excel.
value in server database= 0.000
value exported to excel= .000
help me fix it. I need 0.000 to be exported to excel
1) Yes, instead of a dataflow you can use a Script task to create the Excel file and write the data to it, and that will allow you to dynamically name the columns.
2) It is not that SSIS is exporting that value to Excel. That's just the way Excel is displaying the data.

Excel 2003 XML to SSIS

I'm writing an SSIS package to import the contents of several Excel files into a SQL Server database for my client. These files will be provided regularly and the system should be completely automated without user involvement.
The Excel files are provided by my client's business partners, so I don't have a lot of control over them.
One of the files seems to be in the Excel 2003 SpreadsheetML XML format. Note that this is different from Open XML. It seems from my research that SSIS cannot read this format. It can and does read "normal" Excel 2003 files just fine.
Does anyone know of a way (in code) to convert this file into either non-XML Excel 2003 or Excel 2007 so I can import it? It needs to be automated, so opening the file using Excel and "save as" another type is off the table.

Export data from sql server to excel using SSIS

First I will explain what is my requirement and then I will explain what I have done so far and what are all the helps I need...
I have to export data from sql server to excel sheet. The excel sheet will be like a standard template. If I run my project, the data from SQL Server should be inserted into a new excel file which should use that template and it should be created and saved into a new location. Also, generally we will use first row as header. But in my requirement, the template will have two or three rows header. So, the data should be inserted automatically from the third/fourth empty row.
I have done exporting data from sql server database to normal excel sheet with first row as header. I have also done exporting data from different tables into different sheets of the same excel file.
Any body please help out for the template format, creation of new excel file while running project and two or three rows as header.
I am using SQL Server 2005 and Visual Studio 2005.
Please help out...Thanks in advance...
If your export is to Excel 2007 or 2010 can you use EPPLUS to handle the Excel-files.
You can solve this using SSRS.
Create your report how it has to look like.
Then deploy it on a reporting server web.
Then create a subscription where you export the report to a excel file. You can setup location and time it has to run.
THe report can look like however you need it.

Insert Data into Excel File generated using Excel PIA's

I have generated excel file using Excel 2007 PIA's and now I want to insert data from database into excel file.I am having SQL Server 2005 database.I also want to format the data in excel file.
Guide me..
Thanks
I recommend you using NPOI to do the excel stuff. it's light-weight, and can do all the data inserting and formatting as you expected.

Resources