消除报表页脚之前的组页脚分页符

发布于 2024-07-27 18:16:56 字数 493 浏览 11 评论 0原文

我有一份带有组页眉和页脚的报告。 根据数据应该只有两组。 我将组页脚设置为在其后有一个分页符。 我不希望最后一个组在报表页脚之前创建分页符(如果我这样做,我会将报表页脚设置为在其之前有一个分页符。)。 我从未与其他报告撰写者遇到过这个问题。

报告打印输出而非设计的示例。 我的报表只有一个组页眉和一个组页脚:

报表页眉

组数据集 1 页眉 细节 细节 细节 组数据集 1 页脚

组数据集 2 标头 细节 细节 组数据集 2 页脚 ! 我不想要这个!

报告页脚(单独粘在最后一页)

发布在他们的板上:http://community .devexpress.com/forums/t/78705.aspx

I have a report with a group header and footer. There should be only two groups based on the data. I have the Group Footer set to have a page break after it. I don't want the last Group to create a page break before the Report Footer (If I did, I would set the report footer to have a page break before it.). I've never had this problem with other report writers.

Example of what the report printout looks like and not the design. My report only has one group header and one group footer:

Report Header

Group Data Set 1 Header
detail
detail
detail
Group Data Set 1 Footer

Group Data Set 2 Header
Detail
Detail
GroupData Set 2 Footer
! I don't want this!

Report Footer (stuck on last page by itself)

Posted on their board: http://community.devexpress.com/forums/t/78705.aspx

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

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

发布评论

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

评论(1

冬天的雪花 2024-08-03 18:16:56

这确定您何时到达报表末尾并阻止组页脚破坏页面。 它假定组页脚的 PageBreak 属性已设置为 PageBreak.AfterBand。

private void Report_DataSourceRowChanged(object sender, DataSourceRowEventArgs e) {
    if (e.CurrentRow == this.RowCount - 1)
        GroupFooter.PageBreak = PageBreak.None;
}

或者,您可以将组页眉和页脚的 PageBreak 属性设置为 PageBreak.None。 然后,当您打印第一组时,将其设置为每个组标题带之前的分页符,如下所示:

private void GroupFooter_BeforePrint(object sender, DataSourceRowEventArgs e) {
    if (GroupHeader.PageBreak == PageBreak.None)
        GroupHeader.PageBreak = PageBreak.BeforeBand;
}

由您选择哪种方法。 就我个人而言,我更喜欢第二个。 尽管我任意选择了 GroupFooter_BeforePrint 方法来订阅并进行此更改,但我仍然觉得这样做比依靠行计数来确定何时到达报表末尾更舒服。

This determines when you've reached the end of the report and stops the group footer from breaking the page. It assumes that your group footer's PageBreak property is already set to PageBreak.AfterBand.

private void Report_DataSourceRowChanged(object sender, DataSourceRowEventArgs e) {
    if (e.CurrentRow == this.RowCount - 1)
        GroupFooter.PageBreak = PageBreak.None;
}

Alternatively, you could set both your group header and footer's PageBreak property to PageBreak.None. Then when you're printing the first group, set it to page break before each group header band like so:

private void GroupFooter_BeforePrint(object sender, DataSourceRowEventArgs e) {
    if (GroupHeader.PageBreak == PageBreak.None)
        GroupHeader.PageBreak = PageBreak.BeforeBand;
}

It's up to you which method to choose. Personally I like the 2nd one better. Even though I arbitrarily picked the GroupFooter_BeforePrint method to subscribe and make this change, I would still feel more comfortable doing that than relying on row counts to determine when you've reached the end of the report.

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