Jump to content

API mismatch between server and studio


sbyrne

Recommended Posts

I am trying to implement a custom JRDataSource to get data from a webservice. I modeled it on the webscraper example (https://community.jaspersoft.com/documentation/tibco-jasperreports-server-ultimate-guide/v60/custom-data-source-examples).


I have an implementation of ReportDataSourceService with property definitions defined in the applicationContext-X.xml, where I define the base URL, username, and password for the data source. I then define report parameters in the JRXML for the query parameters for the specific report. I create a new JRDataSource instance each time MyReportDataSourceService.setReportParameterValues(Map) is called. This all works great.


Now I want to use my custom JRDataSource in Studio Pro.


I want to use a JRDataSourceProvider (as shown here: http://community.jaspersoft.com/wiki/how-create-and-use-jrdatasourceprovider-adapter) so I can implement getFields(JasperReport) so the report builders do not have to type in all the fields manually. But that interface gives me no way to configure my properties like I can with my ReportDataSourceService implementation, nor does it give me access to the report parameters at run time, which makes JRDataSourceProvider seem pretty useless.

So, despite that I have no actual query, I implemented a QueryExecuterFactory. I put the properties in a file on the local file system, which is slightly inconvenient, but it works. So now the report builder needs to:

  1. define a Data Adapter using my custom JRDataSourceProvider
  2. select the JRDataSourceProvider-based Data Adapter and click "Read Fields".
  3. select the "Domain JRS" data adapter.
  4. select my custom language, and leave the query box blank

 


This seems convoluted. There is a disconnect between the server API and studio API.


What am I missing? Is there something analogous to ReportDataSourceService for Studio that I am not aware of?

Link to comment
Share on other sites

  • Replies 2
  • 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...