Skip to Content
author's profile photo Former Member
Former Member

about table.

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • 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.

    Add a comment
    10|10000 characters needed characters exceeded

  • 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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 23, 2007 at 09:23 AM

    Hi wingoal,

    If you do not want to add an additional row to your table,

    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

    Add a comment
    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.