Page 1 of 1
Compilation errors - Expression expected
Posted: Wed May 17, 2017 10:40 pm
by ddsmith99301
I am getting two compilation errors when it tries to parse this line.
Public Sub DataBand1_Rendering(ByVal sender As Object, ByVal e As System.EventArgs)
IIF((Stimulsoft.Report.Dictionary.StiFunctionsDate.Year(QueryResults.Policy_Expiration_Date)) == (Stimulsoft.Report.Dictionary.StiFunctionsDate.Year(Today)), (SumTotalPremiumCurrentYear += QueryResults.Policy_Total_Premium), (SumTotalPremiumPreviousYear += QueryResults.Policy_Total_Premium))
End Sub

- Compilation Errors.jpg (34.62 KiB) Viewed 3907 times
I attached the mrt file. Please take a look and let me know what I need to do to fix it.
Re: Compilation errors - Expression expected
Posted: Thu May 18, 2017 12:15 pm
by Kubekin Yuriy
Hello, ddsmith99301.
We see unusual action. This issue is sent to our developers.
We will let you know when it will be fixed.
Thank you.
Re: Compilation errors - Expression expected
Posted: Thu May 18, 2017 5:13 pm
by ddsmith99301
I did determine why it was giving me errors, but the IIF statement still doesn't work. I replaced the comparison operator '==' with '='. I am using VB not c#. I am using version 2013.3.1800
This is the statement that parses okay, but does not produce the expected result. Neither of the two variables is updated.
IIF((Year((QueryResults.Policy_Expiration_Date))=Year(Today)), SumTotalPremiumCurrentYear = SumTotalPremiumCurrentYear + (QueryResults.Policy_Total_Premium), SumTotalPremiumPreviousYear = SumTotalPremiumPreviousYear + (QueryResults.Policy_Total_Premium))
This statement works perfectly in the same event. So, I know it isn't that part of the IIF statement that is not working.
SumTotalPremiumCurrentYear = SumTotalPremiumCurrentYear + (QueryResults.Policy_Total_Premium)
Re: Compilation errors - Expression expected
Posted: Thu May 18, 2017 6:14 pm
by ddsmith99301
This statement doesn't work either.
IIF(1=1,SumTotalPremiumCurrentYear = 20,SumTotalPremiumCurrentYear = 30)
Re: Compilation errors - Expression expected
Posted: Sat May 20, 2017 10:09 am
by HighAley
Hello.
Sorry, it's impossible to use the IIF function this way.
It should return false.
Please, try to use next expression:
Code: Select all
SumTotalPremiumCurrentYear = IIF(1=1, 20, 30)
Thank you.