报表ID列超链接控制及主报表向IdDataReport传参问题咨询
Let's work through your two SSRS problems step by step—these are typical pitfalls when setting up conditional report actions!
Problem 1: Hyperlink (hand cursor) shows for all ID values, even when isactive=false
The issue here is twofold: your current expression has a logic flaw, and you're not tying visual link styling to the conditional action. Here's how to fix it:
Correct the "Go to report" expression
Your current check forIsNothing(Fields!isActive.value)=Trueisn't ideal for a boolean field (sinceisactiveis a bit/boolean type, it should be eithertrue/falseunless your schema allows nulls). Update the expression in Actions → Go to report → fx to:=IIF(Fields!isActive.Value = True, "IdDataReport", Nothing)If
isactivecan be null in your data, adjust it to handle that edge case:=IIF(NOT IsNothing(Fields!isActive.Value) AND Fields!isActive.Value = True, "IdDataReport", Nothing)Match visual styling to the condition
Even with the corrected action expression, SSRS might still show the link cursor if the text box has default link styling. Fix this by setting conditional formatting on the ID text box:- Go to Font → Color → fx, use:
=IIF(Fields!isActive.Value = True, "Blue", "Black") - Go to Font → Text Decoration → fx, use:
=IIF(Fields!isActive.Value = True, "Underline", "None")
Now only active IDs will look like links and show the hand cursor.
- Go to Font → Color → fx, use:
Problem 2: Clicking the ID doesn't jump to IdDataReport with the correct data
You're missing a critical step: passing the selected ID as a parameter to IdDataReport. Here's how to set that up:
Verify
IdDataReporthas a parameter
Make sureIdDataReporthas a parameter (e.g., named@SelectedId, data type matching yourIdcolumn) that filters its dataset. The dataset query should look something like:SELECT Id, fName, lName, isActive FROM Table1 WHERE Id = @SelectedIdAdd parameter mapping in
Mainreport
Back inMainreport's ID text box Actions → Go to report:- Below the report name expression, click Add Parameter
- In the "Parameter name" dropdown, select the parameter from
IdDataReport(e.g.,@SelectedId) - In "Parameter value", enter the expression
=Fields!Id.Valueto pass the current row's ID
Double-check report name spelling
Ensure the report name in your expression exactly matches the name ofIdDataReportin your project (SSRS is case-sensitive in some environments, so watch for typos!).
After making these changes, preview Mainreport—only active IDs will have clickable links, and clicking them will open IdDataReport filtered to the selected ID.
内容的提问来源于stack exchange,提问作者Dinesh

