Posted in ASP .Net, C#, MVC, SQL Server Report Services, SSRS

SSRS (SQL Server Reporting Services)

SSRS is a server side report by Microsoft. I used that to create interactive and printed  reports in my C#, ASP .Net MVC project when I need to have export the report from the view page to a file (PDF or Excel).

I design the reports by using MS Visual Studio 2012 and be able to test the preview of the reports.

rdll

It can connect to the MS SQL Server database as a data source

rdl--

 

and have the specific data set that can use queries or stored procedures,

dataset-

calculated fields and parameter values (entries for queries/ stored procedures).

rdl---

Then the report will be created and we can add table, text box and etc. from the toolbox and design the report like this:

ssrs

There is an option to edit the page layout and design the report or even have an expression for a specific textbox of the report; for instance if the calculated number is greater than zero make the field green and if it is less than zero make the field background red.

exp

=IIF(VAL(ReportItems!MeetExp.Value) = 0,”No Color”,IIF(VAL(ReportItems!MeetExp.Value) >0,”GREEN”,”RED”))

After all these, we can test the report by preview tab and verify it is working correctly.

There was an issue that in the PDf I had some blank pages; the solution is: modifying the Margins of the report.

In the Design tab of the rdl report, right click on the grey part (outside of the report’s body) then select “Report Properties” and then change the width and Height to a bigger number.

margins

This can fix the problem.