Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jasper reports 详图标注栏高度未动态调整_Jasper Reports - Fatal编程技术网

Jasper reports 详图标注栏高度未动态调整

Jasper reports 详图标注栏高度未动态调整,jasper-reports,Jasper Reports,我对Jasperreports(使用Jasper Studio Pro 6.4.2)作为设计者有一个奇怪的问题 我有一个非常简单的例子,说明细节标注栏没有动态调整其高度以适应文本字段的“拉伸”属性 关于文本字段的设置,我有以下几点 isStretchWithOverflow=“true” positionType=“浮动” stretchType=“RelativeTotalListObject” “详图”标注栏具有以下设置: splitType=“拉伸” 报告的完整代码如下: <

我对Jasperreports(使用Jasper Studio Pro 6.4.2)作为设计者有一个奇怪的问题

我有一个非常简单的例子,说明细节标注栏没有动态调整其高度以适应文本字段的“拉伸”属性

关于文本字段的设置,我有以下几点

  • isStretchWithOverflow=“true”
  • positionType=“浮动”
  • stretchType=“RelativeTotalListObject”
“详图”标注栏具有以下设置:

  • splitType=“拉伸”
报告的完整代码如下:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.4.2.final using JasperReports 
Library version 6.4.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="NSXGroupMemberServers" columnCount="4" printOrder="Horizontal" pageWidth="461" pageHeight="792" columnWidth="115" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" isFloatColumnFooter="true" uuid="f155815a-db1d-4ada-a8e6-b753eec591d1">
    <property name="com.jaspersoft.studio.data.sql.tables" value=""/>
    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="NSX Rules"/>
    <property name="com.jaspersoft.studio.unit." value="pixel"/>
    <parameter name="GroupID" class="java.lang.Integer"/>
    <queryString language="SQL">
        <![CDATA[Select ServerName from ServerInventoryTable SIT
Inner Join
ServerToGroupTable SGT on SIT.ServerID = SGT.ServerID
Inner Join GroupTable GT on SGT.GroupID = GT.GroupID
Where GT.GroupID =  $P{GroupID} ]]>
    </queryString>
    <field name="ServerName" class="java.lang.String"/>
    <background>
        <band splitType="Stretch"/>
    </background>
    <detail>
        <band height="20" splitType="Stretch">
            <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.FreeLayout"/>
            <textField isStretchWithOverflow="true">
                <reportElement positionType="Float" stretchType="RelativeToTallestObject" mode="Transparent" x="0" y="0" width="25" height="20" backcolor="#F2F0F0" uuid="bc85ea8a-bc71-483a-994a-a5facfbd752b">
                    <property name="com.jaspersoft.studio.unit.x" value="pixel"/>
                    <property name="com.jaspersoft.studio.unit.y" value="pixel"/>
                    <property name="com.jaspersoft.studio.unit.width" value="pixel"/>
                    <property name="com.jaspersoft.studio.unit.height" value="pixel"/>
                </reportElement>
                <box leftPadding="0">
                    <topPen lineWidth="0.0"/>
                    <leftPen lineWidth="1.0"/>
                    <bottomPen lineWidth="0.0"/>
                    <rightPen lineWidth="1.0"/>
                </box>
                <textElement verticalAlignment="Top">
                    <font size="8"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{ServerName}]]></textFieldExpression>
            </textField>
        </band>
    </detail>
</jasperReport>

我认为问题出在细节带行为的某个地方,因为作为故障排除的一部分,我将字段设置得异常短(如上所示,只有25px宽度的字段)。如果我手动将细节栏高度设置为100px,我可以看到文本字段垂直增长(运行报告时),以适应文本,因此文本字段(至少在我看来)似乎工作正常

有人知道我是否遗漏了什么吗?我已经对照许多帖子检查了我的设置,比如[Stretch with overflow Detail band未按预期工作

非常感谢您的帮助


谢谢

由于报告具有水平填充顺序(
printOrder=“horizontal”
),因此报告中的详细信息栏不会拉伸

引述自:

水平填充报告模板时,内部会显示动态文本字段 “详细信息”部分不会延伸到其整个文本内容, 因为这可能会导致轴承水平轴上的未对准 随后的细节部分

如果需要使用拉伸元素进行水平填充,可以使用列表组件而不是报告栏。具有水平打印顺序的列表允许内容拉伸和对齐。您可以看到一个示例


将报表转换为使用列表组件需要创建子数据集并将查询移动到数据集。列表组件可以放在报表标题或摘要栏中。

Ahhh…我知道我错过了一些愚蠢的事情…非常感谢您的澄清和关于使用列表的建议。这不是愚蠢的,而是愚蠢的模仿水平打印顺序,这并不明显。你可能希望细节条带在水平打印时拉伸和对齐,但目前它不这样工作。