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()