将 MDX 和 SQL 数据集合并为一个以生成钻取报告?

发布于 2024-08-28 21:52:55 字数 166 浏览 2 评论 0原文

想知道我是否可以获得有关以下要求的一些建议和指导:

需要创建一个包含两个数据集(一个 MDX 和一个 SQL)的 SSRS 报告。然后,我需要连接这两个数据集来创建第三个数据集,该数据集将由钻取报告使用。

如何将这些数据集合并为一个并将其用作钻取报告的数据集?

谢谢!!

Wondering if I could get some advice and direction on this following requirement:

Need to Create a SSRS report with two datasets, one MDX and one SQL. I then need to join those two datasets to create a third dataset which is to be used by a drill though report.

How can I combine those datasets into one and use that as a Dataset for a drill-through report?

Thanks!!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

小女人ら 2024-09-04 21:52:55

您可以使用 T-SQL 存储过程来组合两个数据集。这不能在报告本身中完成。从报表中调用存储过程以获取钻取报表所需的第三个结果集。在存储过程中,您可以使用 OPENQUERY 函数调用 MDX 查询。您必须在使用 Analysis Services 提供程序的 SQL Server 机器上设置链接服务器,如下所示:

EXEC master.dbo.sp_addlinkedserver @server = N'AW2008', @srvproduct=N'SSAS', @provider= N'MSOLAP', @datasrc=N'', @catalog=N'Adventure Works 2008'

然后,您可以将 MDX 查询包装在 OPENQUERY 函数中,并通过引用双引号中的列从函数中选择“columnns” -像这样:

从 OPENQUERY(AW2008, '在 [Adventure Works] 的列上选择 [Measures].[Sales Amount]') 选择“[Measures].[Sales Amount]”

You can use a T-SQL stored procedure to combine the two datasets. It can't be done in the report itself. Call the stored procedure from the report to get the third result set that you need for the drillthrough report. Inside the stored procedure, you can use call an MDX query by using the OPENQUERY function. You'll have to set up a linked server on the SQL Server box that uses an Analysis Services provider, like this:

EXEC master.dbo.sp_addlinkedserver @server = N'AW2008', @srvproduct=N'SSAS', @provider=N'MSOLAP', @datasrc=N'', @catalog=N'Adventure Works 2008'

You can then wrap an MDX query in an OPENQUERY function, and select "columnns" from the function by referencing the column in double-quotes - like this:

select "[Measures].[Sales Amount]" from OPENQUERY(AW2008, 'select [Measures].[Sales Amount] on columns from [Adventure Works]')

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文