views:

243

answers:

1

Hey! Scenario:What my project do right now

  1. User Enters his Login and Password through his mobile phone and servlets contacts webservice of Authentication and user gets authenticated with the system in the mean while user is Authorized also i.e What page he is allowed to see.

  2. Page appears infront of user on his mobile screen from where he can select the attributes as well as the type of report he wants to view. suppose a user wants to view a pie chart, or tabular report etc.

Here in step 2 im generating reports from jrxml.. i want to do this fully dynamic but somehow i cant do it as some times a user select 2 atributes and some times he select 4 and at the backend in jrxml i have parametarized but is not that flexible. My idea is that how about i use Dynamic jasper here after step 1. But i have no clue how to use it in my project? like how can i send the selected attributes to dynamic jasper and it can make a report for me ?

Any idea please share! Thanks in advance Sundhas

A: 

The jrxml is just a serialized JasperReport object. If you get load that jrxml in step two you can change the JasperReport object before you compile it to a JasperPrint object, which you then export to html.

You could even create the JasperReport object purely in code and not load any jrxml.

Having said all that, this can become extremely painful to work with. I have had better experience with creating dynamic layouts where certain sections(or subreports) are not displayed under different conditions. Look at PrintWhenExpression and so on..

Manfred Moser
Yes Manfred its a painful task to do..Have you ever made a report through Dynamic JaspeR?
Sundhas
No. I sort of wrote my own before Dynamic Jasper was around. It was very limited and clunky.
Manfred Moser