Expression Error

Stimulsoft Reports.NET discussion
Andy1120
Posts: 46
Joined: Mon Oct 27, 2014 2:19 am

Expression Error

Post by Andy1120 »

HI.
I write an expression like this "{IIF(price1==0,IIF(Sum(quantity)==0,Sum(amount),Sum(amount)/Sum(quantity)),price2)}" .
it is get error that Sum is not exists.Why! how can I do ?
Thank you.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Expression Error

Post by HighAley »

Hello.

Could you specify where do you use this expression.
Please, send us your report template for analysis.

Thank you.
Andy1120
Posts: 46
Joined: Mon Oct 27, 2014 2:19 am

Re: Expression Error

Post by Andy1120 »

Hello
I use it in the column expression ,it is the dispaly value in the data area
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Expression Error

Post by Alex K. »

Hello,

Please try to use the Totals.Sum() function.
If it is does not help, please send us a sample report with test data for analysis.

Thank you.
Andy1120
Posts: 46
Joined: Mon Oct 27, 2014 2:19 am

Re: Expression Error

Post by Andy1120 »

Hello
I use it in the column expression which is in the data area.if the expression is like “{IIF(price1==0,sum(amount)/sum(qty),price2)}” that is correct. if the expression has two IIF and uses the function of Sum that is error.it says the sum is incorerct,How Can I do?
Thank you!
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Expression Error

Post by HighAley »

Hello.

Please, send us a report template with sample data to reproduce the issue.

Thank you.
Andy1120
Posts: 46
Joined: Mon Oct 27, 2014 2:19 am

Re: Expression Error

Post by Andy1120 »

hello
I send a report template to you.you can see it in attachment.I use the exspression in the price column.
Thank you.
Attachments
rptstock_ios2.mrt
(64.62 KiB) Downloaded 188 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Expression Error

Post by Alex K. »

Hello,

Please simplify your sample report and send us, also please send us a test data for your report.

Thank you.
Andy1120
Posts: 46
Joined: Mon Oct 27, 2014 2:19 am

Re: Expression Error

Post by Andy1120 »

hello
I send a report template and date to you.you can download it in attachment.
Thank you.
Attachments
product.CSV
(90 Bytes) Downloaded 162 times
Report.mrt
(13.7 KiB) Downloaded 186 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Expression Error

Post by Alex K. »

Hello,

Please try to use the Totals.Sum() function.

Thank you.
Post Reply