代码之家  ›  专栏  ›  技术社区  ›  JeffO

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

  •  1
  • JeffO  · 技术社区  · 17 年前

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

    报表标题

    细节 细节 组数据集1页脚

    细节 细节 GroupData集2页脚

    报表页脚(自己卡在最后一页上)

    张贴在他们的董事会上: http://community.devexpress.com/forums/t/78705.aspx

    1 回复  |  直到 17 年前
        1
  •  5
  •   Kyle Gagnet    17 年前

    这将确定何时到达报告末尾并阻止组页脚打断页面。它假定组页脚的PageBreak属性已设置为PageBreak.AfterBand。

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

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

    选择哪种方法取决于你。就我个人而言,我更喜欢第二个。尽管我随意选择了GroupFooter\u BeforePrint方法来订阅并进行此更改,但与依靠行数来确定何时到达报告末尾相比,我仍然觉得这样做更舒服。

    推荐文章