Hi everyone,
Does anyone know how to write and iff statement for a report on this expression?
=Cstr(Choose(16,Split(Cstr(ReportItems!PageHeaderCaptions.Value),Chr(177))))
I've used the below code for my other reports but it seems to not work on the above..
=IIF(Code.GetData(24,3) = "CAD","CAD","USD")
can anyone give me some pointers?
-rico1931
0
Answers
=IIF(expression, IfExpressionIsTrueThisIsTheResult,IfExpressionIsNotTrueThisIsTheResult)
Hi,
All i'm trying to do is the following : If there is no Currency code present (meaning "Blank") Show USD..
I'm trying to do this on the Purchasing Order report where they have the following code in the header
=Cstr(Choose(16,Split(Cstr(ReportItems!PageHeaderCaptions.Value),Chr(177))))
This and the Purchasing quote are the only reports where I find they write the expressions like this. Every other report is much more simpler using the Code.GetData () ...all i want to do is write a simple IIF statement ](*,)
All i'm trying to do is the following : If there is no Currency code present (meaning "Blank") Show USD..
I'm trying to do this on the Purchasing Order report where they have the following code in the header
[/quote]
Not sure I understood your problem but...
You could try with something like the following:
It works as expected... More or Less...
=Cstr(Choose(16,Split(Cstr(ReportItems!PageHeaderCaptions.Value),Chr(177))))
Above is the expression in the text box that returns the Customer Cards Foreign Currency. What I need is a IIF statement that says something like the following
=IIF(Cstr(Choose(16,Split(Cstr(ReportItems!PageHeaderCaptions.Value),Chr(177)))) = This part I need help on
We have multiple currency like CAD, EUR, etc.. the above "This part I need help on" I want to put IIF =Cstr(Choose(16,Split(Cstr(ReportItems!PageHeaderCaptions.Value),Chr(177)))) = BLANK to always return USD
that's it..
and i've been having a complete brain fart on how to write that part..
I hope this is better explained.. i'm sorry everyone.
=IIF(Cstr(Choose(16,Split(Cstr(ReportItems!PageHeaderCaptions.Value),Chr(177)))) = "","USD",Cstr(Choose(16,Split(Cstr(ReportItems!PageHeaderCaptions.Value),Chr(177)))))
ArcherPoint, Inc http://www.archerpoint.com
Blog: http://www.navisionworld.com
skkulla
Thanks for the reply but this is actually the first thing I tried and I got a syntax error. It doesn't like Cstr(Choose(16,Split(Cstr(ReportItems!PageHeaderCaptions.Value),Chr(177)))) being used twice as an expression in the report header.
You can use the same approach as in Code.SetData and Code.GetData
If you are already doing a SetData you can simply add this to the code in your Report.
For example if you create a function like this (given that the currency code is in Data1):
Public Function GetCurrencyCode as Object
if Cstr(Choose(16, Split(Cstr(Data1),Chr(177)))) = "" then
Return "USD"
else
Return Cstr(Choose(16, Split(Cstr(Data1),Chr(177))))
end if
Then use Code.GetCurrencyCode in your report
Gunnar Gestsson
Microsoft Certified IT Professional
Dynamics NAV MVP
http://www.dynamics.is
http://Objects4NAV.com