Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Displaying "All" instead of all selected parameter Post Reply Post New Topic
Author Message
abhiguru
Newbie
Newbie


Joined: 26 Sep 2010
Online Status: Offline
Posts: 4
Quote abhiguru Replybullet Topic: Displaying "All" instead of all selected parameter
    Posted: 27 Sep 2010 at 12:55am
Hi

I want to display "All" when all the values of a parameter is selected in report header instead of all selected parameter. Other wise display only the selected one.
This is a simple if condition but the problem is, how can I check that all the parameter values are selected in formulae screen?



Edited by abhiguru - 28 Sep 2010 at 12:50am
IP IP Logged
rvink
Groupie
Groupie
Avatar

Joined: 04 Feb 2008
Location: New Zealand
Online Status: Offline
Posts: 55
Quote rvink Replybullet Posted: 27 Sep 2010 at 10:53am
Write a formula called "select parameter" like this:
if {?Parameter} = "All" then true
else {table.field} = {?Parameter}

Put the formula into the select expert:
{@select parameter} [and ... other criteria]

The formula will return true when "All" is entered so all data will be selected. If a parameter has been entered the formula will return true only for matching data. If you go to the menu "Data | Show SQL Query" you will see the Where clause changes depending on the parameter entered. Good luck!
IP IP Logged
abhiguru
Newbie
Newbie


Joined: 26 Sep 2010
Online Status: Offline
Posts: 4
Quote abhiguru Replybullet Posted: 28 Sep 2010 at 12:35am
Hi rvink

thanks for ur reply :).
this solution holds good when I put "All" in parameter value.
What I want is like this
Select Employee a multiselect  parametere contains following values
A
B
C
D

When user select all employee values that means A,B,C,D then It will show "All" in the Report Header else it shows only selected values.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 28 Sep 2010 at 4:26am
i could be wrong but I do not think you can do this because you are trying to compare a number that crystal does not have which is a distinctcount of all values before the select expert is applied.
If you include that as a column in the data source you could do it, or if you chaneg it to doing group record selection maybe yuo can do it. Otherwise I think you have to use the 'All' in your select options.
IP IP Logged
rvink
Groupie
Groupie
Avatar

Joined: 04 Feb 2008
Location: New Zealand
Online Status: Offline
Posts: 55
Quote rvink Replybullet Posted: 28 Sep 2010 at 11:44am
Originally posted by DBlank

i could be wrong but I do not think you can do this because you are trying to compare a number that crystal does not have which is a distinctcount of all values before the select expert is applied.
If you include that as a column in the data source you could do it, or if you change it to doing group record selection maybe yuo can do it. Otherwise I think you have to use the 'All' in your select options.

If the parameter comes from a drop-down list which is dynamically populated, then the above solution does not work - you cannot include"All" unless it is in the data. In this case I suspect the parameter options are being coded manually, so it is possible to add "All" to the list.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 28 Sep 2010 at 11:48am
Yes I was assuming this was a dynamic parameter and also that one would use a UNION command to add an 'All' option (assuming they cannot do that in the DB itself).
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.047 seconds.