首页 文章

拉伸文本字段,数据溢出

提问于
浏览
0

我有9个文本字段,我想用数据溢出来拉伸所有这些文本字段 . 在我的例子中,对于所有文本字段,我将位置类型设置为'float',然后我检查'stretch with overflow' . 我把每一行放在Frame中 .

但是我的设计很糟糕,所以我想将与值2和3相关的文本字段与其他文本字段对齐 . 示例:enter link description here

提前致谢 .

最好的祝福 .

2 回答

  • 0

    您无法根据“左”和“右”中的字段选择调整文本的位置 . 同样从您的设计中,我可以想象左侧和右侧文本框位于List组件或Table组件中 .

    无法根据不在表或列表组件内的文本框的位置来调整列表或表组件中文本框的位置 .

    发布适当的设计或示例JRXML可能有助于解决您的问题 .

  • 0

    问题解决了:我创建了Frame并为每一行分组了所选元素 .

    <frame>
                <reportElement uuid="70cb42df-4e8f-4cbc-8d8f-f86a4aef9e3d" positionType="Float" x="119" y="233" width="332" height="20" isPrintWhenDetailOverflows="true"/>
            </frame>
            <frame>
                <reportElement uuid="4ca6a014-3eca-4c16-ae4e-079216b1e010" positionType="Float" x="119" y="253" width="332" height="20" isPrintWhenDetailOverflows="true"/>
            </frame>
            <elementGroup>
                <textField isStretchWithOverflow="true">
                    <reportElement uuid="b6102d47-3114-4673-a241-4dddb0e556bd" style="table" positionType="Float" stretchType="RelativeToTallestObject" x="133" y="213" width="100" height="20"/>
                    <textElement textAlignment="Center" verticalAlignment="Middle"/>
                    <textFieldExpression><![CDATA["1"]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true">
                    <reportElement uuid="c22b46b5-e528-4bb5-ad1c-a5fca06faf38" style="table" positionType="Float" stretchType="RelativeToTallestObject" x="383" y="213" width="55" height="20"/>
                    <textElement textAlignment="Center" verticalAlignment="Middle"/>
                    <textFieldExpression><![CDATA["value 1"]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true">
                    <reportElement uuid="66833d4b-1a6b-4398-9431-ed3ef80ef7dc" style="table" positionType="Float" stretchType="RelativeToTallestObject" x="233" y="213" width="150" height="20"/>
                    <textElement textAlignment="Center" verticalAlignment="Middle"/>
                    <textFieldExpression><![CDATA["azertyuiop aaaaaaaaaaaaaaazeeeeeeerrrrrrrrrrrrtttttttttttttttttttttpmmmmmmmmmmmmmlk"]]></textFieldExpression>
                </textField>
            </elementGroup>
            <frame>
                <reportElement uuid="bc738f1d-150b-4959-9bc5-6a00b7112969" positionType="Float" x="119" y="213" width="332" height="20" isPrintWhenDetailOverflows="true"/>
            </frame>
            <elementGroup>
                <textField isStretchWithOverflow="true">
                    <reportElement uuid="78d019fd-5e89-47f1-a895-9a4f0f754000" style="table" positionType="Float" stretchType="RelativeToTallestObject" x="133" y="233" width="100" height="20"/>
                    <textElement textAlignment="Center" verticalAlignment="Middle"/>
                    <textFieldExpression><![CDATA["2"]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true">
                    <reportElement uuid="5935ad61-77ec-4b05-84bf-6f72d3dcd0bd" style="table" positionType="Float" stretchType="RelativeToTallestObject" x="233" y="233" width="150" height="20"/>
                    <textElement textAlignment="Center" verticalAlignment="Middle"/>
                    <textFieldExpression><![CDATA["DP-GI"]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true">
                    <reportElement uuid="83d4865c-f1af-4361-b6fd-9575a9835c7f" style="table" positionType="Float" stretchType="RelativeToTallestObject" x="383" y="233" width="55" height="20"/>
                    <textElement textAlignment="Center" verticalAlignment="Middle"/>
                    <textFieldExpression><![CDATA["value 2"]]></textFieldExpression>
                </textField>
            </elementGroup>
            <elementGroup>
                <textField isStretchWithOverflow="true">
                    <reportElement uuid="1a2694c6-974b-493a-b0a6-09b2be10f63a" style="table" positionType="Float" stretchType="RelativeToTallestObject" x="133" y="253" width="100" height="20"/>
                    <textElement textAlignment="Center" verticalAlignment="Middle"/>
                    <textFieldExpression><![CDATA["3"]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true">
                    <reportElement uuid="450e7cce-5a49-4bbc-b502-d86352c7c873" style="table" positionType="Float" stretchType="RelativeToTallestObject" x="233" y="253" width="150" height="20"/>
                    <textElement textAlignment="Center" verticalAlignment="Middle"/>
                    <textFieldExpression><![CDATA["AS-GE"]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true">
                    <reportElement uuid="d8e7b402-0081-46ca-bd1c-2c3ae992b957" style="table" positionType="Float" stretchType="RelativeToTallestObject" x="383" y="253" width="55" height="20"/>
                    <textElement textAlignment="Center" verticalAlignment="Middle"/>
                    <textFieldExpression><![CDATA["value 3"]]></textFieldExpression>
                </textField>
            </elementGroup>
    

    结果如下:enter link description here

    最好的祝福 .

相关问题