cancel
Showing results for 
Search instead for 
Did you mean: 

How to format a table appended with a Total Line?

Former Member
0 Kudos

Hi all,

I'm to create a table with a total-line at the end of the table, but I failed to make the columns width of the total-line to be consistent with that of the table rows. As follows:

What I want is:

______Date|__Payable|Receivable |

12/20/2007|_____100 |_______100 |

12/21/2007|_____200 |_______200 |

----


_____Total |______300 |_______300 |

I created 3 separated fields for the total-line.

What I get is:

______Date|__Payable|Receivable |

12/20/2007|_____100 |_______100 |

12/21/2007|_____200 |_______200 |

----


__Total |______________300 |______________300 |

Could anyone please tell me that, how to set the total-line's columns width just the same as the table rows'?

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

create a new element and use the following format.

element.setdate("Total");

element.setpayable("300");

element.setreceivable("300");

wdContext.node<name>().addElement(element);

xxxxxxxxxxxxxxxxxxxx

Regards,

Subashini.J

Edited by: Armin Reichert on Jan 1, 2008 3:51 PM

Former Member
0 Kudos

Hi, Subashini,

Thank you for your advice. But this is not what I want.

In your code, the total-line is appended after the last table row, which may not appear on the first page of the table. And also, "Total" field doesn't has a date type, which prevents me from doing so.

What I want is, the total-line is separated from the table, but just the same column-width with the table rows.

Whatever the table rows and table pages are, the total-line always appears just below the table.

former_member485701
Active Participant
0 Kudos

Hi,

> Take a Transparent container

> Keep your table under this container

> And for total line you can use another Table or Row Repeater UI Element with a different

Node say "TotalNode" with cardinality 1:1.

Feel free to ask queries.

Regards,

Praveen

Former Member
0 Kudos

Hi,

Do you really want to keep the total row seperated? If no, then you can try this:

1. Insert a "FixedBottomCell" to each of the table columns.

2. Insert a "TextView" as the editor for the first FixedBottomCell. Set the "text" property to "Total".

3. Similarly insert TextViews to other FixedBottomCells as well and bind their text property to the appropriate context attributes.

Regards,

Satyajit.

Former Member
0 Kudos

Hi Satyajit,

Sorry for my fault. I didn't make it clear that I use NWDS 2004, which doesn't have "FixedBottomCell".

But still thank you very much for your information. Now I know how to deal with it in NWDS 2004S.

Former Member
0 Kudos

Hi Praveen,

Thank you for your suggestion.

It seems to work, but not very well. Besides, it limits me much.

In my example, because the first column could be "12/24/2007" (in Original_Table) or "Total" (in Total_Line_Table), the column has to take a type string, while type date couldn't be used any more.

Even so, even the Original_Table and Total_Line_Table have taken the same strucuture, the output length of the first column is still different - "12/24/2007" is much longer than "Total".

Could anyone provide a better solution?

Merry X'mas.

Edited by: gangtee gangtee on Dec 24, 2007 9:20 PM

Former Member
0 Kudos

Any helps?

Former Member
0 Kudos

Hi Gangtee,

I am not very sure of the solution, but what you can try is, set the "Width" property of both the corresponding columns, in both the tables, to same values.

With this, it may happen that, in the Table diaplaying Total, it will fall short off, for the first column. At this, you can set the width of second table, a bit more than the corresponding column from first table.

Hope it helps.

Regards,

Alka.

Former Member
0 Kudos

Hi Alka,

I'd like to take your way.

Thanks to all replies.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Create one separate node for the total and set its value attributes.

Create another table with no header and footer with the same width as that of the first table. Make visible rowcount as -1.

Place these 2 tables in the same transparent container without any space between the 2 tables (i.e without any invisible element between 2 tables).

It will look like a single table.

Hope this might solve your problem if my understanding is correct.

Regards,

Subashini.J