Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

record count has to continue

Status
Not open for further replies.

NickIntersoft

Technical User
Mar 5, 2007
12
BE
i have a detail count running on my report. But on my first page it has to go until 10.
And on from my second page on, it has to go until 22.

So the count has to continue even though there's no record added. The same on the second page, if my last record has the number 12, the count has to continue until 22.

thanx in advance
Nick
 
i'll try to be more clear with an example:
i get a list with names of customers and each customer gets a number. BUT on the first page i'm not allowed to have more then 10 customers. On all the other pages i'm allowed only 22 customers.
If my list ends in the middle of a page, the count has to continue untill the end of the page and then stop.

i hope this makes more sense?
 
First, let's assume that the reason a list might end in the middle of the page is that you are using groups where you have set "New page after" on the group footer.

Place this formula in the page header:

whileprintingrecords;
numbervar cnt := 0;

Place this formula in the detail section:

whileprintingrecords;
numbervar cnt := cnt + 1;
numbervar i;
numbervar j := 22-cnt;
numbervar k;
numbervar m := 10-cnt;
stringvar x;

if pagenumber = 1 then
(
if cnt <= 10 then
x := totext(cnt,0,"");
for k := 1 to m do(
if
(
onlastrecord or
{table.groupfield} <> next({table.groupfield})
) then
x := x + chr(13)+totext(cnt+k,0,"") else
x := totext(cnt,0,"")
)
);
if pagenumber <> 1 then(
if cnt <= 22 then
x := totext(cnt,0,"");
for i := 1 to j do(
if
(
onlastrecord or
{table.groupfield} <> next({table.groupfield})
) then
x := x + chr(13)+totext(cnt+i,0,"") else
x := totext(cnt,0,"")
)
);
x;

Right click on this formula->format field->common tab->check "Can Grow".

In the section expert->details->new page after use this formula:

whileprintingrecords;
numbervar cnt;
if pagenumber = 1 then
cnt = 10 else
cnt = 22

-LB
 
Thanks for the quick respond!!

i don't use groups, the reason it ends is because it's the end of the list, there is no more data to display.

Are there certain sections that i can cut out?

tnx
 
Then change the formula to:

whileprintingrecords;
numbervar cnt := cnt + 1;
numbervar i;
numbervar j := 22-cnt;
numbervar k;
numbervar m := 10-cnt;
stringvar x;

if pagenumber = 1 then
(
if cnt <= 10 then
x := totext(cnt,0,"");
for k := 1 to m do(
if onlastrecord then
x := x + chr(13)+totext(cnt+k,0,"") else
x := totext(cnt,0,"")
)
);
if pagenumber <> 1 then(
if cnt <= 22 then
x := totext(cnt,0,"");
for i := 1 to j do(
if onlastrecord then
x := x + chr(13)+totext(cnt+i,0,"") else
x := totext(cnt,0,"")
)
);
x;

Leave the other formulas as is.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top