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!

Need help displaying comments 1

Status
Not open for further replies.

jpeters01

Technical User
Dec 5, 2007
109
US
Hi, Regarding previous thread 1623741. The resolution works very well but we have recently noticed a problem when there are duplicate RX#s.

For example:
RX# Drug Dose Comment
123 Amoxicillin 250 Take with food

1234 Diprovan 250 x2 doses
at bedtime
take with food
1234 Diprovan 50 x2 doses
at bedtime
take with food

Currently the Diprovan is displaying like this:
Diprovan 250 mg
Diprovan 50 mg
x2doses x2doses at bedtime take with food at bedtime

I need it to display like this:
Diprovan 250mg
Diprovan 50 mg
x2doses at bedtime take with food

I am grouping on RX# and these are the formulas I am using:
//{@reset} to be placed in the group header:
whileprintingrecords;
stringvar x;
if not inrepeatedgroupheader then
x := "";

//{@accum} to be placed in the detail section and suppressed:
whileprintingrecords;
stringvar x := x + {table.textline}+ " ";

//{@display}:
whileprintingrecords;
stringvar x;
trim(replace(replace(x,chr(13),""),chr(10),""))

Thanks!


 
Try changing this

//{@accum} to be placed in the detail section and suppressed:

whileprintingrecords;
stringvar x := x + {table.textline}+ " ";

to

whileprintingrecords;

stringvar x;

If not({table.textline} in x) then
x := x + {table.textline}+ " ";

Ian
 
change your accumulation formula to something like below.


//{@accum} to be placed in the detail section and suppressed:
whileprintingrecords;

stringvar x;
IF instr(x,{table.textline})
then x := x
else x := x + {table.textline}+ " ";
 
IanWaterman's formula worked so didn't try the second suggest but appreciate your reply.

Thanks!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top