Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Allow blank parameter Post Reply Post New Topic
Author Message
dibblejon
Newbie
Newbie


Joined: 05 Jan 2011
Location: United Kingdom
Online Status: Offline
Posts: 32
Quote dibblejon Replybullet Topic: Allow blank parameter
    Posted: 23 Jul 2012 at 12:53am
Hi
 
Using Crystal XI I want to give the end user the option to leave multiple parameters blank for example
 
supplier = {Supplier?}
 
or group = {Group?}
 
or family = {Family?}
 
or part = {Part?}
 
All parameters allow multiple values - and I want only one of them selected at a a time for example supplier = {Supplier?} ignore all others
 
Any help would be great
IP IP Logged
yggdrasil
Senior Member
Senior Member
Avatar

Joined: 19 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 150
Quote yggdrasil Replybullet Posted: 23 Jul 2012 at 2:42am
When I had to do something similar, I had an overriding parameter asking which selection the user wanted to use.  On the basis of the answer to that, I used conditions in the  record selection to pick the right parameter detail. I had a default for all of them, so it didn't matter if they weren't used.
So {?selection} is Supplier, Group, Family, Part
and 
 If {?selection} = 'Supplier' then xxx = {?Supplier}
else if  {?selection} = ' Group'  then  etc....
IP IP Logged
dibblejon
Newbie
Newbie


Joined: 05 Jan 2011
Location: United Kingdom
Online Status: Offline
Posts: 32
Quote dibblejon Replybullet Posted: 23 Jul 2012 at 3:04am
Thanks I can see your logic but am missing something in my execution!
 
My selection is as here:
 
{ainvdet.layout_section} = "D" and
{ainvhead.salesman} startswith ["87", "86", "80", "75", "70", "69", "66"] and
{ainvdet.invoice_date} = {?Date} and
{salesman.name} like "*Tele*" and
if {?Selection} = "Group" then {ainvdet.product_group} = {?Group}
else if {?Selection} = "Family" then {stock.price_family} = {?Family}
else if {?Selection} = "Supplier" then {stock.main_supplier} = {?Supplier}
else if {?Selection} = "Parts" then {ainvdet.part} = {?Parts}
IP IP Logged
dibblejon
Newbie
Newbie


Joined: 05 Jan 2011
Location: United Kingdom
Online Status: Offline
Posts: 32
Quote dibblejon Replybullet Posted: 23 Jul 2012 at 3:05am
I get the choice of selection to start but when I don't enter a value in the unused parameters I still get asked for a value?
 
Have I got the wrong end of the stick?
IP IP Logged
dibblejon
Newbie
Newbie


Joined: 05 Jan 2011
Location: United Kingdom
Online Status: Offline
Posts: 32
Quote dibblejon Replybullet Posted: 23 Jul 2012 at 3:12am
Sorry
 
I had not added a default value into each parameter
 
This has worked now - Thanks for all your helpSmile
IP IP Logged
dibblejon
Newbie
Newbie


Joined: 05 Jan 2011
Location: United Kingdom
Online Status: Offline
Posts: 32
Quote dibblejon Replybullet Posted: 23 Jul 2012 at 4:45am
As a footnote.....
 
Is there anyway to make the default value blank so the user doesn not see it?
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.016 seconds.