Running a Stored Procedure based on a dates entered in SSRS and displaying the results in a report

  • Hi All,

    I am scoping a development for a vendor developed application. Historically the reports for this system (SQL Server Reporting Services) simply displayed values from a table in our SQL 2005 DB

    However now there is a requirement for the application to run an SP in the database which will progress calculations based on a from and to date entered in the reports. The result of this calculation has to be displayed in a column in the report.

    The front end of the solution is web based and it's multi-user.

    Can anyone please advise a practical way to implement this requirement so that all users of the tool can run reports without impacting other users.

    Many Thanks,

    Noel.

  • I think you should give the From Date and To date parameter in your report.

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • noelconroy15 (5/17/2010)


    Hi All,

    I am scoping a development for a vendor developed application. Historically the reports for this system (SQL Server Reporting Services) simply displayed values from a table in our SQL 2005 DB

    So do you have a SSRS based reporting in place? What do you mean by 'simply displayed values from a table'? To display values from a table, an SP has to be created and hooked with the report.

    However now there is a requirement for the application to run an SP in the database which will progress calculations based on a from and to date entered in the reports. The result of this calculation has to be displayed in a column in the report.

    As i said above, there should be an SP already. Assuming that you have the SP, I will answer your question. And I am also assuming that your question is as follows -

    You have to show the report in two ways:

    1. Accepting From And To Dates and doing a calculation based on that and showing the result in a column.

    2. Not accepting a date range and probably in this case you do not want to show the date fields.

    SOLUTION:

    1. Create the report with the date parameters.

    2. Give default values for the parameters in the report server.

    3. If there is a role based on which you have to show/hide the prompt for date fields, add that logic in the code.

    4. In the SP, if the date fields have default values, do not do calculations. In this case, you can hide the computed column in the report.

    5. If the date fields have valid values, do calculations in the SP and show the result in the column.

    If what i have perceived is not the actual problem, please elaborate.

    PS: Default value for parameter and hiding a column can be done while designing the report.

    - arjun

    https://sqlroadie.com/

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply