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!

Record selection

Status
Not open for further replies.

hariomhari

Programmer
Aug 13, 2007
31
GB
I am using crystal report - CR XI R2.

I have 3 parameters in report.

1. PortfolioID
2. Strategy
3. Custody

I want that if user doesn't supply any value for Parameter Custody then it should consider the value of only PortfolioID and strategy. It should not consider Custody as a record selection criteria. In record selection can we do somehing like

{vwj_Cl_AssetAllocation.strategy} = {?@Strategy} and
{vwj_Cl_AssetAllocation.portfolioid} = {?@PortfolioID} and
if {?@Custody}='' then
don't consider
else
consider

Please suggest me how to write / achieve the desired result
 
You can do something like this:
Code:
{vwj_Cl_AssetAllocation.strategy} = {?Strategy} and
{vwj_Cl_AssetAllocation.portfolioid} = {?PortfolioID} and
({?Custody}='' or IsNull({?Custody}) or {vwj_Cl_AssetAllocation.custody} = {?Custody})

-----------------------------------------------------------------------------------------------------------------------------
"Now I can look at you in peace; I don't eat you any more." Franz Kafka, while admiring fish in an aquarium
 
I don't think you can exit the parameter screen unless you specify a value for Custody. I would modify the Custody parameter and insert a "None" as the default value and modify the Custody part of the record selection to

(
if {?Custody} <> 'None' then {vwj_Cl_AssetAllocation.custody} = {?Custody}
)

-lw
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top