子报告溢出在不支持溢出的波段上 [英] Subreport overflowed on a band that does not support overflow

查看:977
本文介绍了子报告溢出在不支持溢出的波段上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近遇到了 JasperReports 报告的子报告问题,其中我收到以下错误:

I recently had an issue with a subreport of my JasperReports's report in which I was getting the following error:


子报告溢出不支持溢出的波段。

Subreport overflowed on a band that does not support overflow.

发生了什么事?

推荐答案

我解决了这个问题,所以我想我会在这里发布我的解决方案以防有人发现它有用。

I fixed the problem, so I thought I'd post my solution here in case someone found it useful.

要检查的事项:


  1. 如果您在详细信息区中,检查报告的打印订单。它必须是垂直的。水平打印顺序报告不允许在细节带上溢出。

  2. 检查子报表的尺寸。子报表的宽度必须小于报表的宽度,表示非增长的波段(参见下面的第3点),高度必须小于波段的高度。

  3. 有些乐队成长,有些乐队没有。请记住子报表。如果页眉或页脚中有子报表,请确保它们不会增长,这意味着您到该子报表的数据源无法发送太多元素,或者重复发送子报表期望一个或几个元素的元素。

  1. If you're in a Detail band, check your report's Print Order. It has to be Vertical. Horizontal Print Order reports are not allowed to overflow on Detail bands.
  2. Check your subreport's dimensions. The subreport's width must be smaller than the report's width, and, for non-growing bands (see point #3 below), the height must be smaller than the band's height.
  3. Some bands grow, some bands don't. Keep this in mind with your subreports. If you have a subreport in a header or footer, make sure they do not grow, meaning that your datasource to that subreport can't send in too many elements, or send in repeating elements where your subreport is expecting one or few elements.

在我的情况下,我做了一个子报告并传递了一个我实际上没有使用的数据源(这是一个信息子报告)不使用数据源中的任何数据)。

In my case, I had made a subreport and passed it a datasource that I wasn't actually using (it was an informational subreport not using any data from the datasource).

(示例是XML数据源,但同样的概念适用于SQL数据源。)

(the example is an XML datasource but the same concept applies to SQL datasources.)

例如

(net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}
    ).subDataSource("/Order/Note")

后来,Note变成了一个数组而不是一个音符。这意味着我的页脚子报告试图重复两次,因此页脚报告打印两次,使其太高。因此错误。

Later, the "Note" was turned into an array instead of a single note. Which meant my footer-subreport was trying to repeat twice, thus the footer report was printing twice, making it too high. Thus the error.

这篇关于子报告溢出在不支持溢出的波段上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆