Vaadin 14 Grid select first 50 rows - select

I need to select first 50 rows of a Vaadin Grid. I have tried this so far:-
grid.setSelectionMode(SelectionMode.MULTI);
GridMultiSelectionModel<HomeTaskReport> model = (GridMultiSelectionModel<HomeTaskReport>) grid.getSelectionModel();
model.setSelectAllCheckboxVisibility(GridMultiSelectionModel.SelectAllCheckboxVisibility.VISIBLE);
model.addMultiSelectionListener(e->{
Set<HomeTaskReport> selectedItems= e.getAllSelectedItems().stream().skip(0).limit(50).collect(Collectors.toSet());
Set<HomeTaskReport> deSelectedItems= e.getAllSelectedItems().stream().skip(50).collect(Collectors.toSet());
model.updateSelection(selectedItems, deSelectedItems);
But this is not working.
I need to select only 50 records on click of select all checkbox.
Any suggestions/help is much appreciated.

Related

Tableau Online: How do I get rid of the automatically displayed 'Abc' column when adding a field to Rows?

I'm trying to put together an Excel style report on Tableau where the rows have an id and some aggregated fields.
Eg.
id | sum(revenue) | sum(hours)
1. 100. 10
2. 200. 20
3 399. 40
However, whether I have just the ids or include the aggregated fields, there is an extra column. It has no header and displays 'Abc' in each row.
Eg.
id | sum( revenue) | sum(hours) |
1. 100. 10 'Abc'
2. 200. 20 'Abc'
3. 399. 40 'Abc'
What is this extra column and is there any way to hide it? Thank you.
Screenshot:
You can drag your measure into the text shelf and Ref Id to Rows. This will give you a text table.
Or you can drag your measure to Columns for a chart.
If you need to just show your Ref Id with no measure, you can hover over the far-right edge of the Abc area and when the double arrow icon shows, you can drag text area to the left to hide it.
You can hide by adding (" ") to your text column #Marks like shown in the picture Remove ABC

Tableau - extra column based om sums

I'm just starting to learn Tableau and I have a question. I have a quarter profits overview as shown in the picture. I like to add a new column based on a calculation rule from the sums in the table (see notes about column Q-dif in paint on the right). How can I add this extra column?
Data is simple overview of all orderlines:
Product x | categorie y | salesprice |
Thank you in advance,
Greetings J.
I have two suggestions. It wont create a column but it will still give you what you may be looking for.
Create a calculated field under "Analysis" and enter this:
(ZN(SUM([Verkoopb..])) - LOOKUP(ZN(SUM([Verkoopb..])), -1)) /
ABS(LOOKUP(ZN(SUM([Verkoopb..])), -1))
Drag newly created calculated field into mark pane
Right click pill and format numbers as %'s
OR get the same results by:
Bringing in a second Verkoopb.. pill under where your original
Verkoopb.. pill is
Right click the second Verkoopb.. pill you just dropped and select
Quick table calculation and select Percent Difference
Drag pill to the pane.
Hope this works.

How to set Fixed Rows of Tablix in SSRS

How to do the tablix fix rows? I need to fix the report to maximum 5 rows, if record more than 5 rows will not show . If records is only 3 record, first,second & third rows will place the data and 4 & 5 rows will leave it blank.
Ideally you should achieve it in SQL query or stored proc.
However if you want to achieve it in RDL then you have to use RowNumber function in expression.Create a Row group and then restrict data set.Use expression =CEILING(RowNumber(Nothing)/5)
Please have a look at below link for your reference.
http://www.sqlchick.com/entries/2010/9/11/displaying-fixed-number-of-rows-per-ssrs-report-page.html

Crystal Reports 2 column crosstab

Using crosstab expert in CRpts, populating the columns selection with 2 column names and using preview, report has I cannot tell what is what. Report has helpdesk total by date and out of that total there is a group count for another dept. Report looks great with one column selected. However, once I select a column fr db and select it to the columns with Crosstab expert, the columns in the report preview are displayed but hard to tell what is what since I get No and Yes columns. I also have Keep Groups together, column totals on top, and Row totals on left "checked" out.
I want to be have: grand toatl column(for helpdesk) total for Dist. Classrooms afected totals
Can you help? I am also new to CR and have not been able to make a "hit" researching.
Based on the above, I want a report to look like:
(col 1) (col 2) (col 3
Date Group District Classes Affected
Crosstab expert has: 2 rows, 2 summaries(sum on date and grandtotal on top), 1 col(which works great with only col 2 used as column but not when I include col 3).
District is count of district's in group
Classes Affected is count of groups count.
Is this better?

Limit rows fetched when designing a new report

Is there a way to limit the number of rows fetched from a table when creating a report with the Report Wizard?
Say I have a table with a million records. I use the report wizard to select this table and some fields. Before I can get to the step where I can use the select expert; Crystal Reports fetches everything record to render on the report. This can take 5 - 10 minutes of just waiting.
Is there some setting to limit how many records can be fetched during design time? Or is there some other approach?
Use a Record Selection Formula
Here is some reference but you may want to google "Crystal Reports Record Selection Formula"
http://www.tek-tips.com/faqs.cfm?fid=3826
A simple setting can limit the records!! Here it is, if you're using .Net 1.1 (similar set of options in higher frameworks too!).
Solution 1: Right click on the report layout > Reports > Top N/Sort Group Expert > Choose Top N in the Dropdown that asks for the type of filtering/ sorting you wish to do > Set the Value of top N (100 for ex.) > Uncheck the option that includes other records. You report will be filtered for only the top N records from the Dataset.
Solution 2: Using the Record selection formula where you limit the No. of records on a particular Report/Sub report. Right click on the report layout > Reports > Record Selection Formula > Enter the formula as "RecordNumber <= N". That's it. The number of records fetched from the Datasource will be only upto N.
Cheers!