我正在使用 iReport ,我从数据集中放了一个表,它有以下查询(查询测试,因为在我计划添加参数之后):
SELECT DISTINCT claseDocIdentidadFallecido AS DOCUMENTO,
IFNULL( (SELECT e.numRegistrosReportados FROM estadisticoRD e WHERE e.codOficina='A1B'
AND e.claseDocIdentidadFallecido='CC' AND e.mes=8 ), 0) AS MES1,
IFNULL( (SELECT e.numRegistrosReportados FROM estadisticoRD e WHERE e.codOficina='A1B'
AND e.claseDocIdentidadFallecido='CC' AND e.mes=9 ), 0) AS MES2,
IFNULL( (SELECT e.numRegistrosReportados FROM estadisticoRD e WHERE e.codOficina='A1B'
AND e.claseDocIdentidadFallecido='CC' AND e.mes=10 ), 0) AS MES3
FROM estadisticoRD e WHERE e.codOficina='A1B' AND e.claseDocIdentidadFallecido='CC'
好吧,我用 iReport 测试它,它显示:
但是当我尝试编译时,我收到以下消息:
`
net.sf.jasperreports.engine.design.JRValidationException: Report design not valid :
1. Field not found : claseDocIdentidadFallecido
2. Field not found : IFNULL( (SELECT e.numRegistrosReportados FROM estadisticoRD e WHERE e.codOficina='A1B' AND e.claseDocIdentidadFallecido='CC' AND e.mes=8 ), 0)
3. Field not found : IFNULL( (SELECT e.numRegistrosReportados FROM estadisticoRD e WHERE e.codOficina='A1B' AND e.claseDocIdentidadFallecido='CC' AND e.mes=9 ), 0)
4. Field not found : IFNULL( (SELECT e.numRegistrosReportados FROM estadisticoRD e WHERE e.codOficina='A1B' AND e.claseDocIdentidadFallecido='CC' AND e.mes=10 ), 0)
at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:153)
at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:512)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) `
那么,我做错了什么?
答案 0 :(得分:0)
您尚未在报告中填写$ F {claseDocIdentidadFallecido}。 此字段名为AS DOCUMENTO