Jump to content
We've recently updated our Privacy Statement, available here ×

clandestino

Members
  • Posts

    12
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

clandestino's Achievements

Apprentice

Apprentice (3/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Collaborator Rare

Recent Badges

0

Reputation

  1. It seams that it isn't at least in version 4.0.1, because I am experiencing the same problem with xml data source with namespaces
  2. I tried the solution from the above link (putting additional parameters in jasperreports.properties file) and it didn't work for me. Does anyone know is this bug fixed in verision 4.0.1? This is one of mine xml files with namespaces: <?xml version="1.0" encoding="UTF-8"?><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:exslt="http://exslt.org/common" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dcmiBox="http://dublincore.org/documents/2000/07/11/dcmi-box/" xmlns:dct="http://purl.org/dc/terms/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rim="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0"> <rdf:Description rdf:about="http://saleserver:8080/geoportal/csw?Request=GetCapabilities&Service=CSW&Version=2.0.2"> <dc:title> ArcGIS Server Geoportal Extension 10 - OGC CSW 2.0.2 ISO AP </dc:title> <dc:description> A catalogue service that conforms to the HTTP protocol binding of the OpenGIS Catalogue Service ISO Metadata Application Profile specification (version 2.0.2) </dc:description> <dc:format>text/xml</dc:format> <dc:format>application/xml</dc:format> <dc:contributor>provider name</dc:contributor> <dc:identifier>http://saleserver:8080/geoportal/csw?Request=GetCapabilities&Service=CSW&Version=2.0.2</dc:identifier> <dc:type>CSW</dc:type> <dc:creator>name</dc:creator> <dc:subject>CSW</dc:subject> <dc:subject>keyword1</dc:subject> <dc:subject>keyword2</dc:subject> <dct:references>http://saleserver:8080/geoportal/csw?Request=GetCapabilities&Service=CSW&Version=2.0.2</dct:references> <dct:references>http://saleserver:8080/geoportal/csw</dct:references> <dct:references>http://saleserver:8080/geoportal/csw</dct:references> </rdf:Description> </rdf:RDF>
  3. Thanx, but I've already seen this and it didn't worked for me. I registered all namespaces in japserreports.properties, but it returns sax parsers error again.
  4. I am having the same problem with: <rdf:RDF> − <rdf:Description rdf:about="http://saleserver:8080/geoportal/csw?Request=GetCapabilities&Service=CSW&Version=2.0.2"> − <dc:title> ArcGIS Server Geoportal Extension 10 - OGC CSW 2.0.2 ISO AP </dc:title> − <dc:description> A catalogue service that conforms to the HTTP protocol binding of the OpenGIS Catalogue Service ISO Metadata Application Profile specification (version 2.0.2) </dc:description> <dc:format>text/xml</dc:format> <dc:format>application/xml</dc:format> <dc:contributor>provider name</dc:contributor> − <dc:identifier> http://saleserver:8080/geoportal/csw?Request=GetCapabilities&Service=CSW&Version=2.0.2 </dc:identifier> <dc:type>CSW</dc:type> <dc:creator>name</dc:creator> <dc:subject>CSW</dc:subject> <dc:subject>keyword1</dc:subject> <dc:subject>keyword2</dc:subject> − <dct:references> http://saleserver:8080/geoportal/csw?Request=GetCapabilities&Service=CSW&Version=2.0.2 </dct:references> <dct:references>http://saleserver:8080/geoportal/csw</dct:references> <dct:references>http://saleserver:8080/geoportal/csw</dct:references> </rdf:Description> </rdf:RDF>
  5. I got an error when trying to publish reports when datasource is xml with namespaces. For example: <rdf:RDF> − <rdf:Description rdf:about="http://saleserver:8080/geoportal/csw?Request=GetCapabilities&Service=CSW&Version=2.0.2"> − <dc:title> ArcGIS Server Geoportal Extension 10 - OGC CSW 2.0.2 ISO AP </dc:title> − <dc:description> A catalogue service that conforms to the HTTP protocol binding of the OpenGIS Catalogue Service ISO Metadata Application Profile specification (version 2.0.2) </dc:description> <dc:format>text/xml</dc:format> <dc:format>application/xml</dc:format> <dc:contributor>provider name</dc:contributor> − <dc:identifier> http://saleserver:8080/geoportal/csw?Request=GetCapabilities&Service=CSW&Version=2.0.2 </dc:identifier> <dc:type>CSW</dc:type> <dc:creator>name</dc:creator> <dc:subject>CSW</dc:subject> <dc:subject>keyword1</dc:subject> <dc:subject>keyword2</dc:subject> − <dct:references> http://saleserver:8080/geoportal/csw?Request=GetCapabilities&Service=CSW&Version=2.0.2 </dct:references> <dct:references>http://saleserver:8080/geoportal/csw</dct:references> <dct:references>http://saleserver:8080/geoportal/csw</dct:references> </rdf:Description> </rdf:RDF>
  6. I fould your instruction from the above link, but it didn't work for me. It returns the same error. Can you explain a little bit procedure. The xml I wan't to parse is: <rdf:RDF> − <rdf:Description> <dc:identifier>{15C78BBF-133F-4261-843F-EE993C83A6EE}</dc:identifier> <dc:title>SimpleRDF</dc:title> <dc:language>eng</dc:language> − <ows:WGS84BoundingBox> <ows:LowerCorner>-20.5179</ows:LowerCorner> <ows:UpperCorner>43.0585 66.618</ows:UpperCorner> </ows:WGS84BoundingBox> </rdf:Description> </rdf:RDF> Post Edited by clandestino at 03/08/2011 10:17
  7. Where can I find simple example or documentation for the new jasperreports 4.0.1 implementation: - new Xalan-based and Jaxen-based XPath query executer namespace aware implementations added;
  8. I need to set xml document as data source for jrxml file. I can see that it works with simple xml (without namespace prefix). But whole my xml documents are with namespace prefixies. My document: <?xml version="1.0" encoding="UTF-8"?> <rdf:RDF xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dct="http://purl.org/dc/terms/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rim="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0" xmlns:ows="http://www.opengis.net/ows" xmlns:dcmiBox="http://dublincore.org/documents/2000/07/11/dcmi-box/"> <rdf:Description about="http://dublincore.org/"> <dc:title xml:lang="en">USA Topographic Map </dc:title> <dc:description>This service presents land cover imagery for the world and detailed topographic maps for the United States. The service includes NPS Natural Earth physical map at 1.24km per pixel for the world at small scales, i-cubed eTOPO 1:250,000-scale maps for the contiguous United States at medium scales, and National Geographic TOPO! 1:100,000 and 1:24,000-scale maps (1:250,000 and 1:63,000 in Alaska) for the United States at large scales. The TOPO! maps are seamless, scanned images of USGS paper topographic maps.</dc:description> <dc:identifier>http://server.arcgisonline.com/ArcGIS/rest/services/NGS_Topo_US_2D/MapServer</dc:identifier> <dc:type>MapServer</dc:type> <dc:creator>ESRI</dc:creator> <dct:references>http://server.arcgisonline.com/ArcGIS/rest/services/NGS_Topo_US_2D/MapServer</dct:references> <ows:WGS84BoundingBox> <ows:LowerCorner>-179.999999 -89.999999</ows:LowerCorner> <ows:UpperCorner>179.999999 89.999999</ows:UpperCorner> </ows:WGS84BoundingBox> </rdf:Description> </rdf:RDF> And with my jrxml document I just want to print simple data suche as <dc:type> tag: <?xml version="1.0" encoding="UTF-8"?> <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="rdf" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20"> <property name="ireport.zoom" value="1.0"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> <queryString language="xPath"> <![CDATA[/rdf:RDF]]> </queryString> <field name="dc:type" class="java.lang.String"> <fieldDescription><![CDATA[/rdf:RDF/rdf:Description/dc:type]]></fieldDescription> </field> <background> <band splitType="Stretch"/> </background> <title> <band height="79" splitType="Stretch"/> </title> <pageHeader> <band height="35" splitType="Stretch"/> </pageHeader> <columnHeader> <band height="61" splitType="Stretch"> <staticText> <reportElement x="35" y="0" width="100" height="20"/> <textElement/> <text><![CDATA[/rdf:RDF/rdf:Description/dc:type]]></text> </staticText> </band> </columnHeader> <detail> <band height="125" splitType="Stretch"> <textField> <reportElement x="35" y="19" width="100" height="20"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[$F{dc:type}]]></textFieldExpression> </textField> </band> </detail> <columnFooter> <band height="45" splitType="Stretch"/> </columnFooter> <pageFooter> <band height="54" splitType="Stretch"/> </pageFooter> <summary> <band height="42" splitType="Stretch"/> </summary> </jasperReport> I am using the following code for filling the document: Document document = JRXmlUtils.parse(JRLoader.getLocationInputStream("data/documentRDF.xml")); params.put(JRXPathQueryExecuterFactory.PARAMETER_XML_DATA_DOCUMENT, document); params.put(JRXPathQueryExecuterFactory.XML_DATE_PATTERN, "yyyy-MM-dd"); params.put(JRXPathQueryExecuterFactory.XML_NUMBER_PATTERN, "#,##0.##"); params.put(JRXPathQueryExecuterFactory.XML_LOCALE, Locale.ENGLISH); params.put(JRParameter.REPORT_LOCALE, Locale.US); JasperFillManager.fillReportToFile("build/reports/rdf.jasper", params); and my jasperreports.properties is: net.sf.jasperreports.xpath.executer.factory=net.sf.jasperreports.engine.util.xml.JaxenXPathExecuterFactory net.sf.jasperreports.query.executer.factory.XPath=net.sf.jasperreports.engine.query.JaxenXPathQueryExecuterFactory net.sf.jasperreports.xml.detect.namespaces=true Pleas tell me what am I doing wrong. My error log: net.sf.jasperreports.engine.JRException: XPath selection failed. Expression: /rdf:RDF at net.sf.jasperreports.engine.util.xml.JaxenXPathExecuter.selectNodeList(JaxenXPathExecuter.java:93) at net.sf.jasperreports.engine.data.JRXmlDataSource.moveFirst(JRXmlDataSource.java:263) at net.sf.jasperreports.engine.data.JRXmlDataSource.<init>(JRXmlDataSource.java:174) at net.sf.jasperreports.engine.query.JRXPathQueryExecuter.createDatasource(JRXPathQueryExecuter.java:90) at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:684) at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:605) at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(JRBaseFiller.java:1281) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:901) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:118) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:435) at net.sf.jasperreports.engine.JasperFillManager.fillReportToFile(JasperFillManager.java:220) at net.sf.jasperreports.engine.JasperFillManager.fillReportToFile(JasperFillManager.java:126) at XmlDataSourceApp1.fill(XmlDataSourceApp1.java:235) at TestJasper.test(TestJasper.java:34) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: org.jaxen.UnresolvableException: Cannot resolve namespace prefix 'rdf' at org.jaxen.expr.DefaultNameStep.matches(DefaultNameStep.java:358) at org.jaxen.expr.DefaultNameStep.evaluate(DefaultNameStep.java:209) at org.jaxen.expr.DefaultLocationPath.evaluate(DefaultLocationPath.java:140) at org.jaxen.expr.DefaultAbsoluteLocationPath.evaluate(DefaultAbsoluteLocationPath.java:113)
  9. Is it possible to somehow position "Page X of Y " to right margin? The thing is thate X and Y can have lots of values, and the size depends of the numbers inside. And I want to group them and align them to right margin. Post Edited by clandestino at 09/02/2010 10:10
  10. I managed this to work this out by renaming messages_en_US.properties to messages_en_GB.properties. This isn't the best fix, but works for me.
  11. I am using jasperreports to display reports in croatian (default language of application) and english. I have 2 properties files: messages.properties and messages_en_US.properties. My messages.properties file contains croatian words, and messages_en_US.properties contains english words. The thing is wheater I set croatian locale or no local at all, jasper reads text from my messages_en_US.properties file, and not the default one messages.properties. Only if I explicitly rename messages.properties to messages_hr_HR.properties the code down works fine and jasper generates croatian text. Locale locale = new Locale("hr","HR"); params.put(JRParameter.REPORT_LOCALE, locale); What can I do so the jasper reads the deafult messages.properties (croatian) file instead messages_en_US.properties, but so that I don't need to rename messages.properties to messages_hr_HR.properties?
×
×
  • Create New...