I'm using netBeans and I'm trying to generate a report unsing Jasper Report
Can I get the url (of the local jrxml file) of the report which is stored in the the following directory structureMy_project |_build |_dist |_nbproject |_src |_my_project |_META_IN开发者_高级运维F |_report.jrxml |_report.jasper
I dont want to add the absolute path to my report file I want java /java classes to do that for me is there any way to get the file name parameter in
JasperDesign jasperDesign = JRXmlLoader.load ("__MY_REPORT_NAME");
You can use :
InputStream in =
getClass().getResourceAsStream("/relative/path/to/yourReport.jasper");
JasperDesign jasperDesign = JRXmlLoader.load(in);
精彩评论