简体   繁体   English

SSRS 多值参数

[英]SSRS Multi Value Parameter

I have a report having two tab-lix and also two data set(eg=dataset1,dataset2) for each tab-lix.我有一个报告,每个 tab-lix 都有两个 tab-lix 和两个数据集(例如=dataset1,dataset2)。 When i am generating report by passing the multiple parameter location id(38,39 & 40) value if there is no record of id-38 in dataset2 i want blank space but in my report it is showing report of 39. But i want if there is no data in data set based on the parameter it is showing only blank space.Because always dataset1 having data and so it showing properly.When i am generating report with multiple parameter(38,39,40) it showing tablix1 of 38 parameter but tablix2 of 39 parameter in on page because of there is no data in dataset2 of 38 parameter.So i want to display a blank space on behalf of tablix2 if there is no data.当我通过传递多个参数位置 id(38,39 & 40) 值生成报告时,如果数据集 2 中没有 id-38 的记录,我想要空格,但在我的报告中它显示 39 的报告。但我想要如果数据集中没有基于参数的数据,它只显示空白。因为数据集1总是有数据,所以它显示正确。当我生成带有多个参数(38,39,40)的报告时,它显示了38个参数的tablix1但是页面上有39个参数的tablix2,因为38个参数的dataset2中没有数据。所以如果没有数据,我想代表tablix2显示一个空格。

Give me a solution.给我一个解决方案。

This answer assumes you have a table that contains all locations eg DimLocations , if not you should consider creating one.这个答案假设您有一个包含所有位置的表,例如DimLocations ,如果没有,您应该考虑创建一个。

You can then change your dataset query to be something like.然后,您可以将数据集查询更改为类似的内容。

SELECT loc.LocationID, t.SomeColumn, t.AnotherColumn
    FROM DimLocations loc
        LEFT JOIN myTable t ON loc.LocationID = t.LocationID
    WHERE loc.LocationID IN(@myLocationParameter)

This will ensure that you get a record for each location as long as it appears in the DimLocations table.这将确保您获得每个位置的记录,只要它出现在DimLocations表中。

If this does not help, edit your question to show the dataset query you are using now and the structure of your locations table (if you have one)如果这没有帮助,请编辑您的问题以显示您现在使用的数据集查询以及您的位置表的结构(如果您有)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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