使用迭代参数的 SSRS 创建报告

发布于 2024-12-26 14:53:29 字数 607 浏览 2 评论 0原文

我正在修改现有的报告,该报告设置为让您查看每个销售代表的统计信息。您可以通过更改报表视图中的参数销售代表来完成此操作。

我需要修改报告,以便它可以为每个销售代表显示一个页面。然后,该数据将导出到 Excel,每个销售代表的统计数据将显示在单独的选项卡中。

我对此进行了研究,发现人们在谈论迭代报告,但我认为他们所指的并不是我所要求的:
http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/27ffabcc-6286-4fed-a8bf-0e5d78560be3
http://jameskovacs.com/2005/08/04/深入挖掘报告服务/

I am modifying an existing report which is setup to let you view statistics per sales rep. You do this by changing the parameter sales rep in the report view.

I need to modify the report so that it can display a page for each sales rep. This will then be exported to Excel with each sales rep statistics being displayed in a separate tab.

I have researched this and found people talking about iterating over a report but I don't think that what they are referring too is what I am asking:
http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/27ffabcc-6286-4fed-a8bf-0e5d78560be3
http://jameskovacs.com/2005/08/04/digging-deep-into-reporting-services/

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

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

发布评论

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

评论(2

琉璃梦幻 2025-01-02 14:53:29

您可以通过多种方式完成此操作,因此这里有 1 个建议

  • 的所有销售代表的(唯一)集,
  • 创建一个新的 Tablix 报表,其查询返回按销售代表分组
  • 没有详细信息行,但在组页脚/页眉中添加一个子
  • 报表子报表将是您已经在使用的报表,它的参数将是主报表查询中
  • 为该组设置分页符的 sales_rep 值

You can accomplish this several ways, so here is 1 suggestion

  • Create a new tablix report whose query returns a (unique) set of all sales reps
  • group by sales rep
  • there is no detail row, but in the group footer/header add a subreport
  • the subreport will be the report you already are using and it's parameter will be the sales_rep value from your main report query
  • set page breaks for the group
烂柯人 2025-01-02 14:53:29

我能想到的主要方法是将参数传递到存储过程中,并在其中使用逻辑将您想要的所有可能结果与用于对各部分进行分组的字段联合在一起。

例如,如果他们有“报告部分”的参数并选择了“1,2,3”,那么您可以将该参数传递给存储过程;它内部使用 SplitString 例程将逗号转换为表格式,然后构造另一个临时表来保存结果。所有内容都通过一个SectionNumber 字段(1、2、3 等)累积到那里,然后全部返回。您的小组在此基础上进行分组,并设置分页符,仅此而已。

The main way I can think of doing it is to pass the parameters into the stored procedure, and in there have logic to UNION together all the possible results you want with a field for grouping the sections.

For example if they had a parameter for "Report Sections" and had selected "1, 2, 3", then you pass the parameter to the stored procedure; inside it uses a SplitString routine to convert the commas into a table format, and then constructing another temp table to hold the results. Everything is accumulated into there with a SectionNumber field (1, 2, 3, etc), and then the whole lot gets returned. Your group groups on that, with page break set, and that's it.

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