Jasper reports Jasper报告:文本字段在框架内拉伸

Jasper reports Jasper报告:文本字段在框架内拉伸,jasper-reports,Jasper Reports,嗨,我正在使用jasperreports verion+5.0.1 我正在尝试对其中一个文本字段应用拉伸。 我把这个相框放在一个细部带里。在这个框架下面我有另一个框架 我在这里的要求是扩展文本字段mailingAddress和agentAddress。这些详细信息将导出为PDF格式。 这反过来会拉伸框架以及下面的框架,需要在垂直位置相应地推动框架 <frame> <reportElement positionType="Float" x="0" y="66" width=

嗨,我正在使用jasperreports verion+5.0.1

我正在尝试对其中一个文本字段应用拉伸。 我把这个相框放在一个细部带里。在这个框架下面我有另一个框架

我在这里的要求是扩展文本字段mailingAddress和agentAddress。这些详细信息将导出为PDF格式。 这反过来会拉伸框架以及下面的框架,需要在垂直位置相应地推动框架

<frame>
   <reportElement positionType="Float" x="0" y="66" width="802" height="14" isPrintWhenDetailOverflows="true" forecolor="#959595" uuid="063598fc-a760-48d4-86e1-c85da3ab415d">
      <property name="com.jaspersoft.studio.unit.height" value="pixel" />
      <property name="com.jaspersoft.studio.unit.y" value="px" />
      <property name="com.jaspersoft.studio.layout" />
   </reportElement>
   <box>
      <pen lineWidth="0.25" lineColor="#959595" />
      <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000" />
      <leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#959595" />
      <bottomPen lineWidth="0.25" lineStyle="Solid" lineColor="#959595" />
      <rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#959595" />
   </box>
   <staticText>
      <reportElement style="HeaderElement8x" x="4" y="1" width="70" height="13" isPrintWhenDetailOverflows="true" uuid="8908bd70-9665-4f4c-a501-e07ef7c96cce">
         <property name="com.jaspersoft.studio.unit.height" value="px" />
         <property name="com.jaspersoft.studio.unit.width" value="px" />
      </reportElement>
      <textElement verticalAlignment="Middle">
         <font size="8" />
      </textElement>
      <text><![CDATA[Mailing Address:]]></text>
   </staticText>
   <textField textAdjust="StretchHeight">
      <reportElement style="HeaderElementBold7x" positionType="Float" stretchType="RelativeToTallestObject" x="80" y="1" width="200" height="13" isPrintWhenDetailOverflows="true" uuid="e29aefcf-9df6-4dd8-a261-e5a9a7cf1659">
         <property name="com.jaspersoft.studio.unit.width" value="px" />
         <property name="com.jaspersoft.studio.unit.height" value="px" />
         <property name="com.jaspersoft.studio.unit.x" value="px" />
      </reportElement>
      <textElement>
         <font size="7" isBold="true" />
      </textElement>
      <textFieldExpression><![CDATA[$F{mailingAddress}]]></textFieldExpression>
   </textField>
   <staticText>
      <reportElement style="HeaderElement8x" x="362" y="1" width="85" height="13" isPrintWhenDetailOverflows="true" uuid="74a57ccd-1001-46db-ac19-daab648cba60">
         <property name="com.jaspersoft.studio.unit.height" value="px" />
         <property name="com.jaspersoft.studio.unit.width" value="px" />
      </reportElement>
      <textElement verticalAlignment="Middle">
         <font size="8" />
      </textElement>
      <text><![CDATA[Agent Address:]]></text>
   </staticText>
   <textField>
      <reportElement style="HeaderElementBold7x" positionType="Float" stretchType="RelativeToTallestObject" x="448" y="1" width="200" height="13" isPrintWhenDetailOverflows="true" uuid="cc500f79-88a8-4357-845c-090fab89a0d2">
         <property name="com.jaspersoft.studio.unit.height" value="px" />
         <property name="com.jaspersoft.studio.unit.width" value="px" />
         <property name="com.jaspersoft.studio.unit.x" value="px" />
      </reportElement>
      <textElement>
         <font size="7" isBold="true" />
      </textElement>
      <textFieldExpression><![CDATA[$F{agentAddress}]]></textFieldExpression>
   </textField>
</frame>

我试着跟随,但对我不起作用。请帮我提出你的建议


您需要设置
isStretchWithOverflow=“true”
一个TextField-frame将相应调整的值,并在它下面的所有元素上设置
positionType=“Float”
。我在reportElement级别为textFields尝试了这一方法。但这不起作用。我很抱歉,我粘贴在这里的来源没有他们,我仍然面临这个问题,并尝试了后文中提到的解决方法,但我仍然看到同样的问题。最后,在遵循中提到的解决方案后,解决了itext依赖性问题,这反过来也解决了拉伸问题。我认为,如果您已经成功地完全解决了问题,您应该将其作为问题的答案发布。