Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Parameter if not entered Post Reply Post New Topic
<< Prev Page  of 4 Next >>
Author Message
Minco
Groupie
Groupie
Avatar

Joined: 28 Nov 2012
Location: United States
Online Status: Offline
Posts: 62
Quote Minco Replybullet Posted: 12 Sep 2013 at 6:38am
They would not enter both, and they do not need to enter at least one - in fact, most of the time this runs, there is no specification other than the date range. But, there are a few times when the report needs to be more specific with EITHER a customer OR a state choice.
Be kind to those less fortunate.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Sep 2013 at 6:54am
since I assume that they can enter both which do you want to trump the other? Or do you want it to return a warning that they need to fix their selection?
IP IP Logged
Minco
Groupie
Groupie
Avatar

Joined: 28 Nov 2012
Location: United States
Online Status: Offline
Posts: 62
Quote Minco Replybullet Posted: 12 Sep 2013 at 6:59am
I hadn't thought of that, but it would be nice to return a warning that "You cannot select both Customer and State"
Be kind to those less fortunate.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Sep 2013 at 7:26am
(
 //runs for all records if both are blank
(not(hasvalue(?state) and hasvalue(?client))
or
//run for only state
(hasvalue(?state) and ?state=table.statefield and not(hasvalue(?client)))
or
//run for only client
(hasvalue(?client) and ?client=table.clientfield and not(hasvalue(?state)))
)
and any other conditions here
 
 
in the reprot you can create a formula as something like:
if hasvalue(?state) and hasvalue(?client) then "Please do not select both a client and state, only select one of the parameters" else ""
 
and dispaly it at th top of your report with a condition to hide it
IP IP Logged
Minco
Groupie
Groupie
Avatar

Joined: 28 Nov 2012
Location: United States
Online Status: Offline
Posts: 62
Quote Minco Replybullet Posted: 12 Sep 2013 at 7:38am
Thanks again DB - I'll try this out!
Be kind to those less fortunate.
IP IP Logged
Minco
Groupie
Groupie
Avatar

Joined: 28 Nov 2012
Location: United States
Online Status: Offline
Posts: 62
Quote Minco Replybullet Posted: 12 Sep 2013 at 7:55am
{SERREQUEST.CREDAT_0} = {?Date Range} and
(
//runs for all records if both are blank
(not(hasvalue({?GroupBy BPC}) and not(hasvalue({?Customer BPC}))
or
//runs for only GroupBy
(hasvalue({?GroupBy BPC}) and {?GroupBy BPC} = {BPCUSTOMER.BPCGRU_0} and not(hasvalue({?Customer BPC})))
or
//run for only Customer
(hasvalue({?Customer BPC}) and {?Customer BPC} = {BPCUSTOMER.BPCNUM_0} and not(hasvalue({?GroupBy BPC})))
)
 
This tells me there is ) missing.... I'm not using the state field, instead I am using a Grouping field that serves as a field to group like-type customers together.
Be kind to those less fortunate.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Sep 2013 at 8:03am
{SERREQUEST.CREDAT_0} = {?Date Range} and
(
(not(hasvalue({?GroupBy BPC}) and not(hasvalue({?Customer BPC})))
or
(hasvalue({?GroupBy BPC}) and {?GroupBy BPC} = {BPCUSTOMER.BPCGRU_0} and not(hasvalue({?Customer BPC})))
or
(hasvalue({?Customer BPC}) and {?Customer BPC} = {BPCUSTOMER.BPCNUM_0} and not(hasvalue({?GroupBy BPC})))
)
IP IP Logged
Minco
Groupie
Groupie
Avatar

Joined: 28 Nov 2012
Location: United States
Online Status: Offline
Posts: 62
Quote Minco Replybullet Posted: 12 Sep 2013 at 8:06am
Yes, I did see that after I looked it over for the 8th time.. :)
 
I made the formula for the warning but I'm having a hard time suppressing it in the report header. You mentioned "hide it" but I'm not familar with hiding.
Be kind to those less fortunate.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Sep 2013 at 8:24am

create a second report header

place the formula field in it
select the section expert
select the new report header
click on the formula box (x-2) nex to "suppress(no drill down)"
add your conditional formula here
if your formula evlautes to TRUE it suppresses the section so use
NOT(hasvalue(?state) and hasvalue(?client))
 
IP IP Logged
Minco
Groupie
Groupie
Avatar

Joined: 28 Nov 2012
Location: United States
Online Status: Offline
Posts: 62
Quote Minco Replybullet Posted: 13 Sep 2013 at 4:07am
My selection criteria is not working as it should. When I put in a customer code or a group customer code, the report returns ALL customers.... no matter what I key in. The top part of this selection is defining the miscellaneous tables that I'm linking to, in order to get descriptions for codes, but the later part is the code that is supposed to single out customer codes when required.
 
{ATEXTRA2.IDENT1_0} = "447" and
{ATEXTRA2.LANGUE_0} = "ENG" and
{ATEXTRA2.ZONE_0} = "LNGDES" and
{ATEXTRA2.CODFIC_0} = "ATABDIV" and
{ATEXTRA1.IDENT1_0} = "446" and
{ATEXTRA1.LANGUE_0} = "ENG" and
{ATEXTRA1.ZONE_0} = "LNGDES" and
{ATEXTRA1.CODFIC_0} = "ATABDIV" and
{ATEXTRA0.IDENT1_0} = "445" and
{ATEXTRA0.LANGUE_0} = "ENG" and
{ATEXTRA0.ZONE_0} = "LNGDES" and
{ATEXTRA0.CODFIC_0} = "ATABDIV" and
(
//runs for the date range parameter
{SERREQUEST.CREDAT_0} = {?Date Range}
and
//runs for all records if both are blank
(not(hasvalue({?GroupBy BPC}) and not(hasvalue({?Customer BPC}))))
or
//runs for only GroupBy
(hasvalue({?GroupBy BPC}) and {?GroupBy BPC} = {BPCUSTOMER.BPCGRU_0} and not(hasvalue({?Customer BPC})))
or
//run for only Customer
(hasvalue({?Customer BPC}) and {?Customer BPC} = {SERREQUEST.SREBPC_0} and not(hasvalue({?GroupBy BPC})))
)
 
Am I doing this correctly?
Thanks for your help!
Be kind to those less fortunate.
IP IP Logged
<< Prev Page  of 4 Next >>
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.016 seconds.