[solved]How to set property (xpath factory) to the jasperreport lib?

0

hi!

I know that normaly the setting about the xpath factory is configured by the jasperreports.properties file.

but is there also a way to set the xpath factory in the code?

The setting (or better the property) is: net.sf.jasperreports.xpath.executer.factory=net.sf.jasperreports.engine.util.xml.JaxenXPathExecuterFactory

evaluat0r's picture
Joined: Nov 24 2012 - 1:35am
Last seen: 6 years 8 months ago
I have tried this: net.sf.jasperreports.engine.util.JRProperties.setProperty("net.sf.jasperreports.xpath.executer.factory", "net.sf.jasperreports.engine.util.xml.XalanXPathExecuterFactory"); but i still receive the following error: net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRRuntimeException: No query executer factory registered for the 'xPath' language.
evaluat0r - 6 years 8 months ago
I solved this problem using PY4J.
evaluat0r - 6 years 8 months ago

1 Answer:

0

This is how I do it in my (Java) code:

JasperReportsContext jrc = DefaultJasperReportsContext.getInstance();

jrc.setProperty(

    JRXPathExecuterUtils.PROPERTY_XPATH_EXECUTER_FACTORY,
    XalanNamedParameterXPathExecutor.class.getCanonicalName());
 
JasperFillManager jfm = JasperFillManager.getInstance(jrc);
dablick's picture
Joined: Jan 17 2013 - 8:26am
Last seen: 6 years 1 month ago
Feedback
randomness