来自多维数据集参数的 SSRS 报告:文本输入字段而不是下拉菜单

SSRS report from cube parameter: text input field instead of drop-down menu

下午好,

我是 MDX 的新手。使用 Report Builder 我创建了基于多维数据集数据的 SSRS 报告。一切看起来都很好,我也可以为此报告添加一个参数,但问题是我只能设法让它作为下拉菜单工作。我真正需要的是它以典型的 SSRS 方式工作——文本输入字段。

所以搜索信息时,我得到的印象是实现此目的的唯一方法是修改数据集的 MDX 查询并将所需字段设置为 StrToMember。我找到的最相关的例子是 this one。以我所掌握的知识,互联网上的其他例子对我帮助不大。

我的问题是:有了这个查询,where/how 我应该使用 StrToMember 才能将字段 [Inventory information].[Parent Item].[Parent Item] 用作自由文本参数吗?

SELECT { } ON COLUMNS, { 
    ([Inventory information].[BOM].[BOM].ALLMEMBERS * 
    [Inventory information].[Item number].[Item number].ALLMEMBERS * 
    [Inventory information].[Line number].[Line number].ALLMEMBERS * 
    [Inventory information].[Parent Item].[Parent Item].ALLMEMBERS * 
    [Inventory information].[Product name].[Product name].ALLMEMBERS * 
    [Inventory information].[Quantity].[Quantity].ALLMEMBERS * 
    [Inventory information].[Sequence].[Sequence].ALLMEMBERS )}
        DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS 
        FROM [Inventory analysis] CELL PROPERTIES VALUE

此查询没有 return 任何错误,但同时它从数据集中删除了所有字段。

SELECT { } ON COLUMNS, { 
    ([Inventory information].[BOM].[BOM].ALLMEMBERS * 
    [Inventory information].[Item number].[Item number].ALLMEMBERS * 
    [Inventory information].[Line number].[Line number].ALLMEMBERS * 
    StrToMember ('[Inventory information].[Parent Item].[Parent Item].&[' + @InventoryinformationParentItem + ']') *
    [Inventory information].[Product name].[Product name].ALLMEMBERS * 
    [Inventory information].[Quantity].[Quantity].ALLMEMBERS * 
    [Inventory information].[Sequence].[Sequence].ALLMEMBERS )}
        DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS 
        FROM [Inventory analysis] CELL PROPERTIES VALUE

您的数据集未识别您的 MDX 脚本返回的字段。我认为您没有在设计器中定义参数。添加设计器的参数。

尝试不带关联参数的查询。

SELECT { } ON COLUMNS, { 
    ([Inventory information].[BOM].[BOM].ALLMEMBERS * 
    [Inventory information].[Item number].[Item number].ALLMEMBERS * 
    [Inventory information].[Line number].[Line number].ALLMEMBERS * 
    StrToMember ("[Inventory information].[Parent Item].[Parent Item].&[" + "SomeString" + "]") *
    [Inventory information].[Product name].[Product name].ALLMEMBERS * 
    [Inventory information].[Quantity].[Quantity].ALLMEMBERS * 
    [Inventory information].[Sequence].[Sequence].ALLMEMBERS )}
        DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS 
        FROM [Inventory analysis] CELL PROPERTIES VALUE

此外,我不确定您发布的父项属性中的语法。

试试这个:

StrToMember ("[Inventory information].[Parent Item].&[" + "SomeString" + "]")

如果这对你有帮助,请告诉我。