How to multiply 2 data fields?

Stimulsoft Reports.NET discussion
Chan Kuan Leang
Posts: 74
Joined: Sun May 20, 2007 9:14 pm
Location: Singapore

How to multiply 2 data fields?

Post by Chan Kuan Leang »

Hi, I have just started using this stimulReport.net.

I have a questions & I hope someone in the forum can help me.

How do I create a calculated fields? For example, I want to multiply 2 data fields in the database together (Qty) * (Unit Price)

Thanks.
Smile
Chan Kuan Leang
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

How to multiply 2 data fields?

Post by Edward »

Please see the following flash tutorial:

http://www.stimulsoft.com/livedemos/Rep ... ields.html

Thank you.
Chan Kuan Leang
Posts: 74
Joined: Sun May 20, 2007 9:14 pm
Location: Singapore

How to multiply 2 data fields?

Post by Chan Kuan Leang »

Edward wrote:Please see the following flash tutorial:

http://www.stimulsoft.com/livedemos/Rep ... ields.html

Thank you.
Thanks. I have saw it. But, it does not allow to multiply Data Type Double & Decimal
Is there another way to go about it?

Is there anyway to change the type or convert the data from Double to Decimal

Thank you so much.
Smile
Chan Kuan Leang
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

How to multiply 2 data fields?

Post by Edward »

In the calculated column definition you may use any expression. The result of that expression must equals to the type of Calculated Column.
So you can type the following in the definition of the Column with decimal type:

Code: Select all

(decimal)Orders.EmployeeID*(decimal)Orders.Freight)
Thank you.
Chan Kuan Leang
Posts: 74
Joined: Sun May 20, 2007 9:14 pm
Location: Singapore

How to multiply 2 data fields?

Post by Chan Kuan Leang »

Edward wrote:In the calculated column definition you may use any expression. The result of that expression must equals to the type of Calculated Column.
So you can type the following in the definition of the Column with decimal type:

Code: Select all

(decimal)Orders.EmployeeID*(decimal)Orders.Freight
Thank you.
Thank you so much for helping to solve this problems.
Smile
Chan Kuan Leang
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

How to multiply 2 data fields?

Post by Edward »

Let us know if you need any help.

Thank you.
fiorent
Posts: 3
Joined: Wed May 01, 2024 5:34 am

Re: How to multiply 2 data fields?

Post by fiorent »

Hello. I applied that but it didn't work. The code was like that: {Sales.Quantity}*{Sales.Amount} and result was shown as 24*60.000. So, how can I do multiplication of two data on a table
Lech Kulikowski
Posts: 7334
Joined: Tue Mar 20, 2018 5:34 am

Re: How to multiply 2 data fields?

Post by Lech Kulikowski »

Hello,

You should use the following expression:
{Sales.Quantity * Sales.Amount}

Thank you.
fiorent
Posts: 3
Joined: Wed May 01, 2024 5:34 am

Re: How to multiply 2 data fields?

Post by fiorent »

Lech Kulikowski wrote: Tue May 28, 2024 1:51 pm Hello,

You should use the following expression:
{Sales.Quantity * Sales.Amount}

Thank you.
It worked! Thank you so much :)
Lech Kulikowski
Posts: 7334
Joined: Tue Mar 20, 2018 5:34 am

Re: How to multiply 2 data fields?

Post by Lech Kulikowski »

Hello,

You are welcome.
Post Reply