How to create page break between elements inside list entry? - jasper-reports

My Jasper Report has Detail element that holds List element. Every list entry of which contains number of tables.
I need to add page break between those tables.
The problem is that it is not possible to add line break. I am able to drag it between tables but the report stops working after adding it. It turns out that break is not supported in such places.
Is there a way to workaround this? Currently I'm thinking of adding some fake element that would consume some space but will be invisible, however it is not as simple.
I know it could be achieved by introducing sub-reports, but this requires complete redesign of my report so it is not an option for me.

Related

Grouping Jasper Report horizontally

I have a fairly straightforward Jasper Report that uses Grouping for up to 8 groups. When I run it, it correctly groups and prints, but each group is on a new page. Although there are several SO and other questions that ask this same thing, I have not been able to get this to work.
What I want is exactly what I have now, but instead, for each group to lay out horizontally on the page.
The report property "print order", which several people allude to, is not changing this behavior. And when I tried setting "columns" to 3, it simply takes the first group and spreads its data over 3 columns, and then starts the next group on a new page.
I have tried every other combination of parameters that might prevent this, but without success. Does anyone know if I can show the groups horizontally across the page?

SSRS Multiple parameters in single drop-down

I have a feeling I am probably out of luck on this one, but Is it possible to have more than one parameter in a single drop-down list on an SSRS report? For example, the drop-down could be titled shape/color, and when opened, the top of the list shows shapes, and one can be checked, then below that in the same list, is a list of colors, where one can also be checked. Possible at all?
It is really best to have separate drop-downs for each attribute, but within a single drop-down you would first set it to "Allow multiple values". You can setup your drop-down to be formatted so that the sections of available values are grouped together. Finally, you'll need to add a query or function to check that valid combinations were selected before trying to display the results. In other words, make sure only one shape was selected. You can set an error message with a visibility that toggles based on the selection. This is one method to do what you are looking for, but if you are new to SSRS, you will probably have more specific questions along the way. Once you have more details on a specific step, you can get help with that.

Dynamically removing table from rdlc report

I'm creating an SSRS report in VS2012.
Under Tablix Properties I can show or hide a table using an expression which uses a boolean parameter; but this leaves a gap in the report.
Is there a way I can just remove the table?
You could call a subreport and determine different subreports based on a variable. You cannot remove space with SSRS to my knowledge of it, it is not designed to remove space, just perform different actions on objects that take up space. I don't even think you can resize the objects dynamically unfortunately. You can cheat though and make two subreports, one with the supposed table and one without. Then when your variable gets hit it calls one and not the other. Since a subreport can change sizes that is a way to thus trick the system's language limitations. It may not fit your needs but it is a thought that could in theory solve this problem.
I think it depends on the report layout and all sorts. I created the simplest case:
From Designer mode you can see it's just three tables in the report, nothing else. The middle table's visibilty is parameter based. In this case, SSRS does make an effort to shift the last table depending on whether the middle is visible:
In this case you still have maybe too much whitespace showing. There are various ways around this. One example is embedding the middle table in a Rectangle that extends to top of the last table, then moving the visibility expression from the table to the Rectangle. In Designer:
End result, looks better:
I guess all I'm trying to show is that SSRS does sometimes move things around based on visibility, but you can also apply extra control using tools like Rectangles to control visibility and layout.

Eclipse Virtual TableViewer filtering and Sorting? [duplicate]

Our application is an RCP appliction and needs to display table of several thousands items. For this reason, we're using SWT.VIRTUAL in our TableViewer. That works pretty well except for selection.
We're having following issue :
Our TableViewer support sorting and filtering. When we use a virtual tableviewer, changing the selection does not preserve the current selected item but the row currently selected.This leads to another item being selected.
e.g: If Item 'A' present at the 5th row is selected by user and sorting is performed, then after sorting the Item at the 5th row gets selected instead of the Item 'A'.
Using a non virtual TableViewer, everything works fine.
We tried to go into debug and found out that the cache from the AbstractTableViewer.VirtualManager class seems to be up to date with the model.
Forcing the cache to be used in the AbstractTableViewer.virtualSetSelectionToWidget() can be a possible approach.
We have tried to implement a solution suggested in https://bugs.eclipse.org/bugs/show_bug.cgi?id=338696. However it didn't work.
Please suggest some pointers or alternative work around.
Thanks for the answers.
As a workaround for working with huge tables I would suggest you to take a look at the Nattable project http://www.eclipse.org/nattable/. It supports everything you need (sorting, filtering, tree structured elements, lazy loading etc.). We successfully use it in our project, where it is necessary to display hundreds of thousands elements as a tree with around 160 columns. It also has some pretty cool styling features, which can make your table more user-friendly and interactive. Hope this helps

How can I build a table of contents in iReport/JasperReports?

We use iReport to enable our customers to generate catalogs for print for their products. This process works GREAT. One of the things we've struggled with is how to create a table of contents for these product catalogs.
I decided to use the Scriptlet functionality to give this a shot. Note that our reports are all master-detail in nature, in that there is a master report and a subreport.
At first, I attached the scriptlet to the master report, and tried to find a way to collect all of the product numbers in the detail report, then pass that value back to the master report. I can't figure out how to get the detail information back to the master report, as it appears that you can only pass default variables from the subreport back to the master (eg PAGE_NUMBER, COLUMN_NUMBER, PAGE_COUNT, COLUMN_COUNT).
So then I tried attaching the Scriptlet to the detail report. Well, the detail report doesn't know what page the master is on, so I started passing the master's page_number into a variable in the detail report. That worked great, except that sometimes the detail can overflow to the point that page numbers from the master are skipped. In other words, if a subreport returns more than two pages worth of data, you are going to miss a page number when the subreport is called the next time.
So how to do this?
I found an approach that worked, similar to one of my ideas above. First of all, I could NOT get a subreport to return a value to the calling report, and then retrieve that value using getVariableValue from inside a scriptlet. I tried forever, and I just could not get that to work.
Instead, I went with the approach where I attached the same scriptlet to both the master and subreports. The scriptlet has a class variable where I can keep a running tally of all the product numbers I encounter in the detail, and this code goes inside the afterDetailEval() method of the scriptlet. Note that I only want this code to run for the subreport, so I do a check to see if a particular detail field, which will never be null, is present. If it's not, I don't run the code. So when that event is called by the master report, the code doesn't run.
Now for the part that I learned from the example. The admirable side-effect programming in the example is that there is a line of dimensions 1x1 that contains a call to a custom scriptlet method in the "Print When Expression" property. That's a great idea! So this custom method returns false no matter what, and the line never prints. I did the same thing in the Page Footer band, and this method collects the values from the class variable, determines the page, and stores the results in a hash. Then it resets the class variable.
In the Report Summary band, I have another line that will never print, that calls another custom method. All I do here is iterate through a map of product numbers and show all the pages each one appears on. Done!
There is an example of tables of contents (with subreport) in project folder jasperreports-x.x.x/demo/samples/tableofcontents.
And see the hyperlink example also.
Hyperlinks, Anchors and Bookmarks
JasperReports allows you to create drill-down reports, which introduce tables of contents
in your documents or redirect viewers to external documents using special report elements called hyperlinks.