我在所有地方搜索但找不到明确答案:是否可以创建一个 JasperReport的报告,其中包含 List,其中包含另一个List(或表) ?如果是,我如何将参数传递到内部列表?
我尝试在 iReport 中实现此功能,并收到以下异常:
Error filling print... null
Setting up the file resolver... java.lang.UnsupportedOperationException
at net.sf.jasperreports.components.table.FillTableFactory.cloneFillComponent(FillTableFactory.java:46)
at net.sf.jasperreports.engine.fill.JRFillComponentElement.<init>(JRFillComponentElement.java:77)
at net.sf.jasperreports.engine.fill.JRFillComponentElement.createClone(JRFillComponentElement.java:187)
at net.sf.jasperreports.engine.fill.JRFillElementGroup.<init>(JRFillElementGroup.java:105)
at net.sf.jasperreports.engine.fill.JRFillElementContainer.<init>(JRFillElementContainer.java:100)
at net.sf.jasperreports.components.list.FillListContents.<init>(FillListContents.java:58)
at net.sf.jasperreports.components.list.FillListContents.createClone(FillListContents.java:97)
at net.sf.jasperreports.components.list.HorizontalFillList.getContents(HorizontalFillList.java:308)
at net.sf.jasperreports.components.list.HorizontalFillList.prepare(HorizontalFillList.java:142)
at net.sf.jasperreports.engine.fill.JRFillComponentElement.prepare(JRFillComponentElement.java:129)
at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:331)
at net.sf.jasperreports.components.list.FillListContents.prepare(FillListContents.java:86)
at net.sf.jasperreports.components.list.VerticalFillList.fillContents(VerticalFillList.java:153)
at net.sf.jasperreports.components.list.VerticalFillList.prepare(VerticalFillList.java:102)
at net.sf.jasperreports.engine.fill.JRFillComponentElement.prepare(JRFillComponentElement.java:129)
at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:331)
at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:379)
at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:353)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2046)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:778)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:288)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:151)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:909)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:822)
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:61)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:446)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:276)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:745)
at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:891)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572) a
t org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)
Print not filled. Try to use an EmptyDataSource...
答案 0 :(得分:1)
我刚刚遇到这个错误。后来我发现方法net.sf.jasperreports.components.table.FillTableFactory.cloneFillComponent
实际上直到6.0.0才实现。所以我用6.0.0替换了旧的Jasperreport Library,问题解决了。
答案 1 :(得分:0)
是的,将“Subdataset”的概念作为表格包含在详细信息区域中。 C.F.官方IReport文档(ireport-ultimate-guide.pdf)在他们的网站上。