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

Quirk in concatentation formula when not all parameters filled in 1

Status
Not open for further replies.

elsenorjose

Technical User
Oct 29, 2003
684
US
Hello all,

I've been using the following formula to concatenate parameter entries in a 'legend' in the report header to display the roles selected:

Code:
{?Role1} +
(if {?Role2} = '' then '' else ('; ' + totext({?Role2})) +
(if {?Role3} = '' then '' else ('; ' + totext({?Role3})))+
(if {?Role4} = '' then '' else ('; ' + totext({?Role4}))))+
(if {?Role5} = '' then '' else ('; ' + totext({?Role5})))+
(if {?Role6} = '' then '' else ('; ' + totext({?Role6})))+
(if {?Role7} = '' then '' else ('; ' + totext({?Role7})))+
(if {?Role8} = '' then '' else ('; ' + totext({?Role8})))+
(if {?Role9} = '' then '' else ('; ' + totext({?Role9})))+
(if {?Role10} = '' then '' else ('; ' + totext({?Role10})))+
(if {?Role11} = '' then '' else ('; ' + totext({?Role11})))+
(if {?Role12} = '' then '' else ('; ' + totext({?Role12})))+
(if {?Role13} = '' then '' else ('; ' + totext({?Role13})))+
(if {?Role14} = '' then '' else ('; ' + totext({?Role14})))+
(if {?Role15} = '' then '' else ('; ' + totext({?Role15})))

As users tend to do, someone discovered that if they enter a value for {?Role1}, skip {?Role2} and enter a value for {?Role3}, only {?Role1} is displayed in the legend. This is because the application that calls the report displays the parameters in two columns and {?Role1} is displayed to the left of {?Role2} and above {?Role3} and the user filled in the parameters vertically rather than in order. Is there a way to modify this formula to accommodate this behavior?

Using CR XI.

Thank you
 
{?role1}
+
(if {?role2} <> '' then '; ' + totext({?Role2}) else '')
+
(if {?role3} <> '' then '; ' + totext({?Role3}) else '')
+
(if {?role4} <> '' then '; ' + totext({?Role4}) else '')

etc........

_____________________________________
Crystal Reports XI Developer Version
Intersystems Cache 5.X ODBC connection

 
Man, why don't I ever see the simple solutions???

Thanks CoSpringsGuy :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top