reporting-services - Microsoft Report Builder:如何从表中的多值参数中显示选定的值?
问题描述
我正在使用 MS Report Builder v3.0 创建报告。作为本报告的一部分,我有一个多值参数(名为@Diagnoses)。这个参数的标签和一些值(被显示框的大小截断)如下所示:
我想要做的是在 2 列 tablix 中显示用户选择的标签/值(我尝试使用单独的文本框作为标签/值,但结果未对齐)。
然而,这似乎并不简单。我找到的最接近的方法是this,它将用户的选择存储在 xml 格式的内部参数中,然后查询此参数以从 xml 生成数据集。
因此,我像这样创建了生成 xml 的内部参数:
...我已经根据这些数据创建了一个数据集,并带有以下查询:
但是现在当我将这些值放入 tablix 时,标签和值现在位于不同的行上,如下所示:
有没有人有一个简单的方法来解决这个问题?
最好的祝愿
CJ
解决方案
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!
推荐阅读
- c# - DICOM多平面图像重建
- python - 如何为 PyTorch Estimator 指定 python==3.6.8(conda_packages 不够)
- wordpress - 在帖子网格中悬停时显示不同的图像
- qt - 如何将本地 Qt 项目与 Google Test 集成?
- amazon-s3 - 在python中使用s3 select解析多个镶木地板文件?
- dvd-burning - 如何在Windows10上制作虚拟光盘
- scala - 使用带有列表的 Scala 匹配案例
- docker - 运行 eval $(minikube docker-env) 后运行 docker ps 时遇到 x509 错误
- python - DEBUG=True 的 Django 错误页面比日志记录更详细
- bluetooth-lowenergy - com.polidea.rxandroidble2.exceptions.BleScanException:扫描失败,因为应用程序注册失败(代码 6)三星 Galaxy 8