具有来自“当前记录”的值的RDLC报告页脚

发布于 2025-01-05 08:48:52 字数 551 浏览 0 评论 0原文

我不知道这是否可能,但我想我会问。很多时候,报告需要数据分组,以便将一些摘要信息(例如发票)锚定到报告底部。您不希望总数仅基于 2 个详细信息行而向上移动,而另一个则包含 20 个详细信息行。我尝试使用绑定到数据源的 Tablix 进行输出,但无法完全正确...它会要么向上移动,要么强制中断并出现在下一页的顶部。

因此,如果有人有一些想法来帮助解决这个问题,那就太好了。

我的第二种方法是仅使用简单的报告页脚。然而,整个“报告”页面在技术上并不“绑定”到任何数据源。因此,如果我在页脚中放置一个文本框并希望它显示某些内容,我无法选择“与 Tablix 关联的数据源中的最新行”,它总是需要一个聚合,例如

=First(Fields!SomeField.Value, "SomeDataSource" )
=Sum( ...
=Last( ...   
etc...

我只是希望它具有无论是最新的...所以我尝试使用报告变量来创建一个报告变量,并考虑让它在处理的每一行中进行更新,因此它总是具有“最新”值,我可以将该值转储到报告底部。

对任何一个的任何建议都会很棒。谢谢。

I don't know if its possible or not, but thought I'd ask. Many times reports need data grouping to have anchored to the bottom of the report some summary information, such as invoices. You don't want the totals shifting UPwards based on only 2 detail lines vs another with 20. I've tried working with using the Tablix bound to the data source for the output but couldn't get it quite right... It would either shift up, or force break and appear at top of following page.

So, if anyone has some ideas to help resolve that, that too would be great.

My second approach was to just use a simple report page footer. However, the overall "Report" page is not technically "BOUND" to any datasource. So, if I put a textbox in the footer and want it to show something, I can't pick "the most recent row from the datasource associated with the Tablix", it always requires an aggregate, such as

=First(Fields!SomeField.Value, "SomeDataSource" )
=Sum( ...
=Last( ...   
etc...

I just want it to have whatever was the most recent... so I tried to use report variables to create one and was thinking to have it get updated per row being processed, so it always had whatever the "latest" value was and I could just dump that value at the bottom of the report.

Any suggestions to either would be great. Thanks.

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

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

发布评论

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

评论(2

傲性难收 2025-01-12 08:48:52

我知道这是一个老问题,但我有一个非常相似的问题并提出了一个独特的解决方案。我有一份对账单,即使对账单行项目换行到另一页,也需要在页面底部打印付款单。我通过以下方法解决了这个问题:

  • 使报告中的所有行具有统一的高度。
  • 计算需要多少行来填充页面(减去我的付款单的高度。
  • 获取对帐单中的行项目数。
  • 计算将我的付款单推到页面底部所需的剩余行数。
  • 添加子报告,其中包含计算出的空白行数,以填充行项目和付款单之间的必要空间。

这种方法的优点是我可以为多个客户生成账单,并且由于填充是组的一部分。将根据每个客户的账单进行定制并将每个工资单底部对齐,

您可以使用类似的方法将“页脚”信息推送到页面底部,因为它仍然位于数据组内,因此您可以访问数据值。你也需要。

I know this is an old question, but I had a very similar problem and came up with a unique solution. I had a statement that needed to have the payment slip print at the bottom of the page even if the statement line items wrapped over to another page. I solved it by:

  • Making all rows in the report a uniform height.
  • Calculating how many rows were required to fill the page (minus the height of my payment slip.
  • Getting the number of line items in the statement.
  • Calculating the remaining number of rows needed to push my payment slip to the bottom of the page.
  • Adding a sub-report with the calculated number of blank rows to pad out the necessary space between the line items and the payment slip.

The advantage of that approach was that I could generate bills for multiple customers, and since the padding is part of the group it would be customized for each customer's bill and bottom-justify the pay slip for each of them.

You can use a similar approach to push your "footer" info to the bottom of your page. Since it is still inside of your data group you'll have access to the data values you need as well.

画▽骨i 2025-01-12 08:48:52

在页脚中,您可以引用报告正文中的报告项目,如下所示:

=ReportItems!myFooterValueTextBox.Value

问题是您只能引用页脚中的一个报告项目,因此您可能需要在表格中添加不可见的页脚行并将所有总计连接到该行中的一个单元格 (myFooterValueTextBox):

=First(Fields!SomeField.Value, "SomeDataSource") + "|" +
 Sum(...) + "|" + .... +
 Last(...)

我在示例中使用管道作为分隔符,因此在页脚中,我将拆分字符串并将值放入适当的容器中,如下所示:

=Split(ReportItems!myFooterValueTextBox.Value,"|")(0)

In the footer you can refer to report item from report body, like this:

=ReportItems!myFooterValueTextBox.Value

The catch is that you can refer to only one report item in your footer, so you may need to add invisible footer row in your table and concatenate all your totals into one cell (myFooterValueTextBox) in that row:

=First(Fields!SomeField.Value, "SomeDataSource") + "|" +
 Sum(...) + "|" + .... +
 Last(...)

I used pipe as deliminator in my example, so then in the footer, I would split the string and place values in appropriate containers, like this:

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