.net Crystal Reports - 如何重置每个组的页数?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3199346/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Crystal Reports - How do I reset the page count for each group?
提问by Brian Webster
How do I reset the page count per group in my report?
如何重置报告中每组的页数?
Each group contains about 5-7 pages worth of data.
每组包含大约 5-7 页的数据。
回答by
One way of resetting the page number on change of group is to check the "Reset Page Number After" option in the section expert for the group footer, in the Crystal Reports Designer.
在组更改时重置页码的一种方法是在 Crystal Reports 设计器的组页脚部分专家中选中“重置页码之后”选项。
回答by Brian Webster
1st Formula: HeaderReset - This formula should be placed in the page header of the report. It will reset the counter when the report is processed to the next page. Counter is a variable that stores the number as the report processes each record.
第一个公式:HeaderReset - 此公式应放置在报告的页眉中。当报告处理到下一页时,它将重置计数器。Counter 是一个变量,用于在报表处理每条记录时存储数字。
WhilePrintingRecords;
NumberVar counter:=0
2nd Formula: CountDetails - This formula should be placed in the Details section. It will count each record and increment by one.
第二个公式:CountDetails - 这个公式应该放在细节部分。它将计算每条记录并加一。
WhilePrintingRecords;
NumberVar counter;
counter:=counter+1
You will now need to use the CountDetails formula to force the new page based on the necessary number of records. To do this: bullet
您现在需要使用 CountDetails 公式根据必要的记录数强制创建新页面。要做到这一点:子弹
Go to Format/Section and select the Details section. bullet
转到格式/部分并选择详细信息部分。子弹
Click on the X+2 button to the right of the "New Page After" option. Be sure not to place a check in the New Page After box. Once you click on the button, you will be placed in the formula editor. Enter the following formula:
单击“New Page After”选项右侧的 X+2 按钮。确保不要选中“新建页面之后”框。单击该按钮后,您将进入公式编辑器。输入以下公式:
{@CountDetails}=7 (enter the number of records you need on each page) bullet
{@CountDetails}=7(输入每页需要的记录数)bullet
This condition will force a new page when Crystal reaches the seventh record in the details section. The count will reset to zero at the beginning of each page due to the @HeaderReset formula.
当 Crystal 到达详细信息部分中的第七条记录时,此条件将强制换页。由于@HeaderReset 公式,计数将在每个页面的开头重置为零。
If you need to count the Group Header records instead of the Details section, follow the above instructions for the details section, but place the formula and condition in the Group Header section instead of the Details section.
如果您需要计算 Group Header 记录而不是 Details 部分,请按照上面详细信息部分的说明进行操作,但将公式和条件放在 Group Header 部分而不是 Details 部分。
To hide the formula fields in the header and details section, right click on the field and go to format font. Change the color to white and you will not be able to see them.
要隐藏标题和详细信息部分中的公式字段,请右键单击该字段并转到格式字体。将颜色更改为白色,您将无法看到它们。

