Report compilation error when using SumD

Stimulsoft Reports.NET discussion
Post Reply
olegtr
Posts: 16
Joined: Mon Mar 07, 2011 10:14 am

Report compilation error when using SumD

Post 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
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Report compilation error when using SumD

Post 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.
olegtr
Posts: 16
Joined: Mon Mar 07, 2011 10:14 am

Re: Report compilation error when using SumD

Post by olegtr »

Thank you.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Report compilation error when using SumD

Post by Alex K. »

Hello,

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

Thank you.
Post Reply