Solved

crystal parameter description into array rather than the parameter itself

Posted on 2011-02-23
3
718 Views
Last Modified: 2012-05-11
I have an array that is shown in the report header that shows the parameters selected.

The current array is as follows:

        stringVar array Sel_Dept := {?Department};
        numberVar Counter := 0;
        stringVar Dept_List := "";

        for Counter := 1 to UBound (Sel_Dept)
        do
        Dept_List := Dept_List & Sel_Dept [Counter] & chr (13);

        Dept_List

The issue is these parameters are name fields rather than the codes for the field.

e.g. code = 1 name = CORE

In an attempt to speed up the report, I have changed the parameter to use the code rather than the name and moved the name to the parameter description (but just show the description in the parameter list). Trouble is I don't know how to pass the parameter descriptions into an array rather than the parameters themselves.

Can anyone assist with this?

Thanks in advance.
0
Comment
Question by:delkent
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 77

Expert Comment

by:peter57r
ID: 34959404
The descriptions are only visible for the selection dialog.  You can't use them in the report.  If you want to 'decode' the parameter value you will need to create another formula field or a general function to do that.

From your problem description it looks like you could just set up an array of descriptions and use the Code to get each value.
0
 

Author Comment

by:delkent
ID: 34959451
Hi peter57r

Thanks. What you are saying makes sense as there is only 10 different departments

"From your problem description it looks like you could just set up an array of descriptions and use the Code to get each value."

How would I do that?
0
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
ID: 34959559
Then assuming you have using numbers 1-10 as the paramater values
//department to display
stringvar depts:=["dept1", "dept2", "Dept3"] ;  //as many as you need.
 stringVar array Sel_Dept := {?Department};
        numberVar Counter := 0;
        stringVar Dept_List := "";

        for Counter := 1 to UBound (Sel_Dept)
        do
        Dept_List := Dept_List & depts[Sel_Dept [Counter]] & chr (13);

        Dept_List

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

730 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