mchisty Posted August 19, 2018 Share Posted August 19, 2018 Hi,I saw method solutions like this (a sample provided below. Ref URL: https://www.programcreek.com/java-api-examples/index.php?api=net.sf.jasperreports.engine.JasperFillManager): try { Map<String, Object> params = new HashMap<String, Object>(1); params.put("upit", query); JasperPrint jp = JasperFillManager.fillReport(SearchReport.class.getResource( "/com/gint/app/bisis4/client/circ/jaspers/searchuser.jasper").openStream(), params, new JRTableModelDataSource(table)); return jp; } catch (Exception e) { log.error(e); return null; }[/code] However, there is not a single solution that says how to fill the report with JavaBean collection/ArrayList if the jasper report file is already deployed on the report server and NOT in the local workstation.Just observe the compiled file (searchuser.jasper) location here: "/com/gint/app/bisis4/client/circ/jaspers/searchuser.jasper" which resides in the local host. But a report published in a report server might be somewhere like: http://someJasperHost:8080/XYZ/searchuser.jasper, isn't it?Now-a-days, we do not put the .jasper files as bundled with local war/ear file; rather the reports (jrxml and jasper) are meant to be compiled/published on the report server. However, if we have an ArrayList of Java objects (beans/POJOS etc) and we want to fill the .jasper file (which is already published in the report server), how can we acheive that?Or, in other words,What is the best way to supply the ArrayList of Javabeans to a jasper report located in a jasper server and fill/populate it?Is there actually any solution/sample code for this?Thanks. Link to comment Share on other sites More sharing options...
kkumlien Posted August 22, 2018 Share Posted August 22, 2018 Have you looked into the sample Custom Bean Data Source?https://community.jaspersoft.com/documentation/tibco-jasperreports-server-ultimate-guide/v710/custom-data-source-examples Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now