I have used SQL Server’s TSQL to generate Excel spreadsheets from Vision data, our ERP, and then deliver the document to various employees. The data in the document is customized to that individual and there are multiple types of audiences that have different reasons for the report, thus need a customized version of it. Even better, Vision can schedule and run the TSQL to make all this happen.

But, I found a better way.

I rebuilt the reports in SQL Server Reporting Services (SSRS). The version available to me does not have the built-in dynamic scheduling capabilities, so I needed a plan b. I turned to the SSRS API and found that some simple C# .NET code could easily call a service and generate a report in various formats, and could accept arguments for the report parameters.

There are 4 versions of most reports that I create: Project Manager, Team Leader, Program Manager, and Management. All of these reports needed to be able to display customized data based on who was actually viewing the report. I easily found a way to pass in a URL based parameter to identify the proper employee data to display. This was really handy for the code, because code calls the report via a URL and I could easily supply each employee, one at a time and get all the reports I needed. With a lot of searching ,and trial and error, I found a tricky way to identify the person that is viewing the report in the browser. Not only could I use SSRS to generate these reports, the very same report can be used by all employees, showing them only the data they need versus all data.

This solution required C# .NET, Vision API,  SSRS API, and a number of Views and Stored Procedures using TSQL on MS SQL Server 2008.