after considering links from Sean and Eric leading to _relative_ complicated solutiond and assuming that Your counting problem will always be so simple (no complex counting such as additional rebates or sth) i think i would use JavaScript to count values from rows and cols of datatable. cause client side dont mind any pagination stuff, it just simply sum somme numbers.

its obviously escape from problem, but if i had to code such a thing fast i think i would make somme JS shit;)

im also sure that many peple say that's stupid idea:P

Slawek

Hi All,
Here is the detailed explanation of what is required of the datatable.
Suppose you hav 4 columns and hundred rows of data.
The column values are of type integer/float.
The 4th column shd display the total of first three column values for each row.
Moreover, it shd show the total of each column in the last row.
I shd hav the flexibilty of displaying 10/20/40 rows per page.
If i display 10 records on a page then the last row shd display the total for each column for 10 records only.
If i display 20 records on a page then it shd display accordingly.
Pagination shd be provided and if possible sorting also on each column.


I know most of these things are provided by the <x:datatable> tag but i am getting some problems while showing the totalling.
Is there any way like datatable itself providing summation functionality on columns and stuff like that?


Has anyone come across this problem?
I shd also be able to produce the datatable entries into a excel sheet programmatically.
I dont know how to do that.


Can anyone provide the sample code or example for this?

Thanx & Regards,
Sunil

----- Original Message -----
From: Sunil Tiwari
To: MyFaces Discussion
Sent: Monday, May 02, 2005 5:45 PM
Subject: Regarding datatable


Hi,
How to display the sum of all columns (with integer values) in the last column of the datatable from front end only.
Moreover, it should display the column total for every column at the bottom of the table.
And all the other functionalities of the table shd be still supported like pagination and scrollability.
Like a table is displaying 100 records and i display 10/20/40 records per page. It shd then display the column totals for every page
for 10/20/40 records.


Does anyone knows then how to display the details of the datatable in an excel sheet from within the MyFaces application.


Thanx in advance Sunil




Reply via email to