Jump to content
Changes to the Jaspersoft community edition download ×

oroger

Members
  • Posts

    6
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by oroger

  1. The JasperReports library defines a set of optional dependencies (POI, Xalan, Ant, Jackson, ...) I could not find anything in the documentation that clearly indicates when to add which dependency (one or more JAR files). I am searching for a document that would indicates which dependency is related to which features. Does such a documents exists ?
  2. This issue seems to be a duplicate of http://jasperforge.org/plugins/espforum/view.php?group_id=102&forumid=103&topicid=76180 When JasperReport load the extension (lazily, on first use) the font extension is uses JasperReport Classloader, not the context class loader. From JRLoader.getClassLoaderResources(String) line: Map<URL, ClassLoaderResource> resources = new LinkedHashMap<URL, ClassLoaderResource>(); collectResources(resource, JRLoader.class.getClassLoader(), resources); JRLoader.collectResources then get a list of all classloader by iterating on .getParent(). Using Thread.currentThread().getContextClassLoader() instead an handling errors should provide the extended classloader (which need to have JRLoader.class.getClassLoader() set as parent).
  3. I do not use JasperServer, instead I created a webapp using JasperReport directly. Templates are not in the default classloader, there are added, using a ContextClassLoader before calling JasperReport. In recent version of Jasper Report font management changed as indicated in this document. Therefore I need to provide the Font JARs, which works when I put them in the **WEB-INF/lib** directory directly. However, for modularity reasons I would like to add them to the classpath using the same ContextClassloader as done with the templates which. But in that case, Fonts are not loaded. -I do think this has something to do with the way JasperReport loads the Font during initialization.- EDIT:From what I see in debug, JARs are loaded and the SimpleFontRegistryFactory does its work. Text is still rendered with an incorect font. The issue might then be related to the classloader used when it is actually trying to load the TTF files... EDIT2: It seems to be related to font loading indeed. Apparently the net.sf.jasperreports.engine.util.getFontInfo(...) method does not return the same result. This is due to the fact that ExtensionsEnvironment.getExtensionsRegistry().getExtensions(FontFamily.class) does not returns the same familly list in both cases. Extensions are only loaded when JARs are place in WEB-INf/lib. Does someone knows how the net.sf.jasperreports.extensions.getExtensionsRegistry() could be adapted to retrieve threadRegistry instance instead ? (must be initialized somehow I guess). Post Edited by oroger at 02/28/2012 16:34
  4. According to the Xalan mainling list (http://old.nabble.com/XPath-with-default-namespace---No-result-tt33285727.html#a33285727) this behavior is expected. I understand why, <report/> and <report xmlns="{ns}" /> are different elements and should be accessed in two distinct ways. The solution I see would then be to provide a PrefixResolver as explained here : http://www.edankert.com/defaultnamespaces.html. I can do this by providing a different XalanXPathExecuterFactory that would have a PrefixResolved as attempted in that page http://jasperforge.org/plugins/espforum/view.php?group_id=102&forumid=103&topicid=44911. The issue for me now is to be able to initialize the resolver with the XML input. At the moment I could just hardcode prefix / namespace mappings in the getNamespaceForPrefix(String prefix) which seems to be used over getNamespaceForPrefix(String prefix, org.w3c.dom.Node namespaceContext). JAXPPrefixResolver (http://www.docjar.com/html/api/com/sun/org/apache/xpath/internal/jaxp/JAXPPrefixResolver.java.html) does that kind of parsing but needs a namespaceContext at initialization, which is not provided by the Factory. Post Edited by oroger at 02/09/2012 16:41
  5. Hi, I am currently trying the new namespace aware feature added in JasperReports 4.0.1. (see http://jasperforge.org/projects/jasperreports/tracker/view.php?id=4500). It is working fine after patching the JRXmlUtils class as indicated in the issue. However, I am having difficulties with a specific case where the dataset root element has an xmlns attribute with no prefix. In that specific case, the XPath query does not return the value. Since I have no prefix for the namespace I siply can get the value. Has someone already encountered this issue ? Code:<report xmlns="mynamespace">... <queryString language="xPath"> <![CDATA[/]]> </queryString> <field name="report" class="java.lang.String"> <fieldDescription><![CDATA[report]]></fieldDescription> </field>
×
×
  • Create New...