Jasper报告 - 详细信息不会在第一页上打印 [英] Jasper Report - Detail won't print on first page

查看:146
本文介绍了Jasper报告 - 详细信息不会在第一页上打印的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设置了一个带有标题带的报告和一个包含表格的详细信息带。这两个频段之间没有间距。当我查看/打印报告时,细节带开始在第2页的顶部打印,而页面1在页眉和页脚之间留有一个大的空白区域。

I have a report set up with a Title band and a Detail band containing a table. There is no spacing between these two bands. When I view/print the report, the Detail band begins printing at the top of page 2, and page 1 is left with a large blank space between the header and the footer.

如何让Detail带直接打印在第1页的标题下?

How can I get the Detail band to print directly beneath the title on page 1?

编辑:以下代码。

<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Summary" language="groovy" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="24a40acb-a702-48a6-b655-04f85fdba2a9">
    <property name="ireport.zoom" value="1.0"/>
    <property name="ireport.x" value="0"/>
    <property name="ireport.y" value="0"/>
    ...
    <background>
        <band splitType="Stretch"/>
    </background>
    <title>
        <band height="79" splitType="Stretch">
            <staticText>
                ...
            </staticText>
            ...
        </band>
    </title>
    <pageHeader>
        <band splitType="Stretch"/>
    </pageHeader>
    <columnHeader>
        <band splitType="Stretch"/>
    </columnHeader>
    <detail>
        <band height="753" splitType="Stretch">
            <componentElement>
                <reportElement uuid="3835c484-c5a2-4615-8018-b95d8d0b7f43" x="0" y="0" width="555" height="753" isPrintWhenDetailOverflows="true"/>
                <jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">
                    ...
                </jr:table>
            </componentElement>
        </band>
    </detail>
    <columnFooter>
        <band splitType="Stretch"/>
    </columnFooter>
    <pageFooter>
        <band height="29" splitType="Stretch">
            <staticText>
                ...
            </staticText>
            ...
        </band>
    </pageFooter>
    <summary>
        <band splitType="Stretch"/>
    </summary>
</jasperReport>


推荐答案

很可能细节带是如此之大以至于报告在第二页上启动它以尽可能多地显示它。

Most likely the detail band is so large that the report starts it on the second page to display as much of it as possible.

printWhenDetailOverflows 应该是相关参数。

如果您的报告足够小(或结果符合您的要求),您可以在顶部设置 ignorePagination 元素到 true 并将所有内容放在一个页面中。

If your report is small enough (or the result is what you desired) you can set ignorePagination on the top element to true and get everything in one page.

此外,你还有 pageHeight 842 ,减去 40 保证金使 802 每页。
您的明细乐队是 753 标题 79 ,因此它们不能放在一个页面上。

Also, you have a pageHeight of 842, minus 40 margin makes 802 per page. Your detail band is 753, the title is 79, so they don't fit together on one page.

这篇关于Jasper报告 - 详细信息不会在第一页上打印的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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