How do I use the InScope function in an expression of an RDL report?
Posted on 2009-05-08
I am creating an RDL report, using SQL Server 2008.
On my report, I need to display a constant list of interests. I need to identify within this constant list of interests which interests are "selected" or "chosen". I currently have two seperate stored procedures set up, one to list all available interests, and another to list all the interests "selected" by a particular person. I would like to re-use these 2 stored procedures, so I have set up 2 datasets in my report over these appropriate stored procedures, "AllInterests" (get all interests) and "EntityInterests" (get interests for a speicfic person).
I created a matrix table, with the dataset equal to "AllInterests". In a field in this table, I added an expression: =IIf(InScope("EntityInterests"), "Y", "N"). I was hoping that this would then put a "Y" in this field if the current "all interest" row in the table was included in the "EntityInterest" list; otherwise display a "N" in this field.
But this is not working; it is returning "N" for me all the time. Am I not using the InScope function properly? Or is there a better way to accomplish this without using the InScope function? I am very new to RDL reporting; this is acutally the first report i have ever created in RDL. Any suggestions would be appreciated.