开发者

Wants an idea of how i can add DynamicJasper to my project

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 in front 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 I'm generating reports from jrxml. I want to do this fully dynamic but somehow I cant do it as some times a user select 2 attributes and some times he select 4 and at the backend in jrxml I have parameterized but is not that flexible.

My idea is that how about I use DynamicJasper 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 DynamicJasper and it can make a report for me?


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..

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜