Home > Back-end >  Fastreport multiple page each page page display problem?
Fastreport multiple page each page page display problem?

Time:10-07

1, a report file contains more than one Page,
2 Page1, corresponding to the first data set
3, page2, corresponding to the second data set
4, print out the first data set to print the second data set, how to print the second page, the page number from 1? Such as the first page for page 2, the second page for page 3. Display as follows respectively, 1/2, 2/2, 1/3 two-thirds. 3/3.
How to do?

CodePudding user response:

This estimate yourself to write code implements,

CodePudding user response:

The situation here is suitable for the FastReport2.53 version,

Report page usually just like in the Word don't have any brains, FastReport variables can be obtained directly from the system, but special cases cannot be easily obtained,

And talking about the problem of group page, here is the report group, the first is each grouping forced paging, and page Numbers to count, such as five pages are divided into two groups, one group of page 2, another group of three pages, usually show as long as the

1/5 2/5 3/5 4/5 5/5

At this time to become

1/2 2/2 1/3 two-thirds 3/3



What page it is easy to calculate, using a variable to indicate the page number, after the group have to do is to calculate the page number, the difficulty in group pages, the basic idea is to use two statements, for the first time for each group of the total number of pages, and the second display,



First three variables, GPage initial value is used to represent the page number 1, PageList used to store the grouping the page number is {0} the initial value, grouping GIndex used to calculate the index of the initial value is 0, FGIndex used to second traversed grouping index calculation, actually this with GIndex can share a, but separately for clarity,



Write in PageFooter BeforePrint

GPage:=GPage + 1;

Write in GroupFooter BeforePrint

If FinalPass then//secondary traversed increase grouping index

FGIndex:=FGIndex + 1

The else

The begin

SetLength (PageList GIndex + 1);

PageList: [GIndex]=Gpage;//storage grouping the total number of pages of

GIndex:=GIndex + 1;

end;

GPage:=0;



So all things have, fill in the display page of the Memo/GPage,

Under the display page Memo script written paragraph

If not FinalPass then exit;

MemoPageCount. Lines [0] :=PageList [FGIndex];

(the name of this Memo MemoPageCount)
  • Related