Jump to content
Changes to the Jaspersoft community edition download ×

custom datasource in the jasper report


Recommended Posts

we are trying to pass a custom data source (postgresql function) to a jasper report from servlet. the code in the servlet is as follows:

    Map<String, Object> hm = new HashMap<String, Object>();    JRDataSource datasource =  new PostgreSqlDatasource(conectionn, string1,     string2, string3);    hm.put("report_custom_DataSource", datasource );

we have a parameter named report_custom_DataSource in the jrxml report , which is of type jr datasource. but this approach is not passing the required datasource to the report , as a result the report is not rendering on the UI . Please let us know the correct way to pass a custom data source to a jasper report.

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

while this approach works , if we have hard coded values in the data source class, and the report renders fine with these values. the question is how to get values from a postgresql database function/procedure. we need certain parameters to be passed from the report to the function, so that data is generated dynamically. 

Link to comment
Share on other sites

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...