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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limiting the no of records in a group / subreport 1

Status
Not open for further replies.

Smitha08

Programmer
Jan 31, 2008
19
US
Hi,

I have a report to print which has the format of e-check.

The first section is the check. Second and third section is the invoice details. Second and third section are duplicates.

This is implemented using the groups, GH2,GH1(Detail header), Details(Records for invoice), GF1(Subreport containing the information as details) GF2.

Till this it works fine. But if there are more than 10 records in the detail section i want it to repeat it on next page. This works if new page after is set. But then again it does not print the subreport below. it prints the subreport on the next page too.

I want the subreport to print 10 records on the same page.

Any suggestions please help.

thanks,
Smitha
 
How are you getting things to "repeat" on the second page? Are you saying that somehow the sub is printing twice, once on each page? Not sure how you have accomplished that. If you have two separate instances of the same sub added to the report and they each show all records, you could format the first to suppress records using a formula like this:

recordnumber > 10

Then in the second sub, use:

recordnumber <= 10 or
recordnumber > 20

-LB
 
Thanks for the reply lbass.

Here is the structure. 3 sections.
the payee & amt information is in pageheader
first stub is in details and second stub is in a sub report.
the 2 stubs print same information.

*************************************
Payee & amount


*************************************
date inv# comments amt
10/10/2005 1002 50
10/10/2005 1003 50
10/10/2005 1004 50
*************************************
date inv# comments amt
10/10/2005 1002 50
10/10/2005 1003 50
10/10/2005 1004 50
*************************************

the requirement is to print rest of the lines after 10 lines on next page and then on the second page after 10 lines on 3r page so on....2 times ( one for detail and one for subreport).

Any suggestions please,

thanks
Smitha
 
You didn't say in what section the sub is located.

-LB
 
i am sorry. i just skipped that information.
The subreport is located in the Group footer 1.
 
How are you currently getting the sub to repeat then? The group footer will only print after all records have printed. Or is that the problem?

-LB
 
that is true.that is my problem.. i want to set a limit on the no of records say 10 displayed in each stubs

And send any overflow data to the next page for next set of 10 records.

any ideas?
 
Just tested this. First create a running total {#cntwingrp} in both the main report and the subreport which is the count of any recurring (non-null) record, evaluate for each record, reset on change of group #1 (if that's your account group). In the section expert of the main report, set "reset page number after" on the group footer #1, and then select the detail section->new page after->x+2 enter:

remainder {#cntwingrp},10) = 0

Also create this formula and place it in the page header of the main report and suppress the formula:

shared numbervar pageno := pagenumber;

You must place the subreport in the page footer (NOT the group footer), and resize the page footer so that it is large enough to accommodate 10 records. The sub should be linked on the Group #1 field. All sections but the details should be suppressed, and in the section expert of the sub, highlight details->suppress->x+2 and enter:

shared numbervar pageno;
select pageno
case 1 : {#cntwingrp} > 10
case 2 : {#cntwingrp} <= 10 or
{#cntwingrp} > 20
case 3 : {#cntwingrp} <= 20 or
{#cntwingrp} > 30
case 4 : {#cntwingrp} <= 30 or
{#cntwingrp} > 40 //etc. up to the max number of pages for one group

The only thing I'm not sure of is your grouping. You mention two groups but I'm unclear what they are or how that needs to be built into the solution.

-LB
 
it works great ..
one more point between

*************************************
date inv# comments amt
10/10/2005 1002 50
10/10/2005 1003 50
10/10/2005 1004 50
*************************************

and the 2nd
date inv# comments amt
10/10/2005 1002 50
10/10/2005 1003 50
10/10/2005 1004 50


there is lot of white horizontal spaces any clue why?
 
Page footers don't nest against data in the report proper. You could increase the number of records in each until they are closer together, or you could insert a section above the details (another GH section) and expand that until the details nest against the page footer.

-LB
 
Thanks for a prompt reply lbass.
The requirement is to divide the page into 3 equal parts.
first part check infor. second and third the details so it has to be the same height. how about me putting the last information in group footer rather than page footer.
 
on second thought i shall try and arrange the layout..i think that should work.

thanks
 
No, the group footer will not repeat on each page. You should be able to manually size the group header section (where the check is) to a specific size, as well as the page footer, nesting the sub against the page footer upper border. Then the details will be forced into a mid-page position.

-LB
 
works perfectly fine. \

one more fine detail.. if there are just 3 records instead of 15 records can i insert blank lines in the subreport by any way because the footer of the subreport prints right after the 3 records instead of printing after 15 records.
 
Why not just format the footer to "print at bottom of page"?

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top