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!

Display Text field only once per section

Status
Not open for further replies.

StephHansen

Programmer
Dec 26, 2001
87
IN
I (finally!) got the detail records to split based on product or material by having two sep. detail fields. If I add two more detail fields, one above materials, one above products, and added a text field to each, how would i tell it to only display that value once?

So it would be like this:

Detail A: Materials Text
Detail b: Materials
Detail c: Product Text
Detail d: Products

and I want it to read out like

Materials
Mat 1
Mat 2
Mat 3

Products
Prod a
Prod b

I am already suppressing the detail layers by whether it is a prod or a mat but am wondering how to suppress duplicates. Previous suppressed all the materials header text.

Previous ({Orders.Materials_T.Type})= {Orders.Materials_T.Type}


Thanks! Stephanie
 
Add a counter formula to the 'label' detail.
Supress when counter>1
 
Actually, I just realized you will also have to put a counter reinitialization formula in your group header.

so, in the detail section you're using as a group label
put the following recordcounter formula:

whileprintingrecords;
shared numbervar recordcounter;
recordcounter:=1+recordcounter;


in the group header, put this recordcounterzero formula:
whileprintingrecords;
shared numbervar recordcounter:=0;

then, supress your section when the recordcounter formula is greater than 1.

I have not been able to test this fully, but it should be a good start. I think you and I are working on very similar reports. :)
 
The problem I am hitting is that the records are not counting in order. I have them sorted by item number and so the text display is not appearing at the top of the list, but often as the second entry.

Stephanie
 
are you displaying the recordcounter on the detail line, so you can see how it's counting? You might be able to pick up a pattern and identify where it's failing.
 
I am and the first one is never a consistent number, sometimes 4, sometimes 13. the second one almost always is 1 and then they go in numeric order after that. It is just that very first one that is out of order.

Thanks for helping!
Stephanie
 
It sounds like the counter is not resetting exactly when it should.

Do you have more than one grouping? Is your recordcounterzero formula in the right group header?


I had a different problem getting this to work: I have some records where all the fields would be null or zero. I had suppressed them, but they were still getting counted. I had to put an additional condition in my counter formula...I don't think this would apply to your situation, but this is what I did:

if(
(isNull({@LaborCost}) or {@LaborCost}=0)
)
then
recordcounter
else
recordcounter := 1 + recordcounter;

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top