当前位置: 首页 > 知识库问答 >
问题:

标题不在同一行

法玮
2023-03-14

报告的标题由10个元素组成,如下所示:

|1 2 3 4 5 6 7 8 9 10|
|--------------------|

实际上是这样的:

|1 2          8 9 10|
|---3 4 5 6 7 ------|

这和垂直照明有关吗?我已经把它搞定了。

我的jrxml文件中的片段:

<pageHeader>
    <band height="0"  isSplitAllowed="true" >
    </band>
</pageHeader>
<columnHeader>
    <band height="39"  isSplitAllowed="true" >
        <rectangle>
            <reportElement
                x="0"
                y="1"
                width="780"
                height="30"
                backcolor="#999999"
                key="rectangle-1"/>
            <graphicElement stretchType="NoStretch"/>
        </rectangle>
        <staticText>
            <reportElement
                x="0"
                y="0"
                width="40"
                height="30"
                key="staticText-1"/>
            <box></box>
            <textElement verticalAlignment="Bottom">
                <font size="8"/>
            </textElement>
        <text><![CDATA[Holder Id]]></text>
        </staticText>
        <staticText>
            <reportElement
                x="40"
                y="0"
                width="50"
                height="30"
                key="staticText-2"/>
            <box></box>
            <textElement verticalAlignment="Bottom">
                <font size="8"/>
            </textElement>
        <text><![CDATA[Shell Id ]]></text>
        </staticText>
        <staticText>
            <reportElement
                x="100"
                y="1"
                width="50"
                height="30"
                key="staticText-3"/>
            <box></box>
            <textElement verticalAlignment="Bottom">
                <font size="8"/>
            </textElement>
        <text><![CDATA[Product Id]]></text>
        </staticText>
        <staticText>
            <reportElement
                x="160"
                y="1"
                width="40"
                height="30"
                key="staticText-4"/>
            <box></box>
            <textElement verticalAlignment="Bottom">
                <font size="8"/>
            </textElement>
        <text><![CDATA[SPID]]></text>
        </staticText>
        <staticText>
            <reportElement
                x="200"
                y="1"
                width="40"
                height="30"
                key="staticText-5"/>
            <box></box>
            <textElement verticalAlignment="Bottom">
                <font size="8"/>
            </textElement>
        <text><![CDATA[Loc-
ation]]></text>
        </staticText>
        <staticText>
            <reportElement
                x="300"
                y="1"
                width="50"
                height="30"
                key="staticText-6"/>
            <box></box>
            <textElement verticalAlignment="Bottom">
                <font size="8"/>
            </textElement>
        <text><![CDATA[Date]]></text>
        </staticText>
        <staticText>
            <reportElement
                x="350"
                y="1"
                width="30"
                height="30"
                key="staticText-7"/>
            <box></box>
            <textElement verticalAlignment="Bottom">
                <font size="8"/>
            </textElement>
        <text><![CDATA[Normal Fare]]></text>
        </staticText>
        <staticText>
            <reportElement
                x="380"
                y="1"
                width="30"
                height="30"
                key="staticText-8"/>
            <box></box>
            <textElement verticalAlignment="Bottom">
                <font size="8"/>
            </textElement>
        <text><![CDATA[Actual Fare]]></text>
        </staticText>
        <staticText>
            <reportElement
                x="410"
                y="1"
                width="40"
                height="30"
                key="staticText-9"/>
            <box></box>
            <textElement verticalAlignment="Bottom">
                <font size="8"/>
            </textElement>
        <text><![CDATA[Currency Code]]></text>
        </staticText>
        <staticText>
            <reportElement
                x="450"
                y="1"
                width="30"
                height="30"
                key="staticText-10"/>
            <box></box>
            <textElement verticalAlignment="Bottom">
                <font size="8"/>
            </textElement>
        <text><![CDATA[Staff Id]]></text>
        </staticText>
        <staticText>
            <reportElement
                x="250"
                y="1"
                width="40"
                height="30"
                key="staticText-11"/>
            <box></box>
            <textElement verticalAlignment="Bottom">
                <font size="8"/>
            </textElement>
        <text><![CDATA[Dest-
ination]]></text>
        </staticText>
        <staticText>
            <reportElement
                x="750"
                y="0"
                width="30"
                height="30"
                key="staticText-12"/>
            <box></box>
            <textElement verticalAlignment="Bottom">
                <font size="8"/>
            </textElement>
        <text><![CDATA[ISAM Seq.]]></text>
        </staticText>
        <staticText>
            <reportElement
                x="700"
                y="0"
                width="50"
                height="30"
                key="staticText-13"/>
            <box></box>
            <textElement verticalAlignment="Bottom">
                <font size="8"/>
            </textElement>
        <text><![CDATA[ISAM Id]]></text>
        </staticText>
        <staticText>
            <reportElement
                x="670"
                y="0"
                width="30"
                height="30"
                key="staticText-14"/>
            <box></box>
            <textElement verticalAlignment="Bottom">
                <font size="8"/>
            </textElement>
        <text><![CDATA[Trans. Type]]></text>
        </staticText>
        <staticText>
            <reportElement
                x="630"
                y="1"
                width="40"
                height="30"
                key="staticText-15"/>
            <box></box>
            <textElement verticalAlignment="Bottom">
                <font size="8"/>
            </textElement>
        <text><![CDATA[CPICC]]></text>
        </staticText>
        <staticText>
            <reportElement
                x="510"
                y="1"
                width="30"
                height="30"
                key="staticText-16"/>
            <box></box>
            <textElement verticalAlignment="Bottom">
                <font size="8"/>
            </textElement>
        <text><![CDATA[Conc. Auth]]></text>
        </staticText>
        <staticText>
            <reportElement
                x="480"
                y="1"
                width="30"
                height="30"
                key="staticText-17"/>
            <box></box>
            <textElement verticalAlignment="Bottom">
                <font size="8"/>
            </textElement>
        <text><![CDATA[Suppl. Info.]]></text>
        </staticText>
        <staticText>
            <reportElement
                x="540"
                y="1"
                width="40"
                height="30"
                key="staticText-18"/>
            <box></box>
            <textElement verticalAlignment="Bottom">
                <font size="8"/>
            </textElement>
        <text><![CDATA[Trans. Seq. No]]></text>
        </staticText>
        <staticText>
            <reportElement
                x="580"
                y="1"
                width="40"
                height="30"
                key="staticText-19"/>
            <box></box>
            <textElement verticalAlignment="Bottom">
                <font size="8"/>
            </textElement>
        <text><![CDATA[Rem. Uses]]></text>
        </staticText>
    </band>
</columnHeader>

共有3个答案

阴永福
2023-03-14

请看Y位置。所有的标题都不一样。您为1、2、8、9、10指定Y位置0,为重设项目指定Y=1。请确保所有位置都相同。

柯伟志
2023-03-14

我已经尝试了拉伸型,位置型,flot等......底部,asTallest,所有类型的东西,似乎没有工作

我所做的是

  • 将所有me标头元素周围的高度从39更改为20

高度15迫使文本保持在一行,没有空间浮动,我觉得这是一种丑陋的修复,我的直觉告诉我这一定不是最好的解决方案,但它起作用了,我需要在今天之前完成它。自由张贴答案,我会接受你的,如果它的作品,更优雅。

鞠征
2023-03-14

如果看不到JRXML文件,最好的猜测是两件事中的一件(或组合):

  • 对于字段1、2、8、9、10,没有将垂直对齐设置为Bottom
  • 没有为1、2、8、9、10设置相同的高度

除了这两个,您没有将所有元素的Top设置为相同的Top值集。同样,在看不到JRXML的情况下,这是最好的猜测。如果它不是其中之一,你将需要张贴它,所以我们可以帮助。

 类似资料:
  • 我需要调用不同的头来托管和关于下面提到的页面,当执行下面的代码时,我得到的错误是“未定义的类常量‘hosting’”。建议我如何解决这个问题,并为不同的页面调用不同的标题。

  • 我试图在Worker中创建ImageData,只需将带有图像URL、宽度和高度的消息发布到Worker中。为了让它工作,我需要获取图像并获取ArrayBuffer。这样我就可以创建新的ImageData: 我得到以下错误:输入数据字节长度不是(4*宽度)的倍数。 对于Chrome,我能够向Worker发布的不仅仅是URL,还有之前使用canvas在主线程中创建的整个ArrayBuffer,这很有效

  • 源码 ============ 一级标题 ============ = 的数量为标题的长度,不同于二级标题,一级标题,上下层都要包含=。 二级标题 源码 二级标题 ============ = 的数量为标题的长度。 三级标题 源码 三级标题 ---------- - 的数量为标题的长度。 四级标题 源码 四级标题 ^^^^^^^^^^^ ^ 的数量为标题的长度。 五级标题 源码 五

  • Markdown 是一种轻量级标记语言,它以纯文本形式(易读、易写、易更改)编写文档,并最终以 HTML 格式发布。Markdown也可以理解为将以 MARKDOWN 语法编写的语言转换成 HTML 内容的工具。 语法规范 YDoc 使用了 CommonMark 语法规范 为什么要使用它 它是易读(看起开舒服)、易写(语法简单)、易更改纯文本。处处体现着极简主义的影子。 兼容 HTML,可以转换为

  • 问题内容: 我想将标题的一部分更改为粗体。例如: 给定上面的标题,我该如何加粗部分。 问题答案:

  • 我是JavaFX新手。我有一个加载了垂直拆分窗格的窗口。在拆分页面的左侧,我有几个按钮。每次单击按钮时,我都需要在拆分窗格的右侧加载单独的fxml。所以在这里我粘贴屏幕截图以保持清晰。 从现在开始,当搜索按钮被点击时,我在不同的阶段,不同的场景中打开。现在我需要在baselayout窗口的右侧加载Searcher。下面是一些加载baseLayout的代码。 下面是一些点击按钮时加载搜索器的代码。