Jump to content

How to fill jasper file with beans collection/ArrayList published in server?


mchisty

Recommended Posts

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

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...