Page 1 of 1

How to avoid this sum-issue in Stimulsoft

Posted: Wed Jan 15, 2014 11:59 am
by l.rohrmann
I use 'Stimulsoft Reports.Net' to calculate a total price based on multiple items with different prices, ammount and tax-rates. This is my code:

Code: Select all

{
    Sum
    (
        DataBandTax,
        (
            Positions.UnitPrice *
            Positions.Amount *
            (
                Positions.Article.TaxRate +
                100
            )
        ) /
        100
    )
}
Positions is a Bussines-Object, each object of Positions contains exactly one Article. While Positions.UnitPrice and Positions.Amount are multiplied correctly, Stimulsoft uses for every calculation the same Positions.Article.TaxRate, instead the TaxRate which fits to its Position.
For example:

Code: Select all

Position | UnitPrice | Amount | TaxRate
1        |    100    |    3   |    5
2        |     50    |   10   |   10
3        |     20    |    5   |    3
So the calculation should be:

Code: Select all

  ((100 * 3 * (5 + 100)) / 100)
+ ((50 * 10 * (10 + 100)) / 100)
+ ((20 * 5 * (3 + 100)) / 100)
= 315 + 550 + 103
= 968
Instead Stimulsoft calculates this: (In this example it uses only the TaxRate of Position 1)

Code: Select all

  ((100 * 3) + (50 * 10) + (20 * 5)) 
* (1+(5/100))
= (300 + 200 + 100) * 1.05
= 600 * 1.05
= 630
How do I stop stimulsoft from doing so?

Re: How to avoid this sum-issue in Stimulsoft

Posted: Thu Jan 16, 2014 10:14 am
by Alex K.
Hello,

Can you please send us a sample report with test data which reproduce the issue for analysis.

Thank you.

Re: How to avoid this sum-issue in Stimulsoft

Posted: Thu Jan 16, 2014 11:17 am
by l.rohrmann
The issue was solved by changeing the location of TaxRate from Positions.Article.TaxRate to Positions.TaxRate.

Re: How to avoid this sum-issue in Stimulsoft

Posted: Thu Jan 16, 2014 12:05 pm
by Alex K.
Hello,

Ok.
Let us know if you need any additional help.

Re: How to avoid this sum-issue in Stimulsoft

Posted: Fri Jan 17, 2014 8:43 am
by l.rohrmann
Actualy I do, but on another question: http://forum.stimulsoft.com/viewtopic.php?f=8&t=38003

Re: How to avoid this sum-issue in Stimulsoft

Posted: Fri Jan 17, 2014 12:20 pm
by Alex K.
Hello,

Can you please send us a sample with test data for analysis.
Also please see the samples with business objects in our Demo.

Thank you.