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.