Search code examples
reporting-servicesssrs-2008

Drillthrough parameter value from a Lookup()


Hello I am trying to pass a Looked-Up Value as drillthrough parameter to a subreport. I have two Datasets Dataset1 and Dataset2. My tablix looks like this

=Fields!Number.Value 'Column1 expression (Dataset1)
=Lookup(Fields!Number.Value, Fields!NumberKey.Value, Fields!Order.Value, "Dataset2") 'Column2 expression (Dataset2)

Column1    Column2
1          123
2          678

Now I want to use the value from Column2 as drillthrough parameter. Under the option Action -> Go to report I already tried different approaches, but none would work. For the parameter passing value I tried:

=Lookup(Fields!Number.Value, Fields!NumberKey.Value, Fields!Order.Value, "Dataset2")
=Lookup(Fields!Number.Value, Fields!NumberKey.Value, Fields!Order.Value, "Dataset2").Value
=Lookup(Fields!Number.Value, Fields!NumberKey.Value, Fields!Order.Value, "Dataset2").UniqueName
=ReportItems!OrderTextbox.Value
=ReportItems!OrderTextbox.UniqueName

Is this even possible? Thanks in advance :-)


Solution

  • I found the solution. The names of the parameters (internal) are different, because of the Lookup. The name of the parameter I passed is

    [OrderDimension].[OrderNumber].&[001234] 
    

    the name of the subreport parameter is

    [Orders].[OrderNr].&[001234]
    

    This didnt work, even if the same value existed in both. I solved it when I wrote the passing parameter value like this

    ="[Orders].[OrderNr].&[" & Lookup(Fields!Number.Value, Fields!NumberKey.Value, Fields!Order.Value, "Dataset2") & "]"