Jump to content
Changes to the Jaspersoft community edition download ×

SQL Problem can't select sum()?????????????


2005 IR Help

Recommended Posts

By: tomuno - tomuno

SQL Problem can't select sum()?????????????

2005-03-17 01:47

oracle9i

ireport4.0 jasperreorts0.6.1 jdk1.4

 

select sum(ren) from mytable

 

errors:

 

org.xml.sax.SAXParseException: Attribute value "SUM(REN)" of type NMTOKEN must be a name token. at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.validateDTDattribute(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.addDTDDefaultAttrsAndValidate(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.commons.digester.Digester.parse(Digester.java:1514) at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:400) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:384) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:338) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:322) at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:128) at it.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:336) at java.lang.Thread.run(Thread.java:536) org.xml.sax.SAXParseException: Attribute value "SUM(REN)" of type NMTOKEN must be a name token. at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.commons.digester.Digester.parse(Digester.java:1514) at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:400) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:384) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:338) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:322) at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:128) at it.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:336) at java.lang.Thread.run(Thread.java:536) NESTED BY : net.sf.jasperreports.engine.JRException: Attribute value "SUM(REN)" of type NMTOKEN must be a name token. at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:404) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:384) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:338) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:322) at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:128) at it.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:336) at java.lang.Thread.run(Thread.java:536) Caused by: org.xml.sax.SAXParseException: Attribute value "SUM(REN)" of type NMTOKEN must be a name token. at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.commons.digester.Digester.parse(Digester.java:1514) at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:400) ... 6 more

 

 

can't select?????????????

 

 

 

 

 

By: Rick Millar - rmillar

RE: SQL Problem can't select sum()?????????????

2005-03-17 12:42

Try select sum(ren) as "myFieldName" from mytable.

 

I've encountered similar problems when selected column names contain spaces. Aliasing the column name with simple string (no spaces or special chars) usually resolves the problem.

 

HTH,

 

Rick

 

 

 

 

 

By: tomuno - tomuno

RE: SQL Problem can't select sum()?????????????

2005-03-17 16:17

thanks you

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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