如何减少报表中的空白? [英] How to reduce the blank space in report?

查看:63
本文介绍了如何减少报表中的空白?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的模板:

<?xml version="1.0" encoding="UTF-8"?>
<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="report_viwe_2" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" isIgnorePagination="true" uuid="3cb87247-a775-45d7-b09b-4211897bff60">
    <queryString language="SQL">
        <![CDATA[SELECT * FROM team]]>
    </queryString>
    <field name="team_teamno" class="java.lang.String"/>
    <field name="team_teamlead" class="java.lang.String"/>
    <field name="team_teammem1" class="java.lang.String"/>
    <field name="team_teammem2" class="java.lang.String"/>
    <group name="team_teamlead">
        <groupExpression><![CDATA[$F{team_teamlead}]]></groupExpression>
    </group>
    <background>
        <band splitType="Stretch"/>
    </background>
    <title>
        <band height="79" splitType="Stretch"/>
    </title>
    <pageHeader>
        <band height="35" splitType="Stretch"/>
    </pageHeader>
    <columnHeader>
        <band height="61" splitType="Stretch"/>
    </columnHeader>
    <detail>
        <band height="125" splitType="Stretch">
            <textField>
                <reportElement uuid="bff92bff-1492-496c-b0e5-5e5e38f341e5" x="24" y="33" width="100" height="20"/>
                <textElement/>
                <textFieldExpression><![CDATA[$F{team_teamno}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement uuid="fa26359e-2fc7-4fdf-a972-9265832c77ac" x="162" y="33" width="100" height="20"/>
                <textElement/>
                <textFieldExpression><![CDATA[$F{team_teamlead}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement uuid="c425bb55-97cb-4949-8926-3159f109aaa8" x="284" y="33" width="100" height="20"/>
                <textElement/>
                <textFieldExpression><![CDATA[$F{team_teammem1}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement uuid="9dda41b1-e0f1-403d-ae59-ee7fe15889a3" x="414" y="33" width="100" height="20"/>
                <textElement/>
                <textFieldExpression><![CDATA[$F{team_teammem2}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement uuid="d6efe743-2133-45da-82ba-f8eb56e82c9e" x="39" y="4" width="100" height="20"/>
                <textElement/>
                <textFieldExpression><![CDATA[$F{team_teamno}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement uuid="d1b79bae-55ae-47e3-9b16-403af876b6d0" x="185" y="9" width="100" height="20"/>
                <textElement/>
                <textFieldExpression><![CDATA[$F{team_teamlead}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement uuid="a653ec3b-4ce4-4871-b784-a7fa9878293a" x="297" y="4" width="100" height="20"/>
                <textElement/>
                <textFieldExpression><![CDATA[$F{team_teammem1}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement uuid="c4bb9aa3-3dc2-4db0-a13b-31d43b1972d3" x="447" y="12" width="100" height="20"/>
                <textElement/>
                <textFieldExpression><![CDATA[$F{team_teammem2}]]></textFieldExpression>
            </textField>
        </band>
    </detail>
    <columnFooter>
        <band height="45" splitType="Stretch"/>
    </columnFooter>
    <pageFooter>
        <band height="54" splitType="Stretch"/>
    </pageFooter>
    <summary>
        <band height="42" splitType="Stretch"/>
    </summary>
</jasperReport>

我只是想使用php在网页上打印JasperReports的报告.

I am just trying to print the JasperReports' report on web page using php.

问题是在网页上打印时,第一页为空白,在下一页将显示数据.我正在降低乐队的身高.但还会出现一个额外的页面.

The problem is while printing on web page, the first page will be blank, in next page it will display the data. I was reducing the band height. but yet there is a extra page appear.

推荐答案

摆脱空洞的束缚.您有titlepageHeadercolumnHeader条带已声明高度,但尚未使用.这些乐队将出现在您的详细信息乐队之前.完全删除它们,或至少将它们的高度设置为零.

Get rid of your empty bands. You have title, pageHeader and columnHeader bands that have declared heights but are unused. These bands will appear before your detail band. Delete them completely or at least set their heights to zero.

您还具有backgroundcolumnFooterpageFootersummary条带,这些条带是空的,也可以删除.

You also have background, columnFooter, pageFooter and summary bands that are empty and could be deleted too.

这篇关于如何减少报表中的空白?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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