Skip to main content
Dynamics 365 Community / Forums / Finance forum / How to pass a string t...
Finance forum
Suggested answer

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

editSubscribe (2) 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.
Attachments
  • Suggested answer
    Waed Ayyad Profile Picture
    Waed Ayyad 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
    Layan Jwei Super User 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
    Shooowtek 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
    Layan Jwei Super User 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
    Waed Ayyad 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
    Waed Ayyad 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
     
     

Helpful resources

Quick Links

New Blog Features Released!

Check out the new community blog features for viewers and authors…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Featured topics

Product updates

Dynamics 365 release plans