Jump to content
We've recently updated our Privacy Statement, available here ×

ward.vantichelen

Members
  • Posts

    1
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Downloads

Everything posted by ward.vantichelen

  1. I have created a MyCustomDataSource that implements the JRDataSource interface. This data source will call a webservice to retreive the data. The end user must be able to enter some parameters. In the report designer in JasperSoft Studio I've created the parameter with a name MYPARAMETER1 and MYPARAMETER2 as an example. These parameters must be passed to the webservice call. Do do this I've implemented a myCustomDataSourceProvider that implements the JRDataSourceProvider interface. With this I can pass the JasperReport to the MyCustomerDataSource. @Overridepublic JRDataSource create(JasperReport arg0) throws JRException { return new MyCustomDataSource(arg0);} Inside the constructor of MyCustomDataSource I try to read out the values of the entered parameters, but I am unable to do that. public MyCustomDataSource(JasperReport jrreport){ String myParameter1Value = ""; //Retrieving the array of parameters: JRParameter[] params = jrreport.getParameters(); for(JRParameter param : params) { if(param.getName().equals("MYPARAMETER1")) { //here I can retreive a lot of information of the parameter, but not the actual entered value: String description = param.getDescription();//works fine String defaultValue = param.getDefaultValueExpression();//works fine (and I can use this for hidden parameters) //the following statement does not work (does not even compile), but I actually need something like this //myParameter1Value = param.getValue(); } }} So my question is: how can I retreive the value of an entered parameter in my customer data source? This seems to be a very straightforward functionality and I've seen several similar posts like this, but none of them were answered.
×
×
  • Create New...