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

Report produces two pages with almost same results

Status
Not open for further replies.

Phillipg

Technical User
May 3, 2002
53
0
0
US
I have a report that that when printed, produces two reports with all of the same results except one field.
One table has the ability to have more than one answers in it. When I print the report it puts one answer on one report and the other answer on another report. What I would like to do is to have both answers on the same line in one report. any help please. The table with multiple answers in it is linked to the main table with a common field "INCIDENT.ID". I've tried 'equal join', 'left outer', right outer' and others without any luck. I,ve also reversed the link, no luck.
Thanks.
CR8.5
ODBC
Oricle


Phillipg
 
If there are always only two results for the field, then instead of using the field on the report, use a formula like:

minimum({table.field},{table.group})+ ", "+ maximum({table.field},{table.group})

-LB
 
Thanks Lbass for getting me on the right tract, but, the field could have up to ten(10) results.
I tried
Code:
local stringvar inj;
inj :="";
inj:={INCINJURIES.INJURYLOCATION}+": "+{INCINJURIES.INJURYTYPE};
inj:= inj+"   "+next({INCINJURIES.INJURYLOCATION})+": "+next({INCINJURIES.INJURYTYPE});
inj:= inj+"   "+maximum({INCINJURIES.INJURYLOCATION})+": "+maximum({INCINJURIES.INJURYTYPE});
inj
which gives the first, second and last answer.

If I add another next line it repeats the second answer.

Phillipg
 
With multiple results, to get them in one row, use a variable in three formulas (assuming you have a group that you are accumulating within (otherwise eliminate the reset formula:

//{@reset} to be placed in the group header:
whileprintingrecords;
stringvar x := "";

//{@accum} to be placed in the detail section:
whileprintingrecords;
stringvar x := x + {INCINJURIES.INJURYTYPE} + ", ";

//{@display} to be placed in the group footer:
whileprintingrecords;
stringvar x;
left(x,len(x)-2);

Then you would suppress the details section (and the group header, if you wish).

The potential issue with this is that you might exceed the 254 character limit.

Another approach would be to insert a crosstab with the injury type as the column, no row, Nth most frequent as the summary (or maximum), and place it in the group header. Then you would suppress the row and column labels and eliminate the grid.

-LB

 
lbass, I dont have any groups in the report to put those formulas in the header and footer. Thanks for your help.

Phillipg
 
You don't need {@reset} then. Place {@accum} in the details section and {@display} in the report footer. It seems odd though to want to return only one line per report, so if this doesn't fit your needs, please provide a sample of your current data and how you would like your report to look.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top