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

Suppress based on total pages

Status
Not open for further replies.

duncangibson

Technical User
Mar 12, 2010
2
KY
Have a report creating statements for customers. I need to be able to suppress groups (to keep a statement from printing) based on the total pages in the statement. I can't figure out how to get the value for the total pages to be evaluated and used to suppress detail in the report.
Client wants to print out all the one page reports, then all the two page statements, etc.

Any help would be greatly appreciated. I've spent several hours going around in circles.

duncangibson
 
Since the totalpagecount value will change when a section is suppressed, you can't really use that. I think your best bet is to determine how many records can appear per page, and then use a formula like this, e.g.:

count({table.recurringfield},{table.group}) < 45 //1 page

count({table.recurringfield},{table.group}) in 46 to 90 //2 pages

//etc.

You could add a parameter and write one formula like this:

if {?Parm} = "1 Page" then
count({table.recurringfield},{table.group}) < 45 else
if {?Parm} = "2 Pages" then
count({table.recurringfield},{table.group}) in 46 to 90
//etc.

-LB
 
Thanks for your answer. I had thought about going that direction, but the records vary in the space they take; could be one line, but could be more depending on the description of the charge. I actually need to suppress the whole statement for the customer depending on page count; I need to print out the one page statements separately, then the two page statements, etc. Have a folding machine (lots of statements) but I need to separate them into groups to use it.
 
You could create a formula like this for the detail section, assuming for this example that the maximum field length before wrapping is 20:

if len({table.field}) > 80 then 4 else
if len({table.field}) > 60 then 3 else
if len({table.field}) > 40 then 2 else
1

Then insert a sum on this at the group level. Once you know how many lines fit on a page, you can use a suppression formula like this:

(
{?Parm} = 1 and
sum({@aboveformula},{table.group}) > 45
) or
(
{?Parm} = 2 and
sum({@aboveformula},{table.group}) <= 45 or
sum({@aboveformula},{table.group}) > 90
) //etc.

Not perfect, but should get you closer. You could also insert a summary on the formula and use a group sort ascending to at least order the groups by estimated pages.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top