web
You’re offline. This is a read only version of the page.
close
Skip to main content
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
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.
I have the same question (0)
  • Waed Ayyad Profile Picture
    Super User 2025 Season 2 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
     
     
  • Suggested answer
    Waed Ayyad Profile Picture
    Super User 2025 Season 2 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
     
  • Layan Jwei Profile Picture
    Super User 2025 Season 2 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
  • Shooowtek Profile Picture
    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
    Super User 2025 Season 2 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?
  • Suggested answer
    Waed Ayyad Profile Picture
    Super User 2025 Season 2 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
     

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

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

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

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans