SSIS Excel Destination with format - ssis

I try to export excel file with some format like:
Interior.Color
HorizontalAlignment
Font.Bold
and etc..
So the question is, can we do like that is SSIS..
and how to do it?

Not natively no.
If you always have the same output format you could create a formatted template spreadsheet, then make a copy of that to fill with data. I have seen this done before, the formulas and formatting were in the template, the SSIS job copied the template, then populated the copy.

SSIS is primarily a tool for moving data. Although it may be possible to write a script task or a custom component to do what you want, a better way would be to use a tool that is designed for presentation of data (a reporting tool, for example: SSRS) to do what you are trying to do.

Related

Create SSRS Subscription to XLTX (Excel Template)

I am trying to get the subscription for SSRS to send the CSV data to an existing Excel template so that the data is formatted to our excel reports and all the conditional formatting in them every morning but it's just creating a new file. How do I send the data to a specific template file?
While SSRS doesn't have built-in functionality for exporting directly to an Excel template, I have a suggestion for a workaround. Use SSRS to export the data in CSV or Excel format. Then, in the Excel template file, go to the Data menu and select Get Data > From File. This lets you use Excel's built-in Power Query functionality to reference the exported file as a data source.
One of the benefits of this approach is that to get fresh data all you need to do is overwrite the data file and then click "Refresh All" in your Excel file. You can also take advantage of the transformation functions that are available in Power Query to avoid repetitive cleanup tasks if needed.

Output/export information from configmgr 2012 ssrs report

I understand it is possible to export the report data into multiple file types using the export button. however i'm wanting to access the information without having to manually export. So my question is, is it possible using a batch file or powershell to read a text box on the report and output it say into a notepad file or spreadsheet. or if not maybe just a way to export all of the data on the report without having to manually do it? Screenshot attached for an example.
One option is to create a subscription for the report and either have an attachment emailed to you or have it saved to a network location. In either case, there are several export options (csv, excel, xml, etc.). If you're only wanting partial data from the report, I'd recommend creating a sql query or just create a new report that gets you exactly what you need.

import csv file

I need to pull data from csv file to SQL Server table. Which Control task should I use ? Is it Flat File ? What is the correct method to pull data ?
The problem is I have used Flat File Task for pulling csv file. But the csv file whihc I am having, contains headings as first row, then on the third row, I have the columns, and data starting from fifth row.
Another problem is, in this file column details comes again after 1000 data ie columns appears in two rows. Is it possible to pull data ? If so, HOW ?
While Valentino's suggestion should work, I suggest that first you work with the provider of the file to get them to provide the data in a better format. When we get stuff like this we almost always push it back and ask for properly formatted data. We get it too about 90% of the time. It will save you work if they will fix their own drek. In our case, the customers providing the data are paying for our programming services and when they understand how substantial an increase in the cost to them, they are usually nmore than willing to accomodate our needs.
I believe you'll first have to transform your file into a proper CSV file so that the SSIS Flat File Source component (Data Flow) can read it. If the source system cannot produce a real CSV file, we usually create custom .NET applications for the cleanup/conversion task.
An Execute Process task (Control Flow) that executes the custom app can then be called prior to the Data Flow.

(OpenXML) Add data pages to xml package without framework

lately I've been into combining multiple OpenXML speadsheets via PHPExcel which
showed me that this framework has certain issues which makes it pretty much unusable
for what I want to do (my related SO question).
To make it short: it's hard to guarantee that all formatting features of Excel 2007 will
persist a file merge performed with that particular framework.
Anways, now I'm thinking of a more general approach. I want to open a template XLSX
which contains various formatting and add some plain alphanumeric data worksheets 'at the end' of the workbook.
Is sensefully possible to do the following:
unzip template XLSX
parse XML files
add worksheets
save xml files
rezip files to get valuid XLSX
Any hints or experiences would be highly appreciated.
thanks in advance
K
I haven't worked with .xlsx too much, but I've altered .docx files by manually adding and editing the XML.
The biggest concern with adding new parts to a document is to make sure you update the .rels files. The best way to figure out what needs to be updated is to create a new .xlsx document in Excel, add a worksheet, save the file and then unzip it to see what has changed. You can also use the DocumentReflector tool that comes with the OpenXML SDK if you want to see the internals of the file without having to unzip it.
I found the OpenXML reference manual very helpful when hand editing files because it tells you what elements you have to keep and what elements are optional to make a valid document. It makes it easier to work with when you can remove some of the extraneous elements that Excel adds automatically.

Easy method of exporting an html table to excel file in ASP.NET?

Have a report generated from the DB, want to add an export button so they can get the same report in a excel readable sheet of some type. The key here is ease of implementation so a CSV is fine over XLS if it's easier.
Excel is actually somewhat good at reading HTML. Espcially if your HTML contains just a single table. If you want to tell the browser to open the file up in excel, you can use
Response.ContentType = "application/vnd.ms-excel"
This tells the browser to open the document in Excel, instead of just rendering it by itself. There are a few problems though. I don't think it will work if somebody wants to open it with OO.org calc instead. Also, when trying to save it, it will never convert the file to a real excel file, unless the user explicity changes the file type. If it's just an intranet app for your organization, this may not be a problem. The plus side is, is that you can use colours, borders, and even formulas, which can't be done when using straight CSV.
You can use HtmlTextWriter:
System.IO.StringWriter stringWriter = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWriter = new HtmlTextWriter(stringWriter);
grid.RenderControl(htmlWriter);
where grid is a DataGrid object. You can use other types of controls as well.