How can I fix number of rows in JSF Rich Table? - jsf

How can I fix the size of table
Example
I am using below code for table in JSF
<rich:dataTable id="incompleteCases"
align="center" headerClass="content_row" rowKeyVar="row"
rows="10"
</rich:dataTable>
Where I want to fix the rows of table to exact 10
With the above code table shrinks when there are less rows than 10
How can I force the rows to remain constant?
Edit:
Eg: if I have 35 rows,for 3 pages ,it will display 10 rows but on 4th page because It has 5 rows ,table will shrink .I want to add remaining 5 rows so that it wont resize table.
Rows are dynamically populated.

Related

Tabulator pagination: stop groups from being cut between pages

I haved this Tabulator table with grouped rows.
Pagination is activated.
Say page size is 5.
If I have a group of 3 rows and a group of 2 rows, then I see:
the header for group 1
the 3 rows of group 1
the header for group 2
I have to go on the next page to see the 2 rows of group 2 (with no header)
How can I make sure row groups are not cut this way?
I'd like to find a way to tell Tabulator: "if a group cannot fit into a page, then start it on next page"
Of course I guess that would be a problem if a group would be larger than the page size, but then an error would be fine (or I guess I could check that before setting the page size)
This is not possible with Tabulator. When using pagination in Tabulator you define a page size in a number of rows.
This counts as the number of visible row elements, which includes normal rows, group headers and calculation rows.
The reason for this is to create a smoother user experience by ensuring that each page has the same number of visible rows and maintains the same height.
If the table changes height every page because it contains a different number of elements, it would cause the pagination buttons to move about which would be jarring for the user.

Excel - De-cumulate data in pivot table

Hope you'll be able to help me.
I have a table with 11 columns, the first one is a date, the next 9 ones are a way of uniquely identifying data and the 11th is a certain amount of money.
What I'm doing in a pivot table is showing the added amount according to one of the identifiers (lines) and dates (columns).
All is well and quite easy to do in a pivot table. Today though I was told that the amounts in my source table are actually cumulative since the beginning of the year.
What I mean is that there are recurring entries in that table and that if I have an entry with the 9 identifiers in january and the same in february and march for example, the value of the one in february is actually (february-january) and for march (march-february).
I could through the unique identifiers just add a column in my source table to identify and calculate the real amount, but I was wondering if there was a way to do so in the pivot table directly ?
Thanks !
Edit :
Here is a screenshot of a simplified version (only two identifiers)
In the fourth column is the amount I have, and in the fifth the real one, that I have to calculate, it is quite easy with only two columns as identifiers.
The goal here is that the pivot table at the bottom shows the "real" amount without me having to create a new column in my source table.
My example table
You can do it using Calculated Items. But it is cumbersome.
A Calculated Item is just another item that a Pivot Table field can take. It is defined in terms of the other items in the same field. For example, the field Date might have values of Jan17, Feb17, etc. A new calculated item called Difference can be added to the Date field and defined as =Feb17-Jan17. This new Difference item will appear whenever the Date field is used to provide row or column labels and the values displayed for it in the main body of the pivot table will be equal to the corresponding values for Feb17 less those for Jan17.
The discussion below is based (loosely) on the pivot table in the picture accompanying the question.
Calculated Items cannot be calculated on grouped fields, so it will be necessary to ungroup the Date field in the pivot table. This will cause the items in the field to be displayed in the same dd/mm/yyyy format as the source data. Changing these to the custom format of mmmyy makes them easier to work with. In English (rather than French) they get displayed as Jan17, Feb17, etc. using this format.
To add a new Calculated Item to the Date field, select any item in this field and locate the Calculated Item option via the ribbon. This has changed across versions of Excel, in Excel 2010 it is accessed via the "Fields, Items & Sets" button of the "Pivot Table Tools/Options" tab of the ribbon. In later versions it accessed via the "Calculations" button of the same tab. A dialog box will appear as illustrated below.
In the Name: box insert a suitable name such as Feb17Xand in the Formula: box enter =IF(Feb17=0,0,Feb17-Jan17). Click "Add" then "OK". The new Date item labelled Feb17X will appear in the pivot table and will show values of 20, 0 and 0 against projects A, B and C respectively.
Feb17X is the decumulated Date item for February. The IF is necessary because although the Amountvalues are cumulative, they only appear in the source data whenever a new Amount occurs in the month (for example Project B and Department IS has data showing for April and June but not for May).
Similar decumulated Date items can be defined in the same way for the other months.
For March, Mar17X is defined as
=IF(Mar17=0,0,Mar17-(Jan17+Feb17X))
and a new Mar17X item is added to the Date field. Unfortunately, this shows values of -28, 0 and 0 against projects A, B and C, respectively. To get the correct values displayed, it is necessary to add the Department field to the row labels in the pivot table (below the Project field) and then to use the "Collapse Entire Field" operation to stop the detail of the Department field from being visible.
The calculated items for the remaining months are added as expected - that for June is Jun17X and has formula
=IF(Jun17=0,0,Jun17-(Jan17+Feb17X+Mar17X+Apr17X+May17X))
Once the new items have been defined for the Date field, a filter is applied in the pivot table to remove the cumulative items ie, Feb17, Mar17, Apr17, May17 and Jun17. This results in the pivot table displaying the sum of the decumulated values as shown below.
A few points:
The zeroes in the pivot table can be suppressed from display by setting the number format of the Amount field to #
In the larger problem where each Amount is defined by a Date, Project and 8 further field values, the row labels of the pivot table will need to include Project and all 8 of the attribute fields. The latter 8 fields will need to be "collapsed out" of the display.
It is much, much simpler to add a decumulated Amount column to the
source data range rather than using the Calculated Item approach set
out here. Sorting the source data by the 9 attributes (Project
first then the remaining 8) and then by Date makes the task
of decumulation very easy. Simply compare the 9 attributes in a row
with the previous row: if the values are unchanged between the two
rows, subtract the previous row's Amount from the current row's,
otherwise leave the current row's Amount unchanged.

pagination for table which having rowspan

I have got a Dynamaically created Jquery table which has got two columns
First Column : Master Table
Second Column : Child Tables.
It's obviously a one to many mapping where Master table row could have a rowspan of 5 which tells us it has got five Child tables.
I need a pagination for this Table. I have tried a lot. If I wanna show first ten rows and if the ten Row has got a rowspan of 10 then it hasn't got a td:border-bottom, then in the next page first td getting the value of second td which makes last td to be empty.
Please sort me this out. I need to have a border-bottom at each every page no matter what is its rowspan and in the next page alignment of td must be in the same way as it was in the first page.

Richfaces DataTable - total number of pages

I've a situation where I've multiple columnGroups inside my datatable and for each record I render one or more columnGroup depending on some business logic.
Now, since the number of rows in the datatable are different from size of my records list, how do I get total number of pages in the datatable, provided that the number of rows per page is some fixed number let's say 60.
I need that number for my custom datascroller.

Pagination in Tridinad table in JSF

I am having a list of 20 rows, and i have used tr:table to list it with 10 rows per page.
{}
In this, the first 10 rows are getting displayed, but the next rows cannot be viewed.
Is there any solution for this.

Resources