Solved

crystal parameter description into array rather than the parameter itself

Posted on 2011-02-23
3
716 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
  • 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

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

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. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

831 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