How do you populate an SSRS TextBox with a DataSet value?

后端 未结 1 1041
闹比i
闹比i 2021-02-13 14:29

Dear community member,

Given a specific Key (e.g. \"user_name\"), how does one populate an SSRS TextBox with the corresponding DataSet

相关标签:
1条回答
  • 2021-02-13 15:27

    Using a Dataset called HeaderData like:

    enter image description here

    I have a couple of textboxes in a report header:

    enter image description here

    Where the expression above is:

    =Max(IIf(Fields!Key.Value = "user_name"
      , Fields!Value.Value, Nothing)
      , "HeaderData")
    

    This is working OK:

    enter image description here

    This works as it uses the IIf expression to NULL out any values other than when Key = user_name, then takes the Max of the non NULL Value values.

    Since you're referencing a Dataset outside of a tablix you need a Scope and an aggregate - I'm using Max to ignore NULL values, which something like First will not do. Judging by your description there should only ever be one non NULL value there so it should be fine.

    0 讨论(0)
提交回复
热议问题