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!

printing multiple items from a field

Status
Not open for further replies.

Cretin

Technical User
Jan 2, 2003
194
US
I am doing a crystal report taking data off of a database. Each field only has one item except for one field which can have 1 and possibly more. Is what happens is it prints all of the items then the field that has multiple items it prints a different line for each I would like them all on the same line.

Example
Current report[\b]

Detail line a. Call Id, Assignee,

Detail Line b, Description
Detail line a, assignee
detail line a, assignee

It will do that if there are 3 assignees. Is what I would like to print is the following.

Detail line a, Call Id, Assignee, assignee, assignee,
detail line b, Description

Any help would be appreciated
 
Sorry, I'm confused.

Please provide an example of what's in the fields.

If you want multiple items on the same line, place them in the same details section. If the field has carriage returns embedded, use a replace on the field, as in:

replace({table.field}, chr(13),", ")

-k
 
I think you could accomplish this by creating a variable for assignee, using three formulas:

First formula {@assigneereset} to be placed in group header, and let's assume you are grouping on {callID}:

whileprintingrecords;
stringvar assignee := "";
numbervar counter := 0;

{@assigneeaccum} to be placed in the detail section;

whileprintingrecords;
stringvar assignee;
numbervar counter;

counter := count([{table.assignee}]);

while counter > 0 do
(assignee := assignee + {table.assignee}[counter] + ',';
counter := counter - 1);
assignee [1 to (length(assignee)-1)];

Third formula {@displayassignee}:

whileprintingrecords;
stringvar assignee;
assignee;

Insert a second group 1 footer, so you now have group #1a footer and Group #1b footer. Place {@displayassignee} in the Group#1a footer and also place your other formerly "detail a" fields in the group #1a footer. Place the description field in the Group#1b footer. Then suppress the details section.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top