0
votes

I have a Crystal Report with a formula on the page header like this:

dim t as string

    t = "DD Waiver Waitlist " 

    if {rpt_xtab_waitlist.CountyName} = "statewide" then
        t = t + {rpt_xtab_waitlist.CountyName} 
    else
        t = t + "for " + {rpt_xtab_waitlist.CountyName} +  " County"
    end if

    formula = t

The problem is not all counties have data for the report, but I still want the page header to contain the county name.

Ultimately, other staff puts a front-end on the report with a combo box for the parameter listing all of the counties, so the parameter UI will not come from Crystal. I can't just change the parameter to dynamic.

I thought I could use the county name from the parameter instead of the data, but that's in an array and I can't figure out how to index it.

I tried:

if {rpt_xtab_waitlist.CountyName} = "statewide" then
    t = t + {?County}( RecordNumber)
else
    t = t + "for " + {?County}( RecordNumber) +  " County"
end if

but it doesn't print the county name corresponding to the selected county in the group tree.

How should I index a parameter array in a formula?

Thanks for any help,

-Beth

Sample county names:

Anoka
Hennepin
Yellow Medicine

Output I get now: report with page header function suppressed when they select Yellow Medicine county as their parameter from the list of counties

Output I want to get: report with page header function returning "DD Waiver Waitlist for Yellow Medicine County" when Yellow Medicine county selection criteria applied returns 0 rows.

1
Can you post some sample data for the rpt_xtab_waitlist.CountyName field? What is the expected output? What output are you getting now? I am struggling to fully understand the problem. - codingbadger

1 Answers

0
votes

I don't think there is a useful index, and for our purposes, they can only select one county as a parameter, so I ended up using the (1) index of the parameter array.

If anyone knows of a way to derive a meaningful index, please post.