on 06-21-2008 10:04 AM
Hi all,
I need to find the total number of rows and columns in a particular table. Could you please assist, how to do the same.
Cheers
Umang
Hi,
I need to find the total number of rows and columns in a particular table.
Total no of Rows
Use the following code in your action handler or method
wdContext.node<YourNodeName>().size()
NodeName is the name of the node bound to the table.
Ex:
In the following case node name is "Orders"
int x = wdContext.nodeOrders().size();
To the find the columns in the table use the following method in the wdDomodify method of your view
//Your table need to be changed to that of your table
if(firstTime)
{
IWDTable table = (IWDTable)view.getElement("<YourTable>");
//Use the following code in older versions
int x = table.getColumns().length;
//Use the following code in latest versions
int x= table.getGroupedColumns().length;
//If you want to store this for later use
//Assuming ColCount is an attribute of type int
wdContext.currentContextElement().setColCount(x);
}
You can store x in a attribute and use it later
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Number of Rows:
wdContext.node<YourTableNode>.size();
you can use IWDTable methods inside wdDoModifyView() to get row and column counts
nikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.