Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

How to pass a string to the controller class in SSRS?

(1) ShareShare
ReportReport
Posted on by 785
Hello,
 
I have a requirement to create an SSRS report that will take a string as an argument. This string is a scanned barcode that will contain, among other things, a sales order number. The requirement is for the report to run based on this string.
 
Is it possible to pass such a value to the controller class so that I can extract the sales order number and then find the customer number and set the language in the report via controller.parmReportContract().parmRdlContract().parmLanguageId()?
 
Thank you.
  • Suggested answer
    Waed Ayyad Profile Picture
    8,485 Super User 2025 Season 1 on at
    How to pass a string to the controller class in SSRS?
    Hi Shooowtek,
     
    Do you mean that your string will have order Id and other strings, if yes my solution I commented still valid for your case, and you can use it, but I think based on what you wrote you should use subString  to get the Sales Order Id then from it you can get the Customer Id and then you can get the language Id.
     
    You can try the following, Add your code to the prePromptModifyContract  method  or to main method:
     
    YourContractClass contract = this.parmReportContract().parmRdpContract() as YourContractClass;
    
    //Your Logic to get the Language
    
    contract.parmLanguageId("YourValue");
    
     
    Try it and tell me if you want additional help.
     
    Thanks
    Waed Ayyad
    If this helped, please mark it as "Verified" for others facing the same issue
     
  • Layan Jwei Profile Picture
    7,855 Super User 2025 Season 1 on at
    How to pass a string to the controller class in SSRS?
    Hi Shooowtek,
     
    What do you mean by "then the corresponding language is displayed"? Will a language contract parameter appear? Or what exactly?

    Also when do u want to set the value? after you click ok on the dialog?
  • Shooowtek Profile Picture
    785 on at
    How to pass a string to the controller class in SSRS?
    I will cite a simple example that will also apply to me.
    A user runs a report from the sales and marketing module. A dialog box appears. The user then enters a string. The string consists of an order number and some other characters needed for other processes. Then the corresponding language version is displayed according to SalesTable.custTable_CustAccount().languageId()..
    Is it possible to create such a report?
     
  • Layan Jwei Profile Picture
    7,855 Super User 2025 Season 1 on at
    How to pass a string to the controller class in SSRS?
    Hi,
     
    Does the language parameter appear on the dialog? And do you want the language value to be filled before you open the dialog? In this case you can preProdmtModifyContract method
     
    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future
  • Suggested answer
    Waed Ayyad Profile Picture
    8,485 Super User 2025 Season 1 on at
    How to pass a string to the controller class in SSRS?
    Hi,
     
    You can try the following, Add your code to the prePromptModifyContract  method  or to main method:
     
    YourContractClass contract = this.parmReportContract().parmRdpContract() as YourContractClass;
    
    //Your Logic to get the Language
    
    contract.parmLanguageId("YourValue");
    
     
     
    Thanks
    Waed Ayyad
    If this helped, please mark it as "Verified" for others facing the same issue
     
  • Waed Ayyad Profile Picture
    8,485 Super User 2025 Season 1 on at
    How to pass a string to the controller class in SSRS?
     
    Do you mean you want to pass the string as contract parameter without open report dialog?
     
     
    Thanks,
    Waed Ayyad
     
     

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

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

#1
Martin Dráb Profile Picture

Martin Dráb 601 Most Valuable Professional

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 416

#3
Adis Profile Picture

Adis 384 Super User 2025 Season 1

Product updates

Dynamics 365 release plans