Boa Tarde Pessoal…
Estou com um problema aqui.
Tenho um select no oracle que é + - assim
select campo.a
, campo.b
, decode( $P{p_tipo_relatorio}, campo.c, campo.d) tipo
from tabela campo
group by campo.a
, campo.b
, decode( $P{p_tipo_relatorio}, campo.c, campo.d)
Estou tentando gerar um relatório no IReport com um SQL do modelo acima.
O Problema é que quando utilizo o decode no group by no ireport da erro:
Error filling print… Error executing SQL statement for : dataset1
net.sf.jasperreports.engine.JRException: Error executing SQL statement for : dataset1 at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createDatasource(JRJdbcQueryExecuter.java:145) at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:685) at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:605) at net.sf.jasperreports.engine.fill.JRFillDatasetRun.evaluate(JRFillDatasetRun.java:134) at net.sf.jasperreports.engine.fill.JRFillElementDataset.evaluateDatasetRun(JRFillElementDataset.java:226) at net.sf.jasperreports.engine.fill.JRFillCrosstab.evaluate(JRFillCrosstab.java:405) at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:260) at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:486) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:1427) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:729) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:256) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:114) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:911) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:814) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:63) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:421) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:251) at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:864) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986) Caused by: java.sql.SQLException: ORA-00979: não é uma expressão GROUP BY at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:74) at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:110) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:171) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413) at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1030) at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194) at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:785) at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:860) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1186) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3381) at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3425) at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1202) at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createDatasource(JRJdbcQueryExecuter.java:139) … 19 more
Print not filled. Try to use an EmptyDataSource…
Alguem já passou por esse problema ??
Att.
Augusto