Variable changing its value for no apparent reason
Posted: Tue Jan 31, 2017 1:41 pm
Hi all,
I've been working with Stimulsoft for the past month and a half and I've encountered some problems that I've been able to overcome. But since yesterday I have a problem that is driving me nuts.
I have a series of reports where I display the info of an Invoice/Order/etc, and below I display the info of the Lines. In a footer band I show the VAT breakdown as follows:
VAT 1 Value (Amount summed by the lines with VAT 1) VAT 1 Amount
VAT 2 Value (Amount summed by the lines with VAT 2) VAT 2 Amount
For example:
Tax 20% (200 €) 40€
Tax 10% (1000 €) 100€
Thing is I just want to show the amount in brackets if there is more than one tax. In order to do so, I do the following:
1. In the Invoice Databand initialize a variable: "ForTaxBreakdown" = ""; //It is a string instead of a bool because I was getting type errors in the IIF
2. In the Lines Databand I compare the different taxes, and if there is more than one, I get: ForTaxBreakdown = "1";
3. In the VAT Breakdown I use "ForTaxBreakdown" to either show (if it's a "1") or hide (if it's empty, = "") the amount in brackets.
What happens is the following:
1. I initialize the variable and see it's empty.
2. When comparing, I see that the variable is now "1".
3. In this point, and I can't imagine how, the variable value is now 0 again, although no processing has been done since point 2. In fact, 3 is just behind 2.
I am using this exact same processing in 6 or 7 different reports and it works as it should, getting ForTaxBreakdown="1" in point 3.
Can please anyone shed some light about this problem?
Thanks a lot in advance.
I've been working with Stimulsoft for the past month and a half and I've encountered some problems that I've been able to overcome. But since yesterday I have a problem that is driving me nuts.
I have a series of reports where I display the info of an Invoice/Order/etc, and below I display the info of the Lines. In a footer band I show the VAT breakdown as follows:
VAT 1 Value (Amount summed by the lines with VAT 1) VAT 1 Amount
VAT 2 Value (Amount summed by the lines with VAT 2) VAT 2 Amount
For example:
Tax 20% (200 €) 40€
Tax 10% (1000 €) 100€
Thing is I just want to show the amount in brackets if there is more than one tax. In order to do so, I do the following:
1. In the Invoice Databand initialize a variable: "ForTaxBreakdown" = ""; //It is a string instead of a bool because I was getting type errors in the IIF
2. In the Lines Databand I compare the different taxes, and if there is more than one, I get: ForTaxBreakdown = "1";
3. In the VAT Breakdown I use "ForTaxBreakdown" to either show (if it's a "1") or hide (if it's empty, = "") the amount in brackets.
What happens is the following:
1. I initialize the variable and see it's empty.
2. When comparing, I see that the variable is now "1".
3. In this point, and I can't imagine how, the variable value is now 0 again, although no processing has been done since point 2. In fact, 3 is just behind 2.
I am using this exact same processing in 6 or 7 different reports and it works as it should, getting ForTaxBreakdown="1" in point 3.
Can please anyone shed some light about this problem?
Thanks a lot in advance.