Formula to display what multiple parameters were selected after a report is run

Posted on 2008-11-06
Last Modified: 2012-06-21
Hello Experts,

I have a multiple value parameter that allows users to select any score ranging from 0 to 5 so that they can see mixed results.  For example, a user can select to see records with a score of 3 and a score of 4.  

What I want to do is create a title in the page header that shows the user the values that they have selected for the report.  When I drag the parameter into the page header it only displays the first value selected not all values.  Is there a way to show all values selected after my report is run?
Question by:cyardley
    LVL 26

    Expert Comment

    by:Kurt Reinhardt
    You can use the Join function within a formula field.  For example Join({?Parameter},", ").  In this case, I've created a delimiter of a comma and space following each value returned.

    Author Comment

    Thanks for the reply.

    I think I'm misunderstanding exactly what to do.  I put that example above into the following formula:

    When I do that I receive the error, "A String Array is required here"

    I apologize.  I am at a beginner level to Crystal so I may be misunderstanding you.

    LVL 26

    Expert Comment

    by:Kurt Reinhardt
    In your case, {pScore} isn't a parameter field.  Parameter fields have ? in front of them.  Since you want to display the actual parameters the users selected, you need to include that in your formula.  If your parameter doesn't allow multiple values, then you'll get an error message.  Assuming the parameter does and that you've used the correct field and syntax correctly, all should go well.

    Author Comment

    I apologize.  In the formula that I wrote above I missed putting the ? in front of the parameter.  This is a copy of the formula directly from the report:
    My parameter is set to allow multiple values and my report is returning the records.  However, I must be using the syntax that you've sent incorrectly because I still receive the "String Array is required here" error.
    LVL 100

    Accepted Solution

    I assume the parameter is using numeric values.

    You probably need to do it this way

    Loacl StringVar ParamList := '';
    Local NumberVar i;

    For i := 1 to UBoud({?pScore}) do
        If ParamList = '' then
            ParamList := CStr({?pScore[i]},0)
            ParamList := ParamList & ', ' & CStr({?pScore[i]},0)


    Author Comment


    Thank you.  That formula returns the values that I am looking for.  Each value is assigned a classification as well.  For Example if the score is 0, the Classification is "Failed".  Is there a way that after the formula that you have above runs I can dispaly the classification on the report as well?

    My score value and classifications are:
    0 = Failed
    1 = Insufficient
    2 = Possible
    3 = Minor
    4 = Moderate
    5 = Major

    Your formula did answer my original question.  So if necessary I can close this thread and award the points then open a new question.


    Author Closing Comment

    I've decided to close this thread since mlmcc's response does answer my original question.  I will open a new thread regarding the new question.

    LVL 100

    Expert Comment


    If they won't change so you have to maintain this code then something like this.  If they will change then I would recommend adding a table to the database and linking it or using and SQL expressiion.

    If {Score} = 0 then
    else if {Score} = 1 then


    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
    Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now