简体   繁体   中英

Hyperlink expression in SSRS Report to pass parameter to ASP.NET app

I have a basic SSRS report and I would like to be able to click on an item on my report to go to one of my asp.net pages (one intended for updating records) and I'd like to pass in the primary key to the asp page, so that on pageload it gets passed to a stored proc on page load and can populate text boxes and dropdown menus accordingly. I'm just unsure of how to structure the expression for the hyperlink in the report designer in order to do so. Maybe through a query string?

  • How do I structure the hyperlink expression in SSRS?
  • How do I accept the parameter in the c# codebehind on Page_Load to use in SQL Query?

Thank you for any help in illuminating this for me. I've tried my own research on seemingly a ton of sources but none are overly clear to me.

Edit: Including an attempt to try and illustrate what I'm trying to do.

For the hyperlink expression in SSRS, I'm attempting with

="http://10.155.54.101/Update?CurrencyId="+Fields!CurrencyId.Value

Which generates the following error: [rsRuntimeErrorInExpression] the Hyperlink expression for the textbox 'Model' contains an error: Input string was not in a correct format. Which is strange because I've seen that format in other sources be referenced as correct. Eg. http://www.advancedssrs.com/2014/01/how-can-i-use-dynamic-hyperlinks.html

But either way, my c# codebehind for receiving the paramater (which I haven't been able to test yet) is as follows

if (Request.QueryString != null){
int CurrencyId = int.Parse(Request.QueryString["CurrencyId"]);
//Additional logic here
}

Am I roughly on the right track?

The value in the hyperlink needs to be a string. Convert the value using Cstr()

="http://10.155.54.101/Update?CurrencyId=" & Cstr(Fields!CurrencyId.Value)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM