marioosh
marioosh

Reputation: 28566

How to create JasperReport object from compiled .jasper file?

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.

Upvotes: 17

Views: 14572

Answers (1)

Jacob Schoen
Jacob Schoen

Reputation: 14212

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

Upvotes: 27

Related Questions