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

Suppress detail when printing Group 2

Status
Not open for further replies.

davismar

IS-IT--Management
Apr 1, 2010
85
US
I have a report with 2 groups.
Group # 1 = Account Name
Group # 2 = Phones

The phones group is also the following formula:

If {tblCustomerInventory.ItemDescription} like ["*Phone*", "*Terminal*"] then "Phones" else {tblCustomerInventory.ItemDescription}

I'm trying to get the detail for the phones group to be suppressed when it's printing on all lines except the first one.

Here is an example of the current data:

Item # Item Description Summary = Count of Ph Qty SN# Purchase Date
0890043 Phones 55 1 L266035B08976C 1/16/04
Phones 1 L266035B08974C 1/16/04

Here is what I want to have:

Item # Item Description Summary = Count of Ph Qty SN# Purchase Date

0890043 Phones 55


Any help is appreciated.
 
If you need a detail line to print (rather than putting the data in the group header or footer) you can set up a suppression formula for the detail band that is like:
{account name} = previous({account name}) and {phones} = previous({phones})
 
Assuming your field is returning multiple lines per instance, then replace the field with a formula like this:

stringvar y := {tblCustomerInventory.ItemDescription};
stringvar array x := split(y," ");
stringvar z := "";
numbervar i := i + 1;
numbervar j := 3;
for i := 1 to j do(
z := z + x+" "
);
if {@phonegroup}="Phones" then
trim(z) else
{tblCustomerInventory.ItemDescription}

This will return the first three elements in the field if the group instance is "Phones"; otherwise it will return the whole field (for other group instances).

-LB
 
When I copied the above formula, I receive the following error:

A subscript must be between 1 and the size of the array.

 
Try this instead:

stringvar y := if isnull({tblCustomerInventory.ItemDescription}) then
"" else
{tblCustomerInventory.ItemDescription};
stringvar array x := split(y," ");
stringvar z := "";
numbervar i; //remove the := i + 1
numbervar j;
if ubound(x) < 3 then
j := ubound(x) else
j := 3;
for i := 1 to j do(
z := z + x+" "
);
if {@phonegroup}="Phones" then
trim(z) else
{tblCustomerInventory.ItemDescription}

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top