iReport(JasperReports)额外的行问题 [英] iReport (JasperReports) extra row issue

查看:132
本文介绍了iReport(JasperReports)额外的行问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



编辑

>(从注释的澄清):Excel中的输出显示记录之间的额外空白行和字段之间的额外的空白列。

解决方案

ul>

  • 添加 net.sf.jasperreports.export.xls.remove.empty.space.between.columns net.sf.jasperreports.export.xls.remove.empty.space.between.rows 属性报告模板。



  • net.sf.jasperreports.export .xls.remove.empty.space.between.columns - 指定是否应删除空的间隔列。



    net.sf.jasperreports.export.xls.remove.empty.space.between.rows - 指定空的间隔行s / p>

    示例:

     < jasperReport ...> 
    < property name =ireport.zoomvalue =1.0/>
    < property name =ireport.xvalue =0/>
    < property name =ireport.yvalue =0/>
    < property name =net.sf.jasperreports.export.xls.remove.empty.space.between.columnsvalue =true/>
    < property name =net.sf.jasperreports.export.xls.remove.empty.space.between.rowsvalue =true/>

    有关配置属性的信息是 here




    • 您可以将 / em>元素,用于隐藏空行。



    示例如果当前的 textField 是空的:

     < textField isBlankWhenNull =true> 
    < reportElement x =0y =0width =100height =20isRemoveLineWhenBlank =true/>
    < textElement />
    < textFieldExpression><![CDATA [$ F {field}]]>< / textFieldExpression>
    < / textField>




    • 另一个假设是更改所有 textField 中的/ em>(或/和 staticText )元素



    如果这种设计:





    您将在任意两行之间留出空格。



    设计( textField height等于乐队的高度):



    每行将完全在另一条之下。


    I am getting an extra empty row between data when I am importing it from the database and formatting the report in Excel sheet.

    EDIT (clarification from a comment): The output in Excel shows an extra blank row between records and and extra blank column between fields.

    解决方案

    • Add net.sf.jasperreports.export.xls.remove.empty.space.between.columns and net.sf.jasperreports.export.xls.remove.empty.space.between.rows properties to report template.

    net.sf.jasperreports.export.xls.remove.empty.space.between.columns - Specifies whether the empty spacer columns should be removed or not.

    net.sf.jasperreports.export.xls.remove.empty.space.between.rows - Specifies whether the empty spacer rows should be removed or not.

    The sample:

    <jasperReport ...>
        <property name="ireport.zoom" value="1.0"/>
        <property name="ireport.x" value="0"/>
        <property name="ireport.y" value="0"/>
        <property name="net.sf.jasperreports.export.xls.remove.empty.space.between.columns" value="true"/>
        <property name="net.sf.jasperreports.export.xls.remove.empty.space.between.rows" value="true"/>
    

    The information about configuration properties is here.

    • You can set isRemoveLineWhenBlank and isBlankWhenNull for textField element for hiding blank row.

    The sample how to remove the whole line if the current textField is empty:

    <textField isBlankWhenNull="true">
        <reportElement x="0" y="0" width="100" height="20" isRemoveLineWhenBlank="true"/>
        <textElement/>
        <textFieldExpression><![CDATA[$F{field}]]></textFieldExpression>
    </textField>
    

    • Another assumption is to change the height of all textField (or/and staticText) elements in the Band.

    In case this design:

    you will have a space between any two rows.

    In case this design (textField height is equal to the Band's height):

    the each line will be exactly under the other.

    这篇关于iReport(JasperReports)额外的行问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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