Sorting JasperReport Crosstab

Questions and answers on developing, deploying and using plugins and JavaBeans

Sorting JasperReport Crosstab

Postby jdbruijn » Thu Mar 08, 2012 12:09 pm

I want to control the sorting of my crosstab from within my Servoy Solution, but I cannot seem to find how to do this.
This is what I want to accomplish:
- allow user to control sorting by row (i.e. customer name) or by the total column
- allow user to control sorting ascending or descending

I figured out how to do all this from within the iReport designer, but I don't how to get this to work from within my Servoy Solution.
Jos de Bruijn
Welcome CCS
Servoy Certified Developer
Image
jdbruijn
 
Posts: 331
Joined: Sun Apr 11, 2010 6:34 pm

Re: Sorting JasperReport Crosstab

Postby tparry » Fri Mar 09, 2012 2:42 pm

Pass parameters to the report ?
tparry
 
Posts: 19
Joined: Tue Jan 31, 2012 3:33 pm

Re: Sorting JasperReport Crosstab

Postby jdbruijn » Fri Mar 09, 2012 2:51 pm

Do you have an example for me? As I cannot figute out how to use parameters to change the sorting of the crosstab.
Jos de Bruijn
Welcome CCS
Servoy Certified Developer
Image
jdbruijn
 
Posts: 331
Joined: Sun Apr 11, 2010 6:34 pm

Re: Sorting JasperReport Crosstab

Postby tparry » Wed Mar 14, 2012 3:58 am

Well I thought it was worth the effort to try this out - but I did not get what I wanted so I researched some more.
I came across a blog and asked the blogger if he could help. And he did.
Now the solution does require a bit of Java to make the comparison class and may be some work to figure out the best folder in which to place the class, but here is the reference for you to delve into and report on your success for the rest of us!
http://bekwam.blogspot.com/2012/03/dynamic-crosstab-sorting-in-jasper.html
tparry
 
Posts: 19
Joined: Tue Jan 31, 2012 3:33 pm

Re: Sorting JasperReport Crosstab

Postby jdbruijn » Wed Mar 14, 2012 3:22 pm

Thanx for the link, that does seem to be what want to do.
I've managed to get this working in iReport (after some advise from the blogger), now the challenge is to get it working in Servoy.
Jos de Bruijn
Welcome CCS
Servoy Certified Developer
Image
jdbruijn
 
Posts: 331
Joined: Sun Apr 11, 2010 6:34 pm

Re: Sorting JasperReport Crosstab

Postby tparry » Wed Mar 14, 2012 4:58 pm

For some reason I have not got mine working in version 4.0.0 of iReports but only in 4.5.1
I shall have to look again if you were successful!
tparry
 
Posts: 19
Joined: Tue Jan 31, 2012 3:33 pm

Re: Sorting JasperReport Crosstab

Postby jdbruijn » Wed Mar 14, 2012 5:14 pm

I had to recompile the class, because i'm using an older java version as the one he supplied in the download, maybe that will help you?
But i'm not having any luck on getting it to work from within Servoy atm.
Jos de Bruijn
Welcome CCS
Servoy Certified Developer
Image
jdbruijn
 
Posts: 331
Joined: Sun Apr 11, 2010 6:34 pm

Re: Sorting JasperReport Crosstab

Postby tparry » Wed Mar 14, 2012 8:10 pm

Where is the difficulty in passing a parameter into the servoy plugin for jasper reports?
The blogger solution is to pass a string into the main report as a parameter ("ASC" or "DESC" I beleive).
Have you defined an initial value of the parameter within the report (e.g. "ASC") or is it null?
Can you show some code?
tparry
 
Posts: 19
Joined: Tue Jan 31, 2012 3:33 pm

Re: Sorting JasperReport Crosstab

Postby jdbruijn » Thu Mar 15, 2012 9:35 am

My problem is not in passing the parameter, but in where to define the custom sorting class.
In iReport i've added an extra classpath, but where do I do that in Servoy?
Jos de Bruijn
Welcome CCS
Servoy Certified Developer
Image
jdbruijn
 
Posts: 331
Joined: Sun Apr 11, 2010 6:34 pm

Re: Sorting JasperReport Crosstab

Postby tparry » Thu Mar 15, 2012 10:51 pm

The class has to be put in a jar file, then the jar file placed in the \plugins\servoy_jasperreports folder (and signed of course) and the jnlp file changed to allow the jar file to be downloaded to the client.
(Search forum or wiki for jarsigning)
tparry
 
Posts: 19
Joined: Tue Jan 31, 2012 3:33 pm


Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 0 guests