Jump to content

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


evaluat0r

Recommended Posts

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

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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.

Link to comment
Share on other sites

  • 3 months later...

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);
Link to comment
Share on other sites

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...