想要了解如何将 DynamicJasper 添加到我的项目中
场景:我的项目现在做什么
用户通过手机输入登录名和密码,servlet 会联系身份验证的 Web 服务,同时用户也会通过系统进行身份验证,同时用户也被授权,即允许他查看哪些页面.
页面出现在用户的移动屏幕上,用户可以从中选择属性以及他想要查看的报告类型。假设用户想要查看饼图或表格报告等。
在步骤 2 中,我将从 jrxml 生成报告。我想完全动态地做到这一点,但不知何故我无法做到这一点,因为有时用户选择 2 个属性,有时他选择 4 个属性,并且在 jrxml 的后端我已经参数化,但不是那么灵活。
我的想法是,在第 1 步之后我可以使用DynamicJasper吗? 但我不知道如何在我的项目中使用它?比如我如何将选定的属性发送到DynamicJasper,它可以为我生成报告?
Scenario: What my project do right now
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.
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
jrxml 只是一个序列化的 JasperReport 对象。如果您在第二步中加载了 jrxml,则可以在将 JasperReport 对象编译为 JasperPrint 对象之前对其进行更改,然后将其导出为 html。
您甚至可以纯粹用代码创建 JasperReport 对象,而不加载任何 jrxml。
话虽如此,这可能会变得非常痛苦。我在创建动态布局方面有更好的经验,其中某些部分(或子报表)在不同条件下不显示。看看PrintWhenExpression等等..
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..