简体   繁体   中英

Microsoft Report Builder: How to display selected chosen values from a multi-value parameter in a table?

I'm using MS Report Builder v3.0 to create a report. As part of this report, I have a multi-valued parameter (named @Diagnoses). The labels and some of the values (truncated by the size of the display boxes) of this parameter are shown below:

在此处输入图像描述

What I would like to be able to do is display the labels / values the user chooses in a 2-column tablix (I've tried using separate textboxes for the labels / values but the results are mis-aligned).

However, this does not appear to be straightforward. The closest method I've found is this one , which stores the user's choices in an internal parameter in xml format, then queries this parameter to produce a dataset from the xml.

So, I created the xml-producing internal parameter like this:

在此处输入图像描述

...and I've created a dataset based on this data, with the following query:

在此处输入图像描述

But now when I put these values into a tablix, the labels and values are now on separate rows, like this:

在此处输入图像描述

Does anyone have a straightforward way of sorting this out?

Best Wishes

C J

OK - I've solved it (it's not pretty, but it works!)

Basically, the problem comes from having to use the join statement when creating the xml - you can't really put both the label information and the value information on the same row in the xml.

To get round this, you have to use two internal parameters to create two datasets - one for the labels column, one for the values column. The method for creating these is essentially the same as that shown above, except for the values parameter, the expression for the default value is:

在此处输入图像描述

...and for the labels parameter, it's this:

在此处输入图像描述

(by the way, make sure you set the available values to "None" for internal / hidden parameters - the expressions here are for the default values)

Then, when you create the values dataset, you use the following syntax in its query:

在此处输入图像描述

...and similarly for the labels dataset.

Finally, in the report, you create one matrix from each of the two datasets, then put them next to each other, using fixed row heights and setting "can shrink" / "can grow" to false so that they look like they're in the same table:

在此处输入图像描述

I hope this helps somebody!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM