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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal 8.5 to 7 - Select Criteria Conversion Problem

Status
Not open for further replies.

jwkolker

Programmer
Jan 9, 2003
68
0
0
US
Hello:

I need to save down an 8.5 report to a 7 report (so that that 3rd party software's dll's can run the report)...

At any rate the 8.5 report runs fine using this criteria but the 7 returns errors - are there any issues that can be fixed to have this run in 7 too?

Code Follows:

Code:
({fund_invest_hist.shares_after} > 0) and 
(if {?Fund} = 'ALL' then true 
else 
{vReports.parent_fund_name} = {?Fund}) and 
(if {?Expired} = "Expired" then {investment.warrant_expiration_date}<CurrentDate 
else if {?Expired} = "Not Expired" then 
{investment.warrant_expiration_date}>=CurrentDate 
else if {?Expired} = "No Expiration Criteria" then 
{investment.warrant_expiration_date}>Date(01/01/1900)) and 
({security.security_name} like "Warrant*") and 
{company.company_category} <> "sold"

John Kolker
Programmer
jwkolker@comcast.net
 
Version 8.5 lets you AND to an if statement, version 7 does not. You will have to inbed the logic in your first line of your code within the if statement.
 
By the way, I didn't realize you could AND to an if statement in 8.5 untill your request. Your really helped speed up one of my reports. THANKS

I'm giving you a star for your question.
 
Hello - guys - could you make the tweek to the code so that I can "see" it - I really don't know what to do with the and if statement.

John Kolker

John Kolker
Programmer
jwkolker@comcast.net
 
Code:
booleanVar cond1;
booleanVar cond2;

if {?Fund} = 'ALL' then 
    cond1:=true
else 
    cond1:=({vReports.parent_fund_name} = {?Fund});

if {?Expired} = "Expired" then 
    cond2:=({investment.warrant_expiration_date}<CurrentDate)
else if {?Expired} = "Not Expired" then 
    cond2:=({investment.warrant_expiration_date}>=CurrentDate)
else if {?Expired} = "No Expiration Criteria" then 
    cond2:=({investment.warrant_expiration_date}>Date(01/01/1900));


({fund_invest_hist.shares_after} > 0) and 
({security.security_name} like "Warrant*") and 
{company.company_category} <> "sold" and 
cond1 and 
cond2
 
Version 7 is still struggling with the new version of code above - it thinks that criteria is missing.

Please look at it for any obvious causes - thanks for the sample.

John

John Kolker
Programmer
jwkolker@comcast.net
 
Sorry, I don't have a version of 7 around anymore to toy with. Can anyone else jump in here?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top