sbyrne Posted March 30, 2015 Share Posted March 30, 2015 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:define a Data Adapter using my custom JRDataSourceProviderselect the JRDataSourceProvider-based Data Adapter and click "Read Fields".select the "Domain JRS" data adapter.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 More sharing options...
hozawa Posted March 31, 2015 Share Posted March 31, 2015 Studio is just using REST API so the APIs should work. As a note, you need to be using the same version/revision of Studio and Server. Link to comment Share on other sites More sharing options...
sbyrne Posted March 31, 2015 Author Share Posted March 31, 2015 I am not saying that Studio is having a problem talking to Server, but that the API available to hook into Server for customization is different from that on Studio. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now