访问:每组页码

发布于 2024-11-05 11:33:23 字数 95 浏览 0 评论 0原文

我试图在每个组的页脚中获取“第 n 页,共 n 页”。 我可以获得每组的页码,但总页数不依赖于每组的记录数,因为根据一条记录的详细信息,可能会跨越多个页面。
这可能吗?

I am trying to get "Page n of n Pages" in the page footer for each group.
I can get the page number per group, but the total pages is not dependent on the number of records per group, because depending on the detail of one record, could span multiple pages.
Is this even possible?

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

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

发布评论

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

评论(3

夢归不見 2024-11-12 11:33:23

找到此页面,但您需要将原始[页面]声明保留在不可见的位置否则它无法正常工作。 ="页面" & [页面]& “的”& [页数]

Found this page, but you need to leave somewhere invisible the original [Page] declaration or else it doesn't work right. ="Page " & [Page] & " of " & [Pages]

小情绪 2024-11-12 11:33:23

我不确定这是否可能。您可能可以使用组的 OnFormat 事件中的代码来计算组中的页数,但在到达组的末尾之前,它不会准确。

我真的不认为这个问题有解决办法。

就其价值而言,这不是我曾经需要做的事情。一种解决方法是使用常规的“Page [Page] of [Pages]”表达式多次打印报告,每个组打印一次。如果你只有十几个小组,这不会是一个可怕的混乱。另一方面,如果您有数百个组,那就没有那么多了!

I'm not sure if this is possible. It may be that you can use code in the OnFormat event of your group to calculate the number of pages in the group, but it's not going to be accurate until you've reached the end of the group.

I really don't think there's a solution to this.

For what it's worth, it's not something I've ever needed to do. One workaround would be to print the report multiple times, once for each of your groups, using the regular "Page [Page] of [Pages]" expression. If you've got only a dozen or so groups, this wouldn't be an awful kludge. On the other hand, if you've got hundreds of groups, not so much!

夏天碎花小短裙 2024-11-12 11:33:23
Option Compare Database
Dim x As Integer

''''''''''''''' must be written in the header of your group 
Private Sub GroupHeader1_Format(Cancel As Integer, FormatCount As Integer)
Page = 1    
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''

''''''''''''''''''' paste this code in your page footer 
Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As Integer)

dalel_var.Value = Me!dalel_no
   ' to get the total number of rows in the table based on a specific "id" which we group data with it
 x = DCount("'[Me!dalel_no]'", "betakat_istath_alaam", "[dalel_no] = " & dalel_var.Value & "")

If x Mod 15 = 0 Then
x = ((x / 15) + 0.5) - 1 '' arrange your report details out of 15 rows per page
Else
x = ((x / 15) + 0.5)
End If
divide_txt = x            '''' divide_txt is a textbox in the report
End Sub
''''''''''''''''''''''''''
Option Compare Database
Dim x As Integer

''''''''''''''' must be written in the header of your group 
Private Sub GroupHeader1_Format(Cancel As Integer, FormatCount As Integer)
Page = 1    
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''

''''''''''''''''''' paste this code in your page footer 
Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As Integer)

dalel_var.Value = Me!dalel_no
   ' to get the total number of rows in the table based on a specific "id" which we group data with it
 x = DCount("'[Me!dalel_no]'", "betakat_istath_alaam", "[dalel_no] = " & dalel_var.Value & "")

If x Mod 15 = 0 Then
x = ((x / 15) + 0.5) - 1 '' arrange your report details out of 15 rows per page
Else
x = ((x / 15) + 0.5)
End If
divide_txt = x            '''' divide_txt is a textbox in the report
End Sub
''''''''''''''''''''''''''
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文