SSRS Evaluating an expression used to set default parameter value

Ramon Venegas 21 Reputation points
2021-02-05T16:21:39.08+00:00

I have this expression to set the parameter default values - how can I evaluate it without running the report?

=DateAdd(DateInterval.Month, -1, DateSerial(Year(Date.Now), Month(Date.Now), 1))

SQL Server Analysis Services
SQL Server Analysis Services
A Microsoft online analytical data engine used in decision support and business analytics, providing the analytical data for business reports and client applications such as Power BI, Excel, Reporting Services reports, and other data visualization tools.
1,248 questions
0 comments No comments
{count} votes

Accepted answer
  1. Lukas Yu -MSFT 5,816 Reputation points
    2021-02-08T02:23:31.793+00:00

    Hi,

    For this expression :
    =DateAdd(DateInterval.Month, -1, DateSerial(Year(Date.Now), Month(Date.Now), 1))

    Since it doesnot evolve any data fields, I think you could directly run it in any Visual Basic test environment.

    You could put this expression in a textbox in the report builder or visual studio report , then run the report to see the value.

    Regards,
    Lukas

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Darren Gosbell 1,466 Reputation points
    2021-02-07T22:15:21.183+00:00

    I don't believe you can run expressions outside of a report. If I ever have to test a complex default expression I create a temporary test report with just the parameters I need then drag those parameters onto the report canvas so I can see their values.

    0 comments No comments

  2. Ramon Venegas 21 Reputation points
    2021-02-07T22:37:17.627+00:00

    Thanks Darren - that makes sense.

    0 comments No comments