Jump to content
  • IUnable to add a custom query language in Studio

    Assigned User chicuslavic

    There is no documentation on how to do this.


    For example, we have a SOAP data source, QueryExecuter in a JAR and other supporting JARS.


    I added the JARs into the MyReports project (Configure Build Path).


    I changed the Properties on the MyReports project (MyReports -> Properties -> Jaspersoft Studio group -> Properties -> Use Workspace Settings -> Configure Workspace Settings) and added the QueryExecuter properties ie.


    net.sf.jasperreports.query.executer.factory.soap = com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.SoapQueryExecuterFactory


    In the Data Set and Query Dialog, soap is not listed and validation fails.


    Using Studio version: Jaspersoft Studio Professional 5.3.0.v201310030846


    User Feedback

    Recommended Comments

    A walk through of the issue. I am able to get the new QE to appear as a query language option, but it does not work - does not set the language properly, and does not preview when run. It works in iReport.
    Link to comment
    Share on other sites

    now I understand much better the problems


    1. we look for languages only globally, I fixed this, now we have JasperReports context, so we should get it from here because for each project classpath is different, this was like this because we have this part before JR context existed


    2. you added the property to global eclipse preferences, and because we are delegating to JR to find extensions, we don't see that QueryExecuter, I'll add a functionality to our context to look also in the eclipse preferences , I'll fix this


    3. your query executer is an extension, you should add it as extension, this means you need a jasperreports_extension.properties file inside your jar which contains your property, and this actually works, and is more portable, if you put this jar in the classpath, jr will see the extension, I recommend you to go this way, because you will have to only add the jar to the classpath in the target environement


    I'll fix point 2. so we handle correctly all 3 cases in JSS, I don't know if we include this in 5.5 release, I'll keep you informed about progress


    to answer you about the project where jar should be, you can put it also in referenced projects, and it's not necessary to add a jar, if you have sources in a source folder (which is in the classpath) it will work, you can actually debug like this (users already do that)

    Link to comment
    Share on other sites

    There are query executers that have been developed and work in iReport today, so let's get clear on the options and best practices for using them in Studio. I'd say this is a blocker for a 5.5 release if we can't define a way to make it work.


    Please confirm my impressions here.


    If the executer is packaged as an extension with the additional classes extensions need:


    - will the executer appear in the list of query languages in the Data Set and Query Dialog?

    - will it work down stream - you can select it and have the JRXML update with the language, you run the report and the right QE is used and so forth?

    - Do you have to also update the jasperreports.properties or Eclipse preferences to include the language, or does it automatically appear because it is an extension?



    If we just have the QE classes in a jar without the extension around it:


    - If you do your points 1 and/or 2 above, and folks add the QE properties into the Eclipse preferences, will the QE work as I outlined above: appears in the Data Set and Query Dialog, QE is used when the report runs, etc. ?



    and finally I have some questions about classpathing in Studio...


    Reports are in projects in Studio. Even when we are working with a report that we did not originally have in Studio that came from a JasperReports Server, it will go into the MyReports project (from what I have seen).


    So the question is: if I have a QE (jar or classes) in one project, do all the reports and projects on the work space have access to that QE, or do other projects need to include the project with the QE in it in order to use it?


    You mention the "JasperReports context" above. Is this shared across projects? How do we control what is in that JasperReports context?



    Thanks so much for looking at this. We need to get it right for folks to use!





    Link to comment
    Share on other sites

    about classpath


    in eclipse we have a global classpath, you can set a classpath variable or a jar, to to Window->Preferences->Java->Build Path and look inside, so this will be visible in all eclipse projects


    we have project classpath, right click on a Project->Build Path->Java Build Path look at Projects tab, if you add here projects, this project will include the dependent projects classpath


    so users have two options, or they create a shared project, or they add to global classpath, if they want to put jars in SVN, they will use solution one, the last one I think it's more appropriate for us, but we will not do this, we will create an eclipse plugin


    Link to comment
    Share on other sites

    about JasperReports context


    this one is used to resolve values for properties, to find resources like images, jr extensions, fonts, etc.


    we create a new context for each Editor (the place where you design, run the report), because each file has a different path, it's possible to set properties at file level, we can have a different extensions set for each editor, etc.


    it's not shared


    how we control? we have an implementation of JasperReports Context, we override some methods, for example we look in eclipse preferences and jr properties and resolve them in a precise order (jr, eclipse, project, file), we set file resolvers, classloaders, we listen for classpath changes in eclipse and reload fonts, jr extensions, functions and refresh the report

    Link to comment
    Share on other sites

    Changed Resolution from Open to Fixed

    Changed Status from New to Resolved

    ok, now if you add a property in the preferences, for a query executer , it will use it, if you put jar in the classpath
    Link to comment
    Share on other sites

    Changed Resolution from Fixed to Reopened

    Changed Status from Resolved to New

    This is not working in 5.5.1 (a 5.6 beta version) and in fact is somewhat worse. The language does not appear in the list of languages in the data set and query dialog after setting the query language in the Workspace properties.Problem is that there is no documentation or example I can find that shows how you get a custom query executer fully and language working in Studio and Server with all the moving parts. It is mentioned in this bug that you can put code in a project in Studio to get a QueryExecuter working, but really we need a way to package the QE so that it can be dropped into Studio and wires up automatically so others can use it. If extensions are the way to go, then great, but I can't find an example of using QueryExecuterFactoryBundle (referred to in the JasperReports Ultimate Guide and now deprecated in favor of the JRQueryExecuterFactoryBundle).I understand you need to create:- Custom Data adapter. It looks like you could use the QueryExecuter Data adapter, but this does not work in 5.5.1. Is there an extension point for that, or an example of a packaged data adapter that can be dropped into Studio and works?- QueryExecuter with a language set up- Fields Provider - if this is any different than the iReport
    Link to comment
    Share on other sites

  • Create New...