Custom page numbering
I am trying to place a page number like A-1 at the foot of each page.
The letter represents a value I am grouping on. The number is the page
number within the group. The group is set to start a new page, and to
reset the page number.
I have placed a ppVariable in the Footer. The OnCalc handler of the
ppVariable consists of:-
Value := Trim(DBISAMQueryAnnexDetail.FieldByName('Letter').AsString)
+ '-' + IntToStr(ppReportAnnexDetail.PageNo);
If I set the ppVariable's CalcType to veTraversal, then it all works fine
until a page break occurs within a record (i.e. the record is split across
two pages). The new page does not trigger a recalculation of the
variable, so it prints the same value as the previous page.
If I set the ppVariable to vePageStart, the numerical part of the page
number is correct, but now the letter is wrong. At the first page of each
subsequent group it prints the letter that belongs to the group that has
just been completed. It seems that, at the time the OnCalc handler is
triggered, the pipeline has not stepped on to the next record, despite the
fact that it has noticed that the group variable has changed.
What am I doing wrong?
--Bill Sparrow--
This discussion has been closed.
Comments
Instead of using only one variable for everything, I would use a regular
TppSystemVariable to keep track of that page numbering and use a TppVariable
to keep track of the group. If you have the group set to Reset Page Number,
the system variable will automatically reset once a group breaks. Then
inside the TppVariable's OnCalc event, simply add the code to display the
current letter for that group. If you would like you can add the hyphen
using a separate TppLabel or tack it on the end of the TppVariable.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Thanks for the response.
OK, well if it has to be done with multiple components, then I might as
well use a DBText for the letter, a Label for the hyphen, and a
SystemVariable for the number. That way there is no code and it works in
the preview.
Just thought I was missing a trick somewhere!
--Bill Sparrow--
In article <414712e1$1@dm500.>, support@digital-metaphors.com (Nico Cizik