I'm using SSRS 2008R2 and i try to get single value from dataset to use it as default value of report's parameter.
Dataset filled with this query:
select distinct
o.organization_id,
o.mean_name,
o.short_name
from
dbo.organization o
inner join
dbo.identifier i on i.organization_id = o.organization_id and
i.market <> 3
I have report's parameter organization_id
, whose value user selects. And now I want get value of field short_name
from dataset where field organization_id
equal to parameter organization_id
. But I can't do this.
I tried to use Lookup
function like this:
=Lookup(Fields!organization_id.Value, Parameters!organization_id.Value, Fields!short_name.Value, "dsOrganizations")
, but server gave me error "Fields cannot be used in report parameter expressions".
I tried to make variable with this Lookup
function, but variables can't be used in report parameters.
And now I have no idea how set parameter default value from dataset. I will welcome any tips or suggestions.