Page 1 of 1

Report compilation error when using SumD

Posted: Tue Sep 16, 2014 9:47 am
by olegtr
Hi,
I'm working with Stimulsoft.Reports.Net 2014.1.
We use business objects for data source.

Using the following expression with SumD in one of the text boxes causes multiple errors of comilation:
{Transaction.Basket.Totals.TotalPrice.Amount - SumD(Transaction.Basket.Items.ItemTotals.TotalPrice.Amount)}

The errors look like:
The error of compilation
The error of compilation is found in the 'Report' report:
Invalid expression term ','


Looking at auto generated code i see that the generated code is wrong. See the red part below that is not part of any function and causes compilation errors.

public void GetTotal1(object sender, Stimulsoft.Report.Events.StiValueEventArgs e)
{
e.Value = null;
}
public void Text2__GetValue(object sender, Stimulsoft.Report.Events.StiGetValueEventArgs e)
{
e.Value = "#%#{Transaction.Basket.Totals.TotalPrice.Amount - SumD(Transaction.Basket.Items.ItemTotals.TotalPrice.Amount)}";
e.StoreToPrinted = true;
}
public System.String Text2_GetValue_End(Stimulsoft.Report.Components.StiComponent sender)
{
return ToString(sender, Transaction.Basket.Totals.TotalPrice.Amount - ((double)(StiReport.ChangeType(this.Text2_SumD.GetValue(), typeof(double), true)), this, "GetTotal1"), true);
}

If i change the expression to use Totals.SumD then errors disapear:
{Transaction.Basket.Totals.TotalPrice.Amount - Totals.SumD(Transaction.Basket.Items.ItemTotals.TotalPrice.Amount)}

But if i have something like this the error is back with the same bad auto-generated code:
{Transaction.Basket.Totals.TotalPrice.Amount - (22 - Totals.SumD(Transaction.Basket.Items.ItemTotals.TotalPrice.Amount))}

public void Text2__GetValue(object sender, Stimulsoft.Report.Events.StiGetValueEventArgs e)
{
e.Value = ToString(sender, Transaction.Basket.Totals.TotalPrice.Amount - (22 - Totals.SumD(Transaction.Basket.Items.ItemTotals.TotalPrice.Amount), this, "GetTotal1"), true);
}

We just moved from 2010.3 version to 2014.1 and started to experience this problem.
We have many reports that already use this SumD function and they all worked OK in 2010.3 version.
We need you to fix this so that it would work as before.

Thank you,
Oleg

Re: Report compilation error when using SumD

Posted: Fri Sep 19, 2014 6:05 am
by Alex K.
Hello,

It is not issue with SumD function, engine incorrect parse the column in expression which contain reserved word "Totals" - "Transaction.Basket.Totals.TotalPrice.Amount"
The issue is fixed. The fix will be available in the next relerase in the end of this month.

Thank you.

Re: Report compilation error when using SumD

Posted: Mon Sep 22, 2014 10:04 am
by olegtr
Thank you.

Re: Report compilation error when using SumD

Posted: Mon Sep 22, 2014 10:41 am
by Alex K.
Hello,

We are always glad to help you!
Let us know if you need any additional help.

Thank you.