Print Page | Close Window

in row calculation

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=22692
Printed Date: 30 April 2024 at 10:32pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: in row calculation
Posted By: skiman
Subject: in row calculation
Date Posted: 21 August 2015 at 4:57am
Hi,

I'm trying to use some in row calculation.

I have three columns:
Description, Quantity, Unit price.

I want to add another column: 'Total', And I added an extra item to each record.
oItem := oRecord:AddItem("")
oItem:format := "%.2f"
oItem:formula := "C1*C2"
oItem:caption := "x"

I expected/hoped that the result of this item would be shown in my new column. In my column the 'x' is shown?

Another way would be to have a formula for a Column. I was thinking of using the TAG property to put my formula in.

Any suggestions for this?



-------------
ABO Service



Replies:
Posted By: olebed
Date Posted: 28 August 2015 at 6:58am
Hello Chris,

Pattern for property "formula" is
SUMSUB(R#C#:R#C#) or SUM(R#C#:R#C#) 

R is row index and C is column index and  * instead of # - means all rows or columns

see "Formula Property" in documentation
C:\Program Files (x86)\Codejock Software\ActiveX\Xtreme SuitePro ActiveX v16.4.0\Help\SymbolReference.chm

So on setting caption: If formula is correct  then caption of ReportRecordItem  replaced with result  else caption text used. So to update text of item with formula you need to set any caption even empty string.

Regards,
 Oleksandr Lebed 


Posted By: skiman
Date Posted: 28 August 2015 at 7:16am
Hi,

I don't want to make a SUM, but I want to multiply two columns. I was expecting that C3*C4 would give me the result.

If C3 = 5 and C4 = 20 then C3*C4 would be 100.

With sumsub I can make subtotals on the grouprow, but I need a multiplication on a row.


-------------
ABO Service


Posted By: skiman
Date Posted: 31 August 2015 at 4:50am
With sumsub I can make subtotals on the grouprow, but I need a multiplication on a row.

In fact, I want to have a formula for a record:item.

I would like to have the possibility to add columns, and to define the formula for that column. I would add the item for each row, and to insert the value in that item. A value which is calculated according to a new formula.

The item has the formula property, so I would expect it can be used?


-------------
ABO Service



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net