HTML column sorting in report generated by JasperReports - jasper-reports

Can we have column sorting in report which is generated (in html format) by iReport for example
if a report contains three column name, age, sex
and i want to sort report on clicking on age than it should sort based on age.

If you don't can use the table component (table component have this in native function), you can create a link this mode:
One idea is in your column header you create a link to the same report and send parameter with number of column in your SQL, after you can use this in your sql or procedure to sort.

Related

Prevent grouping column header in JasperReports

i want to make an Crosstab Template for my data.
For each value there is a timestamp, a location and the name of the device from which i get the value. So i am giving a list of values via Java and a JRBeanCollectionDataSource to my report, for the example below this would be 9 values while each of them has 3 additional parameters to place it on the right column/place in the crosstab.
When i give this sort of data to my Jasper Report with a Crosstab (Crosstab is needed cause i don't know how many rows and columns my report will have) in it, Jasper orders/groups the columns and the output looks like this:
But what i want is to show the data in the sequence i give them to my report, for example:
I am using Java to fill my report with a JRBeanCollectionDataSource and a self defined DataSource (this works perfect, i am working with this method for months).
Is there any way this kind of column grouping could be prevented? (i have a working crosstab template but i am not able to find the propertie with the help of i can solve my problem)
Hope you people can help me.
Have you tried to tell the crosstab that your data ir already sorted?
http://jasperreports.sourceforge.net/schema.reference.html#crosstabDataset
Click the crosstab element, in the Dataset Tab, mark "Data Pre Sorted".

I have Crystal report and need to use results from parameter based on one table to run a parameter on another table

My SQL Table contains RmaNumber, RmaLineNumber and Warehouse, and then a whel lot of other details.
We want to filter (using a parameter) on warehouse to produce a list of RMANumbers and RMALinenumbers to choose from. The problem is that when I include the RmaLineNumbers it makes the dataset to large to display in Crystal Reports.
So I tried splittin the data into 2 tables - the first table contains the Warehouse and RMANumber. The second table contains the RmaNumber and RmaLine Number. The idea is that I put a parameter on the first table to select the warehouse and it returns a list of RMANumbers (a manageable size data set)Then the user will select which RMANumbers they want and from that list I want to filter (parameter) From the second table to see the line numbers (a smaller dataset) then the report will display the details based on the line number chosen. Is what I am trying to do possible in Crystal? is there another way around the issue of the dataset being to large?

Order a JasperReports report by several columns

Is it possible to create a subgroup in iReport/JasperSoft Studio?
I have a report and I want to group it by name. Then inside that group I want to group it by street.
Each time I group something by name the headers I start a new page reprint the headers. That's the point where I'm at. Now I want to group (inside the name group) by street so that the headers display again each time a new street is found.
You can only use grouping on sorted data. If you need ordering by several columns you will have to pass it that way to Jasper and order the rows yourself either with multiple order columns in your SQL query or with custom Java code.

Crystal reports - get crosstab column value from different table

I have a crystal report based on xml data with a crosstab for displaying the main set of data that I want.
Some of the values that I need to display in the header are in a dictionary 'table' in the xml and I need to extract the value of a field where the name is e.g. 'CrossTabColumnName'.
I can do this in a subreport and use a shared variable to put it onto the main report, but it won't let me put it in the crosstab because it 'has to be evaluated later' - fine I get the idea behind this but how can I get this value into where I want it?
I just want to be able to say, for example: Select Value From DictionaryTable Where Name='CrossTabColumnName', and put that into a field I can use in the cross tab.

Crosstab Sorting in JasperReports

I have a column group in a Crosstab that is a String.
It uses the field SectionName.
There is another field, SectionID (Integer), that I want to sort by.
I put $F{SectionID} in the Sort By Expression but I get the error:
1. Field not found : SectionID
This field is in the dataset. I can add a group on this field and display it. When I try to use it in sorting I get the error.
Is it possible to display one field in the column group header but sort by another?
Thank you
Yes you need to create another row group for you SectionID and make sure it is first -tweak in the XML - and then remove the text box from the visual display