locked
ssrs report change parameter RRS feed

  • Question

  • Hello,
    I have a SSRS report which has startdate as parameter.
    The startdate value is set to a particular date i.e. 5/5/2017
    so every time this report is run, the default is 5/5/2017

    There si now a new requrement for the same report to be emailed BUT for the start date to always be the previous 7 days.

    I looked in the subscription section of the report but it looks like I can not place an expression in the startdate parameter.
    Please note that the report currently runs with a default startdate but there is now an additional-separate requirement to run the report with startdate to be 7 days ago.

    Does this mean I have to create a new report and have the new startdate in there?
    If so then I can do this but if the answer is we can use the same report then how is this done please?

    Thank you
    Friday, January 18, 2019 2:35 PM

Answers

  • Hi arkiboys

    According to your description , you need to judge which subscription you use first .

    If you use the standard subscription , you could not set the report parameter in the subscription section , you need to set the report default parameter value via modify the report in report designer .

    If you use the data-driven subscription , and you set the report parameter value as “get value from dataset”. Then you could modify the default parameter value from the data-driven subscription dataset query.

    If you still have issue about your question , you could offer more detailed description about your issue to use like subscription setting screen shoot ,report parameter setting screenshot …etc.

    Hope it can help you .

    Best Regards,

    Eric Liu


    Best Regards, Eric Liu MSDN Community Support Please remember to click Mark as Answer if the responses that resolved your issue, and to click Unmark as Answer if not. This can be beneficial to other community members reading this thread.

    • Marked as answer by arkiboys Monday, January 21, 2019 6:58 AM
    Monday, January 21, 2019 1:41 AM
  • 1. You can go inside the report and set an expression for the startdate parameter like

    DateAdd(DateInterval.day,-7,Today())

    and it will default to 7 days before

    then you can set a standard subscription for the report

    2. Second method is to set a data driven subscription for the SSRS report and then you will be able to set value for start date parameter using a query which you use for dataset to set properties

    As an example see below

    https://jackworthen.com/2016/05/06/creating-a-data-driven-subscription-in-sql-server-reporting-services/


    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    ----------------------------
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

    • Marked as answer by arkiboys Monday, January 21, 2019 11:23 AM
    Monday, January 21, 2019 7:30 AM

All replies

  • Hi arkiboys

    According to your description , you need to judge which subscription you use first .

    If you use the standard subscription , you could not set the report parameter in the subscription section , you need to set the report default parameter value via modify the report in report designer .

    If you use the data-driven subscription , and you set the report parameter value as “get value from dataset”. Then you could modify the default parameter value from the data-driven subscription dataset query.

    If you still have issue about your question , you could offer more detailed description about your issue to use like subscription setting screen shoot ,report parameter setting screenshot …etc.

    Hope it can help you .

    Best Regards,

    Eric Liu


    Best Regards, Eric Liu MSDN Community Support Please remember to click Mark as Answer if the responses that resolved your issue, and to click Unmark as Answer if not. This can be beneficial to other community members reading this thread.

    • Marked as answer by arkiboys Monday, January 21, 2019 6:58 AM
    Monday, January 21, 2019 1:41 AM
  • 1. You can go inside the report and set an expression for the startdate parameter like

    DateAdd(DateInterval.day,-7,Today())

    and it will default to 7 days before

    then you can set a standard subscription for the report

    2. Second method is to set a data driven subscription for the SSRS report and then you will be able to set value for start date parameter using a query which you use for dataset to set properties

    As an example see below

    https://jackworthen.com/2016/05/06/creating-a-data-driven-subscription-in-sql-server-reporting-services/


    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    ----------------------------
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

    • Marked as answer by arkiboys Monday, January 21, 2019 11:23 AM
    Monday, January 21, 2019 7:30 AM