Click here to Skip to main content
15,916,019 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I am using C# VS2010.With my report I am having function for sum the value by condition.It's working good, but as a starting value it's bringing from the previous period.Hence how to clear this problem?
Thank you
C#
my function code
-----------------
Public MyValue as Decimal = 0 
Public Function MyAddToSum(ByVal mytax as Decimal) as Decimal   
MyValue = mytax + MyValue   
Return MyValue 
End Function 

My text box expression
----------------------
=Code.MyAddToSum(SUM(IIF(Fields!tax.Value="VAT", Fields!cst_vat_amount.Value, 0)))

output
------
date cst_vat_amount
01/01/2016 100.00
code.MyAddToSum() showing the startup value 10100.00, the value10000 coming from
unknown period. Therefore how to clear this problem?

Thanks for the Guidances and helps
Thanks again

What I have tried:

I try to add the common data field cst_vat_amount from the dataset when the field tax="VAT". Field cst_vat_amount contains cst value & vat value. I need to add only vat value. Thanks
Posted
Updated 6-Apr-16 15:08pm
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900