Unable to register custom query executor factory.

0

Hi,

I am new to jaspersoft reports development. I have an issue regarding registering custom query executor factory for jasper report. I have googled regarding regarding registering factory. In some blogs, it is mentioned that, custom factory needs to be registerd in jasper report properties file, but there is no property file in my report folder. There is one option in jasper soft studio. Right click on the report, click on properties tab, Expand jasper reports and click on properties option. There are three options. Use workspace settings or project settings or file settings. I have added my custom factory at all three levels but no luck. Is it possible to specify this option in jrxml file directly like data apapter? Any help would be appreciated.

Thanks,

davechintan1984's picture
Joined: Sep 16 2016 - 10:43am
Last seen: 4 years 1 month ago

Hello!

Are you developing an Eclipse plugin as an extension to Jaspersoft Studio?

In this case for me it worked to have a file jasperreports_extension.properties on the class path (if you build with Maven, put it into the folder src/main/resources/), which contains:

net.sf.jasperreports.extension.registry.factory.queryexecuters.myreporting=<YOUR_CLASS>, where YOUR_CLASS is the fully qualified class name of your implementation of net.sf.jasperreports.extensions.ExtensionsRegistryFactory

The .myreporting - part seems to be arbitrary, as far as I remember, it could be anything.

Best regards, Clemens

 

 

clemens_august - 4 years 1 month ago

2 Answers:

0

Hello!

Are you developing an Eclipse plugin as an extension to Jaspersoft Studio?

In this case for me it worked to have a file jasperreports_extension.properties on the class path (if you build with Maven, put it into the folder src/main/resources/), which contains:

net.sf.jasperreports.extension.registry.factory.queryexecuters.myreporting=<YOUR_CLASS>, where YOUR_CLASS is the fully qualified class name of your implementation of net.sf.jasperreports.extensions.ExtensionsRegistryFactory

The .myreporting - part seems to be arbitrary, as far as I remember, it could be anything.

Best regards, Clemens

 

 

clemens_august's picture
Joined: May 27 2016 - 4:56am
Last seen: 4 years 3 weeks ago
0

This has been asked before: http://community.jaspersoft.com/questions/999201/how-i-can-associate-que...

You need to have the jar(s) with your Query Executer and Factory added to your project's Java Build Path: right click on your project(usually named MyReports), select Properties, select Java Build Path, select Libraries tab, then select Add JARs or Add External JARs depending on where you keep the jar(s).

Then you need to set this property globally in Jaspersoft Studio's Preferences:

net.sf.jasperreports.query.executer.factory.[your_query_language_name]= [the_canonical_name_of_your_query_executer_factory_class]

On windows/linux youc can reach the global preferences by selecting the Window menu then Preferences.

On mac you select the Jaspersoft Studion menu then Preferences.

In the Preferences menu you expand the Jaspersoft Studio dropdown from the left and choose Properties. Here you will see the alredy defined properties for the built-in query executers like this one:

Property Name: net.sf.jasperreports.query.executer.factory.CSV, value: net.sf.jasperreports.engine.query.JRCsvQueryExecuterFactory

You should be able to do the same for your own query executer. Click the Add button and follow from there.

 

If your query language is not picked up right away after you have set it, please consider restarting Studio.

narcism's picture
1265
Joined: Nov 22 2010 - 12:39am
Last seen: 11 hours 20 min ago
Feedback