I’ve been doing some research on how to have sql server create invoices or reports automatically given a specific time, similar to a scheduled job. I want to be able to use an excel sheet which has the invoice template and update my sql server update the fields with the given data (Customer Name, account Id, sales tax, etc). I came across SSRS which does reports, but I dont know if that will do data processing for me. The type of processing I need is simple, gallons used * price/gallon * sales tax. I have very little experience with sql server, from what I know, its not very convenient to these algorithms in sql so I rather have excel do it for me. So again, is there a way to have sql run an automated query that updates an excel spread sheet? I have imported data to excel via csv file and vice versa, but the thing that is confusing me in this case is that my excel spreadsheet itself is an invoice template with a company logo so I can’t just import data to the template. Does anyone have any suggestions? Thanks.
I think you should go with SSRS reports . Report server in SSRS can handle the report processing and Scheduling and delivering of files .U can get the reports in most of the formats(Excel ,Word ,pdf etc ) .You can go through the below link to understand how to schedule and deliver your reports
Regarding the logic such as gallons=*price/gallon*sales . These logics can easily be applied to the columns in ssrs reports using expressions such as
For the column gallons used, the expression will be
you could use this application tier:
DATABASE MANAGEMENT SYSTEM | V PROVIDE DATA TO | V YOUR APPLICATION | V WOULD USE | V [OPEN XML SDK 2.0 For excel] - http://openxmldeveloper.org/blog/b/openxmldeveloper/archive/2009/06/02/4730.aspx | V TO GENERATE EXCEL FILES that contains data that was provided by your DBMS to your application:
The easiest method would be to re-create the template within an SSRS report (embedding the company logo in the report, for example), create a subscription for the report, and specify Excel as the output format for the subscription.
The calculations you describe are very simple. If your resultsets are small, embedding the calculations in the report may prove less challenging. However, if you’re working with large datasets, it’s best to include the calculations in the query executing on the database server. If you can figure out how to write the query for your report to begin with, figuring out simple calculations won’t be difficult.