How to create JasperReport object from compiled .jasper file?

匿名 (未验证) 提交于 2019-12-03 02:56:01

问题:

I have compiled report (.jasper file). I need to get some info from that object (for example report name). How to do that ? If I could create JasperReport object, i can call getName() method on it, but I don't know how.

回答1:

You can get the JasperReport object by doing:

JasperReport jasperReport = (JasperReport)JRLoader.loadObject(new File("filename.jasper")); 

from there you can get the name by doing:

jasperReport.getName() 


标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!