How to divide using the function Previous()???

Stimulsoft Reports.WEB discussion
Post Reply
Jair RC
Posts: 21
Joined: Wed Jun 10, 2009 6:57 am
Location: Joinville, Brazil

How to divide using the function Previous()???

Post by Jair RC »


I have two records in my Dataset that are printed in a Databand and I need to divide the last by the first. I am using the bellow expression but there are ocurred errors.
What the format or sintax correct to divide it? I need to divide with two decimal places.

I am using:
{Div(dsMonthAvg.January, Previous(dsMonthAvg, "January"))}

The error thar occured:
c:\Documents and Settings\jair\Configurações locais\Temp\owx9bwz5.0.cs(495,77) : error CS1502: Melhor método sobrecarregado compatível com 'Stimulsoft.Report.Dictionary.StiFunctionsMath.Div(long, long)' tem alguns argumentos inválidos c:\Documents and Settings\jair\Configurações locais\Temp\owx9bwz5.0.cs(495,161) : error CS1503: Argumento '2': não pode converter de 'object' em 'long'.

Thanks for the help.

Jair RC
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

How to divide using the function Previous()???

Post by Jan »

Hello Jair,

Try following code:

Code: Select all

{Div(dsMonthAvg.January, (long)Previous(dsMonthAvg, "January"))}
Thank you.
Jair RC
Posts: 21
Joined: Wed Jun 10, 2009 6:57 am
Location: Joinville, Brazil

How to divide using the function Previous()???

Post by Jair RC »

Hello Jan,

Hello, Jan,

Unfortunately it did not work. No error occurred but did not make the division should do. I found a way to solve the problem, but I believe so I suggested that you should also work. I did like this:

SumD(dsComparativoMensalMedia.GetData ("February", 1)) / SumD(dsComparativoMensalMedia.GetData ("February", 0))

0 is the index of the first record of the Dataset.
1 is the index of the last record of the Dataset.

Thank you.

Jair RC

Post Reply