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!

how to show 1 line of record instead of many

Status
Not open for further replies.

calvi

Technical User
May 26, 2003
87
NL
how do you write in crystal syntax code for the following? i have 4 fields: begintime, endtime, contactname and notification. i want to show some contactnames in one single line, because the begintime, endtime and notification are the same. but now instead it shows some lines in a row with the same times and notifications, because contactnames are different. But now how do you program it to become one line and so that the different contactnames will show next to each other in the same contactnamefield?
e.g. This is what i want.
JOBTIME EMPLOYEE NOTES
08:00 - 13:00 John, Mark, assigned to do
Kent, Todd administrations

But not what i want: under column employee now i have 4 rows:
08:00 - 13:00 John assigned ...
08:00 - 13:00 Mark assigned ...
08:00 - 13:00 Kent assigned ...
08:00 - 13:00 Todd assigend ...

How do I solve this that these will be in one row instead of 4 rows, so that it does not repeat the other fields?
 
i think i would start by grouping it by begintime...
adding the notification field to that group header line.

then i would put the contactname field in the details section. of course, this will put each name on a different line automatically... the only way i can think of to get around that is to split the details into 2 sections... in the top section place the contact field in a certain spot, and then in the next detail section, place the contact name in a place to the right of the first one; then in formatting sections, click on the first detail section and check "underlay following section"...

i dont know for sure that this will get you what you want, but it shouldnt take that long to try and see... good luck...

*always a student, rarely brave enough to offer advise... please be gentle if my suggestion doesnt work*

*forever a student - rarely a teacher*

[americanflag] cheysmommy [americanflag]

"I keep hitting 'escape' but I'm still here..."
 
This is almost good, but still the names will show 4 times
result:

groupheader: 8:00 assigned ...

8:00 - 13:00 John John John
8:00 - 13:00 Mark Mark Mark
8:00 - 13:00 Kent Kent Kent
 
i am hitting a mental wall i guess, because i cant understand why the names would show up that way you have shown... [ponder]

the only other suggestion i can give is to format the caontactname field to supress if duplicated...

good luck

*forever a student - rarely a teacher*

[americanflag] cheysmommy [americanflag]

"I keep hitting 'escape' but I'm still here..."
 
Ok, keep the group you have created.

Then create 2 formulas :

@ResetVariable
StringVar Names := "";
(place this in the group header)

@ListOfNames
If StringVar Names = "" then
Names := EMPLOYEE; else
Names := Names&", "EMPLOYEE;

Place this in the detail, and the group footer.

Now place the JOBTIME and the NOTES fields in the group footer and suppress the group header and detail sections.

Let me know if this worked......
Does this help?


Reebo
Scotland (Sunny with a Smile)
 
Slight amendment to Reebo's formulas:

Group header formula:
whileprintingrecords;
StringVar Names := "";

Details:
whileprintingrecords;
If StringVar Names = "" then
Names := {table.employee}
else
Names := Names+", "+{table.employee};

Group Footer:
whileprintingrecords;
StringVar Names;
Names

-k
 
If you're not using version 9 you may run ito the 254 character limit for strings. You may need to test the length of Names and if it is close (ie 254 - the longest name), then accumulate to a 2nd variable (or 3rd or 4th)
Then you'd create as many formulas as necessary to return each of these varaibales and place them into a text object.

Good luck.

Bob Suruncle
 
SV,

cheers......I haven't got CR with me at the moment.

Reebo
Scotland (Sunny with a Smile)
 
thanks reeboo99 and synapsevampire it works well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top