Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Using Lists as Parameters Post Reply Post New Topic
Author Message
dxhansen
Newbie
Newbie


Joined: 30 Oct 2013
Location: United States
Online Status: Offline
Posts: 2
Quote dxhansen Replybullet Topic: Using Lists as Parameters
     Posted: 31 Oct 2013 at 4:39am
I have a report that has multiple sub reports.

I would like to have a parameter in the main report that allows the end user to select one of three options:
Disney
Warner Bros.
All

If they select Disney, they would only get the results in the sub reports for the following characters:
Mickey
Donald
Goofy

If they slect Warner Bros. they would only get the results in the sub reports for the following characters:
Daffy
Taz
Buggs

If they select All, they would get all results.

Because I have multiple sub reports, I dont want to have to maintain a list of characters in each sub report. I would like to be able to maintain the list of characters in the main report an have the lists passed down to the sub reports where the above parameters are passed to and call the correct list of characters.

Is there any way to do this?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 31 Oct 2013 at 4:59am

depends on your data set but in general you can

create one param (?type) in the main report that has your 3 options.
link each sub report to the main report on that param field, this create a subreport param that tha will be called something like "?sr-Type"
in each subreport use the this new param n the select expert as
 
(
?sr-Type='All'
or
?sr-Type=table.CompanyNameField
)
 
assuming you have a field in your tables that identify your characters as part of each of those 'company names'
 
IP IP Logged
dxhansen
Newbie
Newbie


Joined: 30 Oct 2013
Location: United States
Online Status: Offline
Posts: 2
Quote dxhansen Replybullet Posted: 31 Oct 2013 at 5:20am
Thats my problem.
 
I have a list of "Characters" but I dont have any way to specify that they belong to a different group in the database.
 
I was hoping that there was some way that I can create a formula in the main reprot where I can maintain the specific list of characters (characters come and go) that is then passed on to the sub reports where I can use those lists as my parameters.
 
Im familiar with creating a parameter on the main report and linking the sup reports to that parameter, im just hoping there is some way that once that parameter is selected, it brings up the desired list of characters in the select expert.
 
Ive gotten close by using a Variable statement and having my list of characters in each sub report, then using the following formula in the select expert (TABLE.CHARACTER in split({@Character List}, ","))
 
But because I have multiple sub reports that use this same selection criteria, I would like to be able to only maintain the list of characters in the Main report and have them passed down to the sub reports.
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 31 Oct 2013 at 9:50am
just create a table in SQL or which ever data source you're using link it to the report, then you only need to update that table.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum