水晶报表 - 如果页面上没有记录,则隐藏页眉 [英] Crystal Reports - Hide page header if there in no record on a page

查看:356
本文介绍了水晶报表 - 如果页面上没有记录,则隐藏页眉的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果最后一页上没有记录(详情部分),如何隐藏页眉。

How to hide a page header if there is no record(details section) on last page. Page header must be shown on last page if there is some data on last page otherwise hide the page header.

Formaula pagenumber = totalpagecount

Formaula pagenumber = totalpagecount won't work as it will always suppress the last page's header.

推荐答案

将此公式放入禁止字段中在详细部分:

Put this formula in a suppressed field in the detail section:

WhilePrintingRecords;
Global BooleanVar finished;
finished := OnLastRecord

并且在页眉中禁用公式:

And make this the Suppress formula in the page header:

Global BooleanVar finished


$ b b


  • 完成之前已初始化页面标题。

  • 记录将被设置为 false

  • 当最终到达最后一个细节部分时, / code>设置为 true

  • 如果您碰巧到达另一个页眉,

    • Before finished is initialized the page header will show.
    • Once you print a detail record it'll be set to false.
    • When you finally reach the last detail section, finished is set to true.
    • If you happen to reach another page header, finished is still true, and Crystal will suppress the header.
    • 这是一个有趣的问题。我以前遇到过这个行为,但从来没有试图解决它。我想你需要使用一个变量,因为在页眉,通常的选项像 Next() OnLastRecord 可以不区分有多个记录要打印,没有更多记录要打印。我认为运行总计会有同样的问题 - 在一个页面上的值将是一样的打印一个更多的记录,并在一个页面没有记录打印。

      It's an interesting problem. I've encountered this behavior before but never tried to solve it. I think you need to use a variable because in a page header, the usual options like Next() and OnLastRecord can't distinguish between having one more record to print and having no more records to print. I think running totals would have the same problem – the values would be the same on a page with one more record to print, and on a page with no records to print.

      这篇关于水晶报表 - 如果页面上没有记录,则隐藏页眉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆