cancel
Showing results for 
Search instead for 
Did you mean: 

Table UI subtotal and total

Former Member
0 Kudos

Hi,

I want to add subtotal and total lines a Table UI. Is it possible ? I dont want automatic calculation. Only I want to add special lines. First four cell looks one blank cell, next 5. cell looks as in previous lines.

Best regards,

Altug Bayram

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

If your requirement is to create additional columns ,say for the Total fields, then this is made possible using

"IWDTableColumn".

Else, if an additional row is needed to display the total, then create an extra row element for the table, and calculate the total by looping through the other rows and display the same in the new row that was created.

Former Member
0 Kudos

Your requirement is not much clear

Former Member
0 Kudos

Hi,

----


--
+

+
---+

+ R-1000 + R-1000 description + 123,45 + USD +

----


--
+

+
---+

+ P-100 + P-100 description + 456,00 + USD +

----


--
+

+
---+

+ IDES AG (GREMANY) + 579,45 + USD +

----


--
+
---+

+ ....

This is i want to do. Is it clear ?

Best regards,

Altug Bayram

Former Member
0 Kudos

You may create additional table row elements for displaying the totals.Create a row and set the first field(or first&second fields combined) as "IDES AG (GREMANY)", and for the total-field, sum up the amounts until that row thru a loop, and fix the result in the cell corresponding to the amounts field.

Former Member
0 Kudos

True...

Iterate through the context

pseudo code


double sum;
for(int i = 0 ;i< wdContext.node<Row>.size();i++){
 sum = sum + wdContext.nodeRow().getElementAt(i).get<amount>();
// will need to type cast to get to amount field
}
//set sum to the to the attribute which is bound the totals UI element

Regards

Pran

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Displaying the subTotal row is completely depending upon the condition when you want to display ?

You need to create a new Context with old Node structure.

double sum;

for(i=0;i<wdContext.Node<<Data>>().size;i++)

{

sum = sum + wdContext.current<Data>element.get<amount>();

//Copy the node contents into a new Node of same structure

If(Condition)

{

//Add a new Row in the new node for the subTotoal

}

}

Former Member
0 Kudos

Hi,

Thanks for reply.

I want to display "IDES AG (GREMANY)" spnnaing two columns. Is it possible?

Best Regards,

Altug Bayram

Former Member
0 Kudos

Hi

u can concatenate the Values and display in a singlre Header but u cannot span two cols on a table with a single header.

With Wishes

Krishna Kanth

Former Member
0 Kudos

Have never come across such a scenario.For a temporary solution, you may split the string, assign them to the two columns and thus satisfy your requirement.

Former Member
0 Kudos

You may create the row outside the table as a seperate textview.

Hope that would solve your problem.

Former Member
0 Kudos

Not with the NW 04 table.

Armin

Former Member
0 Kudos

Why Armin? I thought we can remove the footer and increase the no of visible rows dynamically.

Former Member
0 Kudos

I answered the question about column spanning.

Armin