Posted in ASP .Net, C#, Core Java, Design Pattern, Framework, Inversion of Control, Java EE, Library

Library vs Framework

The key difference between Library and Framework is in IoC (Inversion of Control)

  • by using a feature from a Library you are in control.
  • The Framework include some abstract design with built-in behaviors. Control is inverted and the framework calls you; framework code will call the code at those various points that behavior has inserted. The Hollywood principle: Don’t call Us, we’ll call You.

Library

Framework

A certain set of reusable functions of an application (mostly organized into classes) As a skeleton of an application
A collection of class definitions A collection of patterns
You call the library APIs in your code A framework calls your code
The control is always with you The control in with the framework if you’re using it
Libraries meant to do some specific tasks only Framework is a predefined design
You need to scaffold your project manually Super easy to scaffold
   

 

 

 

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.