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

Crystal 11 Combine report group results in one line horizontally 1

Status
Not open for further replies.

ReillyC

MIS
Feb 6, 2004
114
US
I was lucky enough to find the answer to how to group results in one line horizontally HERE!! Thank You. This is the formula I used which works. Sort of.

Group Header is suppressed with this formula in it.
whileprintingrecords;
stringvar list := "";

Group Footer
whileprintingrecords;
stringvar list;
left(list,len(list)-2)

Details is suppressed with this formula in it
whileprintingrecords;
stringvar list;
if instr(list,{VMIS_TABPAY_1.CODPAY}) = 0 then
list := list + {VMIS_TABPAY_1.CODPAY}+ ", " else
list := list;

App No Country - Results
123 US
123 JP
123 UK

App No Countries - Results display in ONE LINE HORIZONTALLY
123 US, JP,UK

My problem is that I had to change the formula slightly. In the group footer I changed -2 to 0 because I received an error message "String length is less than 0 or not an integer) As a result if one of my applications has one country it leaves a comma after the ONE country. See below.

App No Country
124 US,

If there is only one country I want to see the following.
App No Country
124 US

Is there any way I can fix it?



 
It sounds like you have a null or blank in at least one case. Change your display formula to:

whileprintingrecords;
stringvar list;

if len(list) > 2 then
left(list,len(list)-2) else
list

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top