Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calculated expression from two expression
Message
From
30/09/2006 07:48:21
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
01158307
Message ID:
01158365
Views:
27
>Hi All,
>i've two field on detail band and has a below codes
>
>* for debit field
>
>IIF(crsresult.fischcode $ " '101','104','105','108','112','303','114','306','002','004','006'
,'012','014','016','019','020','026','028','037','039',
'040','044','202','309','310','007','008','023','024' ",crsresult.amount,0)
>
>
>* for credit field
>
>IIF(crsresult.fischcode $ " '102','103','106','109','113','115','001','003','005','011','013','015',;
 '017','018','025','027','036','038','041','045','201','301','302','311',;
 '312','009','010','021','022' ",crsresult.amount,0)
>
>
>it works fine for my need. i wantto also show at 3rd field debit-credit action,
>expressions is too long for this :(
>
>how can i do this ?
>
>any suggestion will be very appreciated
>
>TIA


Soykan,
I too agree with Mike,Hilmar and Gregory. You shouldn't hardcode.
Anyway since you did:

In routine calling report:
local lcDebitCodes, lcCreditCodes
local array aDebitCodes[1],aCreditCodes[1]
lcDebitCodes = "101,104,105,108,112,303,114,306,002,004,006,"+;
"012,014,016,019,020,026,028,037,039,040,044,202,309,310,007,008,023,024 "
lcCreditCodes = " 102,103,106,109,113,115,001,003,005,011,013,"+;
"015, 017,018,025,027,036,038,041,045,201,301,302,311, 312,009,010,021,022 "

ALINES(aDebitCodes,m.lcDebitCodes,.t.,',')
ALINES(aCreditCodes,m.lcCreditCodes,.t.,',')
Then in report you can say:
IIF(ASCAN(aDebitCodes, crsresult.fischcode, 1,-1,1,2+4)>0,crsResult.Amount,0)

IIF(ASCAN(aCreditCodes, crsresult.fischcode, 1,-1,1,2+4)>0,crsResult.Amount,0)

IIF(ASCAN(aDebitCodes, crsresult.fischcode, 1,-1,1,2+4)>0,crsResult.Amount,-crsResult.Amount)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform