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.
Expand this group, find your . jrxml report and rightclick on it. In context menu choose 'Compile report'. Then you get compiled .
In Jaspersoft Studio select the menu item Project->Build Automatically. Now Studio will create the . jasper file in the same location as the . jrxml file.
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()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With