web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

How to utilize or print dynamic parameters for SSRS report ?

(1) ShareShare
ReportReport
Posted on by 219
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,
I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    240,492 Most Valuable Professional on at
    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.
  • CU27040856-5 Profile Picture
    4 on at
    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

     
  • Martin Dráb Profile Picture
    240,492 Most Valuable Professional on at
    No, DynamicParameter.Value, won't give you anything useful.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
SajeedMullaji Profile Picture

SajeedMullaji 698

#2
Martin Dráb Profile Picture

Martin Dráb 327 Most Valuable Professional

#3
CU10121822-0 Profile Picture

CU10121822-0 320

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans