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

Loop and Exit in report

Status
Not open for further replies.

Nerdhurd

Technical User
Jan 11, 2005
57
US
Greetings all, I have an interesting problem...hopefully someone can guide me in the right direction here?

I am reporting on shipment line items that go with specific machine serial numbers. Unfortunatly the way the company enters the shipments is they put multiple machines in a single shipment and then the machines options in the lines following...then the pattern continues, so really the only way you can determine a machines shipped options is by the lines directly below the machine. So, I would like to be able to just list the lines and STOP before I get to the next machine in the shipment. Example below:

description line# type

Machine 2010 1 machine
option 1 2 option
option 2 3 option
option 3 4 option
Machine 2040 5 machine
option 1 6 option
option 2 7 option
option 3 8 option

So I would like to select Machine 2010 and all its options WITHOUT displaying machine 2040 and its options. Is it possible to do this with some crystal code? Like a loop that will exit when it encouters a TYPE machine...

Any ideas?

Thanks in advance!


 
Hi,
( Sorry about your poor data structure, but...)
You can try Grouping on a formula that
checks the type field first:

If {type} ='machine' then
{Description}


On the Details section for this use a supression formula:
type = 'machine'
Be sure to
Order by {description} ( in addition to the Group sorting)

May work..





[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
You could create a formula like the following {@mach}

whileprintingrecords;
stringvar x;
if {table.description} starts with "Machine" then
x := {table.description} else
x := x;

Add this to the report and then you can go to the section expert->details->suppress->x+2 and enter:

{@mach} <> "Machine 2010"

This would eliminate all details except the "group" that you are interested in.

-LB


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top