简体   繁体   English

从参数数据集中返回的SSRS 2012极限值

[英]SSRS 2012 limit values returned from parameter dataset

Running SSRS2012. 运行SSRS2012。 We report using cubes, so I cannot change the MDX/Query code. 我们使用多维数据集进行报告,因此无法更改MDX /查询代码。

I have a simple query from a Client cube: Client.ClientID, Client.ClientName, Client.ClientAddress 我有一个来自Client多维数据集的简单查询:Client.ClientID,Client.ClientName,Client.ClientAddress

I have used the Query Designer to add ClientID as a parameter. 我已经使用查询设计器添加ClientID作为参数。
SSRS has automatically: SSRS自动具有:

  • created the parameter in the Report Designer @ClientClientID 在报表设计器@ClientClientID中创建了参数
  • created the parameter dataset 创建参数数据集
  • added the parameter under the parameter tab in the Client dataset 在客户端数据集中的“参数”选项卡下添加了参数

This is expected behaviour and the report runs as expected, prompting me to choose a value from the list. 这是预期的行为,报告按预期运行,提示我从列表中选择一个值。 If I do, it returns the data for the single client I'm after. 如果我这样做,它将返回我所追寻的单个客户端的数据。

This is my problem. 这是我的问题。

Although it works, the list of values returned is very long and so is difficult to use. 虽然可以,但是返回的值列表很长,因此很难使用。 Users will only be running this report for one client at a time so they'd like to type in the single client id and run the report. 用户一次只能为一个客户端运行此报告,因此他们想输入单个客户端ID并运行该报告。

I've tried everything I can think of. 我已经尝试了所有我能想到的。

The closest I've come is adding another parameter @PreFilter and using that as a filter on the parameter dataset. 我最接近的是添加另一个参数@PreFilter并将其用作参数数据集上的过滤器。

However, to the user it's terrible. 但是,对于用户而言,这是可怕的。 They're prompted to type the client id into @PreFilter, then they have to wait an age (as the parameter dataset is filtered) and then they select the exact same client id from the @ClientClientID parameter prompt. 提示他们在@PreFilter中键入客户端ID,然后必须等待一个年龄(因为过滤了参数数据集),然后从@ClientClientID参数提示符下选择完全相同的客户端ID。

I've even specified the default value of @ClientClientID to be @PreFilter, but they're still prompted to Select a value . 我什至将@ClientClientID的默认值指定为@PreFilter,但是仍然提示他们选择一个值

There must be a better way! 一定会有更好的办法!

Sounds to me like a data modelling issue. 在我看来,这就像一个数据建模问题。 Probably the ClientId in parameter is taken directly from the fact table instead of from Client dimension. 参数中的ClientId可能直接从事实表中获取,而不是从Client维中获取。 If the data is properly modelled eg star schema having separate facts and dimensions the retrieving of client data should be faster. 如果对数据进行了适当的建模(例如,具有不同事实和维度的星型模式),则客户端数据的检索应该更快。

Finally - a much better way. 最后-更好的方法。

  1. From the Report Design Page 从报告设计页面
  2. Ensure that the Report Data pane is showing (if not, click on the View menu and click on Report Data option) 确保显示“报告数据”窗格(如果没有显示,请单击“查看”菜单,然后单击“报告数据”选项)
  3. From the Report Data menu, expand the Parameters folder (click the + button) 从“报告数据”菜单中,展开“参数”文件夹(单击“ +”按钮)
  4. There will be a parameter that has been automatically created when you click "Parameter" against the ClientID in Query Designer (along with the auto-created parameter dataset). 在查询设计器中对ClientID单击“参数”时,将自动创建一个参数(以及自动创建的参数数据集)。
  5. Right click this parameter (@ClientClientID) 右键单击此参数(@ClientClientID)
  6. Select Parameter Properties 选择参数属性
  7. Set the Available Values option to "None" 将“可用值”选项设置为“无”
  8. Set the Default Values option to "None" 将“默认值”选项设置为“无”
  9. Click OK 点击确定
  10. From the Report Data pane, expand the Datasets folder (click the + button) 在“报告数据”窗格中,展开“数据集”文件夹(单击“ +”按钮)
  11. Right click on each dataset (except for the auto-created parameter dataset) 右键单击每个数据集(自动创建的参数数据集除外)
  12. Click on Dataset Properties 单击数据集属性
  13. Click on Parameters menu item (left hand side) 单击“参数”菜单项(左侧)
  14. Under the Parameter Name you will see ClientClientID listed. 在“参数名称”下,您将看到列出的ClientClientID。
  15. Under the Parameter, you will see a drop down box with @ClientClientID. 在“参数”下,您将看到一个带有@ClientClientID的下拉框。 You will need to change this 您将需要更改此
  16. Click on the Fx button next to @ClientClientID 单击@ClientClientID旁边的Fx按钮
  17. Replace =Parameters!ClientClientID.Value with ="[Client].[ClientID].&[" + Parameters!ClientClientID.Value + "]" 用=“ [Client]。[ClientID]。&[” + Parameters!ClientClientID.Value +“]”替换= Parameters!ClientClientID.Value。
  18. Click OK You should be good to go. 单击“确定”。您应该一切顺利。

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

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