Jump to content
We've recently updated our Privacy Statement, available here ×

Jasperserver Ad Hoc Report for a specific year and the year before


PamSchniesel

Recommended Posts

Hello,

I am totally new to JasperReports and I have a problem to create a ad-hoc report for a year.

The problem:
The report should have just one parameter -> year.
It should display tables and diagrams.
The tables should include data from the given year, data from the year before and should calculate the changed in percentage between those years.

Example
 201420132014/2013
Visits500400+25%
bookings300250+20%
successful bookings150100+50%


 

 

 

 

 

The data are in one postgresql database in one table:

| date | year | visits | bookings | successful bookings |

How can I get the data from the year before and how can I calculate the differences between those years?
Is it necessary to calculate those data in database layer or is jaspersoft server able to calculate them from plain data?
Is there a best practice for it?

BR

 

Link to comment
Share on other sites

  • 5 months later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

To create a report according to your requirements is really not easy, because the arrangement of the source data is not the one the crosstab expects for reporting. But by transposing the source data, the creation of a crosstab report will become much easier. The following figure shows the transposed data: 

2015-02-09_094141.jpg.70399ef0d40a8e846a2f5b8a56862071.jpg

The transposition can be done by esProc. The code is as follows: 

2015-02-09_094153.jpg.bb54b8d347afd4600f144f16a3141eae.jpg

Then Jasper can connect to esProc through JDBC and call the esProc script in the same way as it calls the stored procedure. For more details, see http://blog.raqsoft.com/?p=2855 .

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...