alchavez Posted January 24, 2008 Share Posted January 24, 2008 Hello, The application running jasper reports is generating a ton of warnings when a report is run, saying that many of the attributes are deprecated (see below for detailed error). My question is, is there a good way (preferably in iReport 2.0.3 / 2.0.4) to update the reports to help prevent these warnings. I'd like to be able to update the reports to no longer use the 'deprecated' attributes. Many Thanks,alchavez WARN [main] (JRBoxFactory.java:100) - The 'topBorderColor' attribute is deprecated. Use the <pen> tag instead. WARN [main] (JRBoxFactory.java:115) - The 'leftBorder' attribute is deprecated. Use the <pen> tag instead. WARN [main] (JRBoxFactory.java:124) - The 'leftBorderColor' attribute is deprecated. Use the <pen> tag instead. WARN [main] (JRBoxFactory.java:139) - The 'bottomBorder' attribute is deprecated. Use the <pen> tag instead. WARN [main] (JRBoxFactory.java:148) - The 'bottomBorderColor' attribute is deprecated. Use the <pen> tag WARN [main] (JRBoxFactory.java:163) - The 'rightBorder' attribute is deprecated. Use the <pen> tag instead. WARN [main] (JRBoxFactory.java:172) - The 'rightBorderColor' attribute is deprecated. Use the <pen> tag instead. WARN [main] (JRBoxFactory.java:91) - The 'topBorder' attribute is deprecated. Use the <pen> tag instead. WARN [main] (JRGraphicElementFactory.java:63) - The 'pen' attribute is deprecated. Use the <pen> tag instead. Link to comment Share on other sites More sharing options...
absoft Posted January 25, 2008 Share Posted January 25, 2008 [sorry for double post - please delete] Post edited by: absoft, at: 2008/01/25 09:32 Link to comment Share on other sites More sharing options...
absoft Posted January 25, 2008 Share Posted January 25, 2008 Hello alchavez, that's a good question:I've also updated to the new JasperReports version and now getting these error messages. We've got about 20 reports here I would like to update so that no warnings are displayed anymore. Is there an easy way to do this? How to use these "<pen>" tags in iReport? Thanks in advance for any ideasAndreas Link to comment Share on other sites More sharing options...
bartvh Posted January 28, 2008 Share Posted January 28, 2008 Hello, I have written a little script that converts a .jrxml file to the newest version, such that no deprecated warning are printed anymore. The changes are inspired by the changes that are made automatically by the jasperreports xml reader. I am hesitating to use it myself at the moment, because it looks like the iReport is not ready to use these new constructs. See http://www.jasperforge.org/index.php?option=com_joomlaboard&Itemid=215&func=view&id=35677&catid=9 for a topic with title 'pen nested elements in iReport 2.0.4' on this forum. Unzip the attached file and run the script with a python interpreter. Bart. (reposted as a .zip file) [file name=convert_204.zip size=1510]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/convert_204.zip[/file]Post edited by: bartvh, at: 2008/01/28 15:47 Link to comment Share on other sites More sharing options...
absoft Posted January 30, 2008 Share Posted January 30, 2008 Hello bartvh, first thank you for your great work. I tried you Python script, but when I try to generated the changed report XML file, I got following error messages:----30.01.2008 09:29:59 org.apache.commons.digester.Digester errorSCHWERWIEGEND: Parse Error at line 63 column 341: The content of element type "box" must match "(pen?,topPen?,leftPen?,bottomPen?,rightPen?)".org.xml.sax.SAXParseException: The content of element type "box" must match "(pen?,topPen?,leftPen?,bottomPen?,rightPen?)". at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:172) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:382) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316) at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator.java:2048) at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.java:932) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1241) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242) at org.apache.commons.digester.Digester.parse(Digester.java:1745) at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:239) at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:226) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:214) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:168) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:152) at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:151) at de.absoft.util.wTAccountMaster.main(wTAccountMaster.java:41) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)net.sf.jasperreports.engine.JRException: org.xml.sax.SAXParseException: The content of element type "box" must match "(pen?,topPen?,leftPen?,bottomPen?,rightPen?)". at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:243) at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:226) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:214) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:168) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:152) at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:151) at de.absoft.util.wTAccountMaster.main(wTAccountMaster.java:41) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)Caused by: org.xml.sax.SAXParseException: The content of element type "box" must match "(pen?,topPen?,leftPen?,bottomPen?,rightPen?)". at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:172) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:382) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316) at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator.java:2048) at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.java:932) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1241) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242) at org.apache.commons.digester.Digester.parse(Digester.java:1745) at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:239) ... 11 more Process finished with exit code 0---- Do you have any idea on that? I've attached the changed report XML file. Perhaps this helps. Thanks in advance for your helpAndreashttp://www.ab-tools.com/English/ [file name=wTAccount.xml size=111158]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/wTAccount.xml[/file] Link to comment Share on other sites More sharing options...
bartvh Posted February 1, 2008 Share Posted February 1, 2008 Hi again, well, it looks like the DTD of the jasperreports XML is more strict that I was caring for... I updated the order of the pen nested elements, this should fix the parse error. I should add that I haven't tried this new version, and I am going on a ski holiday next week :) . Bart. [file name=convert_204-f63a191f480c168c6b3faa133139f5ef.zip size=1511]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/convert_204-f63a191f480c168c6b3faa133139f5ef.zip[/file] Link to comment Share on other sites More sharing options...
absoft Posted February 1, 2008 Share Posted February 1, 2008 Hello bartvh, thank you very much: this works fine now! But I guess, I should not try to edit this report with iReport again after convertion, right? ;) Thanks againAndreashttp://www.ab-soft.dePost edited by: absoft, at: 2008/02/01 11:39 Link to comment Share on other sites More sharing options...
alchavez Posted February 2, 2008 Author Share Posted February 2, 2008 Thanks for giving the workaround! I will have to add this as a feature request for a future version iReport - the ability to convert and remove the deprecated tags. Link to comment Share on other sites More sharing options...
alchavez Posted February 2, 2008 Author Share Posted February 2, 2008 duplicate post Post edited by: alchavez, at: 2008/02/01 18:44 Link to comment Share on other sites More sharing options...
absoft Posted February 2, 2008 Share Posted February 2, 2008 Hello alchavez, I would even say that this is a bug report and not a feature request, because when I say iReport to save the template in the current version of JasperReports I would expect it to correct all deprecated tags automatically... Best regardsAndreashttp://www.ab-archive.com Link to comment Share on other sites More sharing options...
prosvet Posted February 2, 2008 Share Posted February 2, 2008 Until then, one should rollback to the version JR/iR with which most of reports were created (in my case, 1.3.4), or to the version 2.0.2, the last one where these methods are not deprecated. Post edited by: prosvet, at: 2008/02/02 15:47 Link to comment Share on other sites More sharing options...
bartvh Posted February 22, 2008 Share Posted February 22, 2008 I didn't roll back to the previous version, because the deprecated attributes do still work, according to my experience. They only give warnings when compiling a report. Still, I would like to shut up these warnings. The iReport tools has a log4j configuration to this effect. However, I am using an (automated) ant build script to compile reports, and I can't find an easy way to also use such a log4j configuration. Link to comment Share on other sites More sharing options...
absoft Posted February 22, 2008 Share Posted February 22, 2008 Hello bartvh, I didn't roll back to an old version and live with the warnings, too. I just hope for a corrected version of iReport that supports this in the near future. Best regardsAndreashttp://www.ab-tools.com/English/ Link to comment Share on other sites More sharing options...
naveen123 Posted January 8, 2009 Share Posted January 8, 2009 Hi, Do you have an application orIs there any script so that I can run this on windows as well ??I really need to convert the old jrxmls to remove the deprecated tags, they are taking up more than 20% of the log file as our application is for generating reports !! Link to comment Share on other sites More sharing options...
pelmenipeter Posted June 3, 2009 Share Posted June 3, 2009 I have the same problem with the deprecated tags.I´ve read, that it might work to open the old jrxml´s and save them with a newer IReport version.But every newer version than 2.0.4 throws me a null.pointer.exception. Is there already a complete solution for the deprecated tags ? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now