Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using a string array in a parameter using Crystal Reports 2011

Status
Not open for further replies.

izenger

IS-IT--Management
Sep 23, 2013
5
0
0
US
Hello all,

I've been trying to find a way to do this, however I can't seem to find the right search to find what I'm looking for. Here's what I'm trying to do:

I'm connecting to a database using ODBC.
I have {table.field} with a whole bunch of codes (i.e. AAAA, AAAI, AAAB, etc.)
I'm trying to run a report that requires different groups of those codes:

Table.field
1111
2222
AAAA
AAAB
AAAC
AAAD
BBBB
CCCC
DDDD

Wanted result
Group XXXX: 1111, AAAA, AAAD
Group YYYY: 2222, AAAB
Group ZZZZ: AAAD, CCCC, DDDD

The database doesn't have a field for those groups as the groups are only for a specific reporting purpose.

I'm trying to create a parameter that says What group(s) do you want to search for?, with the options being XXXX, YYYY, ZZZZ, etc, and then have the parameter pull another parameter that has that array in it so that the user doesn't have to manually individually select the codes that are wanted.

Is there any way that crystal will allow me to do what I'm wanting? I hope I've given a clear explanation.
 
Not absolutely sure I understand, but if I do:

1. Create the following Formula:

[Code {@GroupBy}]
If {table.field} in ['1111', 'AAAA', 'AAAD']
Then 'XXXX'
Else
If {table.field} in ['2222', 'AAAB']
Then 'YYYY'
Else
If {table.field} in ['AAAD', 'CCCC', 'DDDD']
Then 'ZZZZ'
[/Code]

2. Insert a group on {@GroupBy}


Hope this helps.

Cheers
Pete
 
Thanks for your reply. I've been able to do that when I pull all the records and have it group by that. What I am wanting to do is to be able to pull only the records for the parameter selected.

{?Group}
All Groups
XXXX
YYYY
ZZZZ

So when the report is refreshed, it will ask which group(s) to search for?

In this instance, only XXXX is chosen, so I only want to pull the records which pertain to group XXXX, [1111,2222,3333,etc.]

Does that help clarify what I'm wanting?

I have basic crystal reports experience so was asked by my work to create a report so that our records people can pull only what they want.
 
Try adding the following to the Record Selection:

[Code RecordSelectionFormula]
{@GroupBy} = {?Yourparameter}
[/Code]

Does that help?

Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top