Advertisement

04.21.2006 at 12:39PM PDT, ID: 21822786
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.8

Ughh!  Print parameter field in report title using a formula

Asked by Preece in Crystal Reports Software

Tags: , ,

This one is a real zinger.  I'm using Crystal 8.5.  I have created a parameter field named PL which is setup as such:

string value type
allow multiple values
discrete and range values

Now, the user will typically enter values such as:

01   (discrete)
02   (discrete)
03   10  (range)

The report accepts these multiple discrete and range values and shows the results with no issues.  

I want to show all of the parameter values in a title.  I know how to create a formula and place it on the report.
But the question is how do I construct the formula given how I have setup this particular parameter field?

After much research, here is what I have tried so far and none of my attempts pass the formula editor check for various reasons:

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-- Crystal Syntax

StringVar strResult := '';
NumberVar n;

for n := 1 to ubound({?PL})
do
(
   strResult := strResult + {?PL}[n];
);              ^---------------  A string is required here.

strResult


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-- Crystal Syntax

StringVar strResult := '';
NumberVar n;

for n := 1 to ubound({?PL})
do
(
   strResult := strResult + ToText( {?PL}[n] );
);                                 ^-----------------  A number, currency amount, boolean, date, time, date-time, or string is required here.

strResult


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-- Crystal Syntax

Join( {?PL},"," )
     ^---------------  A string array is required here.


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-- Crystal Syntax

Join(ToText( {?PL} ),"," )
            ^-----------------  A number, currency amount, boolean, date, time, date-time, or string is required here.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-- Basic Syntax

dim i as number
dim s as string
for i = 1 to UBound({?PL})
  s = s & Chr(13) & chr(10) &  {?PL}(i)
                              ^-----------------  A number, currency amount, boolean, date, time, date-time, or string is required here.
next
formula = s



-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-- Crystal Syntax

//Declare a variable to hold the number of items in the Multiple value parameter
Global NumberVar Counter := Count({?PL});


//Declare a variable to use in the For Loop
Global NumberVar i :=1;


//Declare a string variable to hold the resulting string
Global StringVar Display;


//Loop through all of the items in the parameter.  
//Extract each and add to a string
For i := 1 to  Counter Do
    (
//Add the first parameter value to the Display variable
    If i = 1 then
        ({?PL}[i];
        Display := Display + {?PL}[i])
                   ^---------------  A string is required here.

//Add a comma to the Display variable before adding subsequent parameter values
    Else If i < Counter then
        ({?PL}[i];
        Display := Display + ", ";
        Display := Display + {?PL}[i])
//Add the word 'and' to the Display variable before the last value rather than a comma
    Else
        ({?PL}[i];
        Display := Display + " and ";
        Display := Display + {?PL}[i])
    );


//Display the variable that holds the result
Display
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


Thanks in advance,
PreeceStart Free Trial
 
Loading Advertisement...
 
[+][-]04.21.2006 at 12:56PM PDT, ID: 16511136

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.21.2006 at 01:13PM PDT, ID: 16511334

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.21.2006 at 01:23PM PDT, ID: 16511434

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Crystal Reports Software
Tags: crystal, required, reports
Sign Up Now!
Solution Provided By: bdreed35
Participating Experts: 1
Solution Grade: A
 
 
[+][-]04.21.2006 at 02:48PM PDT, ID: 16512113

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32