Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

How to utilize or print dynamic parameters for SSRS report ?

(1) ShareShare
ReportReport
Posted on by 144
Hi guys,
 
When creating SSRS report by using RDP, in my report design there is one parameter called : /<name of the report>_DynamicParameter/
How to utilize it so we can print it in our report ?
 
If I directly print this, it will only give me somekind of number which I guess it is the recid.
 
In my RDP, I'm using this,Query(), and if I put the query to string variable I can see the query, should I just look at the string and parse it when they found /where/ select. But what if someone join the datasource during runtime, I think my code will break.
 
So may I know whether there is better way of doing it, to utilize the /<name of the report>_DynamicParameter/, instead of write code in RDP class to /manually/ get the range ? I mean, when run time, we don't either whether the user will join to other table or not.
 
Thanks,
  • Martin Dráb Profile Picture
    Martin Dráb 230,433 Most Valuable Professional on at
    How to utilize or print dynamic parameters for SSRS report ?
    No, DynamicParameter.Value, won't give you anything useful.
  • How to utilize or print dynamic parameters for SSRS report ?
    Instead of parsing the parameter value in your RDP code, use expressions directly within your report to access and format the parameter.
    You can access the dynamic parameter using the Parameters! collection and its name, for example: Parameters!<_report_name>_DynamicParameter.Value.
    Within the expression, you can then use various functions like Format() or ToString() to convert the raw value into a more user-friendly format for printing.

    SSRS Expressions: https://learn.microsoft.com/en-us/sql/reporting-services/tutorial-introducing-expressions?view=sql-server-ver16basket random

     
  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,433 Most Valuable Professional on at
    How to utilize or print dynamic parameters for SSRS report ?
    Trying to parse the query string wouldn't be a good approach. There is a much easier way: utilize Query* classes, e.g. you can list data sources in a query, get ranges and their values etc., all as normal object-oriented code. Printing dynamic parameters will give you some idea. Note that the blog post covers query ranges, if you need query filters, you'll find code in a comment below the article.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,703 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,433 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans