我使用一些數據庫連接使用iReport創建JasperReports報告。我在報告中增加了一個新的字段。該字段在數據庫列中不存在。我已將該列放入報告中,並使用表達式將值分配給此字段。未知的列名問題
它編譯罰款,但是當我填寫使用的數據庫的報告,它給我的錯誤:
Error filling print... Unknown column name : test
net.sf.jasperreports.engine.JRException: Unknown column name : test
at net.sf.jasperreports.engine.JRResultSetDataSource.getColumnIndex(JRResultSetDataSource.java:355)
at net.sf.jasperreports.engine.JRResultSetDataSource.getFieldValue(JRResultSetDataSource.java:112)
at net.sf.jasperreports.engine.fill.JRFillDataset.setOldValues(JRFillDataset.java:823)
at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:787)
at net.sf.jasperreports.engine.fill.JRBaseFiller.next(JRBaseFiller.java:1474)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:125)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:938)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:841)
at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:58)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:417)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:247)
at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:858)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)
Print not filled. Try to use an EmptyDataSource...
我如何使用JasperReports的用戶定義的字段?
我有同樣的問題,你的技巧解決了!謝謝。 – 2014-01-24 15:59:38