Former Member

i have a table in my view,there is a price column in it.

now i wanna display the total price in the view......

but i am so confusing where put it in.

i have a idea that is <b>putting it to the right of table'page function</b> .

but i cann't realize it,how to realize that?

thanks.

10|10000 characters needed characters exceeded

### Related questions

• Posted on Mar 23, 2007 at 07:29 AM

Hi Wingoal,

Do u want to display the Total Price Right ?.

U can create tool Bar Input field/Text Viewfor ur table and display thr.

Step1:Right click ur table node in root element Container

Step2:Create Tool Bar UI element for ur Table

step3: Create Context Attribute for TotalPrice.

Step4:Bind this node with Tool Bar UI element (iNPUT FIELD/Textview)

step5: Write Appropriate code for calculating Toatl Price.

Hope this will solve ur problem.

Regards,

Ramganesan K.

10|10000 characters needed characters exceeded
• Former Member Former Member

Hi,

Please go through this tutorial, which displays total price of a column in a table.

• Posted on Mar 23, 2007 at 08:33 AM

Wingoal,

A table is nothing but a set of rows . each row in a table contains set of fields called colunms.Since each row in table contain same set of fields as other row in the same table.So u can not append a row whose fields varied than previous row.

But u can add one more column called total price.and u can calculate cumulative total for each row. The last row give u the total price .

[Awarding Points always appreciated ðŸ˜Š ]

Regards,

Ramganesan K.

10|10000 characters needed characters exceeded
• Former Member
Posted on Mar 23, 2007 at 09:23 AM

Hi wingoal,

1) you can create a text view/ input field anywhere on your view,

2) attach a context variable "Total" to that text view/input field,

3) Calculate the total from the table

4) Set the context variable "Total" with the value you obtained in step 3

Here is the detailed procedure to calculate the total:

<b>int size = wdContext.node<tableNodeName>.size();

int total = 0;

for (int i = size - 1; i>=0; i--)

{

total = total + wdContext.node<tableNodeName>.get<tableNodeName>ElementAt(i).get<nameOftheattributeforPrice>();

}</b>

Now, set the context attribute "Total" with the value obtained in the variable "total"

<b>wdContext.currentContextElement.setTotal(total);</b>

Thanks and Regards,

Reena

10|10000 characters needed characters exceeded
• Posted on Jun 13, 2007 at 07:08 AM

Let me first understand your problem.

You have a table having some columns and one of the column is Price(Total Price).

Now you want to calculate a value and put it somewhere in the row(ur idea of putting it to the right end of the table).

Is that right?

If that is so and you already have the values that u need in the calculation. You can create the column at the runtime.

Add a column to the table and set the calculated value to that column.

use textview editor to create the column.

Do this processing in wdModifyView of the view.