locked
Populate the all tabular reports in single .rdlc file RRS feed

  • Question

  • Hi support team,

    I have various stored procedures which returns multiple columns by joining various tables of my SQL Server 2014 database. I want to create a single report page at compile time and attach it to one of my razor view (using ASP.net MVC4 for my project). So, I just want to call the required storedprocedure (Based on querystring or api GET method with ìd`parameter) and return the results into the view. 

    I am using EF6 and calling my stored procedure as:

    List<T> storedProcResults = dbContext.Database.SqlQuery<T>(storedProcName).ToList();

    So, I want to return this list to my report view and display the results. So, here I have two major problems:

    a. using the single rdlc file for all kinds of results(customized columns)

    b. i don`t want to restrict the type <T> to specific class and want to make it something dynamic based on the return type of SPs.

    Also, please suggest if i have using the correct approach or not and I dont want to use SSRS to populate my report using another reporting server for which i preferred to use rdlc file instead of rdl files. I dont want to make the different releases based on simple changes in the report columns so i just want the approach where i can update the stored procedure in db only and get the new reports instantly using same generic codes and view.

    Please help me out as early possible for the query and recommendation for better approach


    Thursday, May 26, 2016 1:41 PM

Answers

  • Hi Subash,

    You can achieve it by single RDLC, You can use hide and visible column property of the column in tabular report.

    Create tabular report with max no of columns return by from your set of stored procedure col1,col2,...coln

    If Stored Procedure 1 called   you get results col1,col2  use iif expression which controls your column visibility based on stored procedure.

    col1 visibility property= iif(spname="xyz",true,false)

    col2 visibility property= iif(spname="xyz",true,false)

    ...

    you can control based on tabular visibility or column visibility up to you.

    Regards,

    Navin


    Navin.D http://dnavin.wordpress.com


    Thursday, May 26, 2016 4:46 PM