Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/83.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/12.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报告HTML标记不适用于XML字段_Html_Xml_Jasper Reports - Fatal编程技术网

Jasper报告HTML标记不适用于XML字段

Jasper报告HTML标记不适用于XML字段,html,xml,jasper-reports,Html,Xml,Jasper Reports,关于我的新Jasper报告,我需要一些帮助。 它使用xml文件作为数据源: <Krediti xmlns="http://www.w3.org/2001/XMLSchema"> <Kredit> <VrstaPosla>Integer viverra volutpat enim ac <b>consectetur</b>. Proin eu ex interdum, lacinia lorem a, euismod elit.

关于我的新Jasper报告,我需要一些帮助。 它使用xml文件作为数据源:

<Krediti xmlns="http://www.w3.org/2001/XMLSchema">
<Kredit>
    <VrstaPosla>Integer viverra volutpat enim ac <b>consectetur</b>. Proin eu ex interdum, lacinia lorem a, euismod elit. Pellentesque sit amet justo venenatis, consequat magna id, commodo metus. Interdum et malesuada fames ac ante ipsum primis in faucibus. Praesent ipsum sem, lacinia vel blandit nec, porta in elit. Nullam volutpat vestibulum imperdiet. Etiam egestas dui risus, a euismod justo luctus et. Praesent sed dolor scelerisque, vehicula arcu sit amet, dapibus tellus. Donec et scelerisque orci. Ut ante diam, congue vitae libero at, bibendum feugiat metus. Suspendisse lobortis imperdiet facilisis. Etiam id massa tempor, maximus dui bibendum, mattis lectus.!!!</VrstaPosla>
    <SifraKredita>11000000</SifraKredita>
</Kredit>
我想用粗体打印b标签中的文本。在我的例子中,这将是单词concertetur

为此,我将字段属性标记设置为html,但仍然不起作用

<textField isStretchWithOverflow="true">
            <reportElement x="3" y="3" width="552" height="52" forecolor="#000000" backcolor="#FFFFFF" uuid="7826a459-9146-47ec-a500-32dbf81e5cdd"/>
            <textElement textAlignment="Left" markup="html"/>
            <textFieldExpression><![CDATA[$F{VrstaPosla}]]></textFieldExpression>
        </textField>
如果我将文本直接放入字段,它将起作用:

        <textField isStretchWithOverflow="true">
            <reportElement x="3" y="3" width="552" height="52" forecolor="#000000" backcolor="#FFFFFF" uuid="7826a459-9146-47ec-a500-32dbf81e5cdd"/>
            <textElement textAlignment="Left" markup="html"/>
            <textFieldExpression><![CDATA["Text <b>is bolded</b>"]]></textFieldExpression>
        </textField>
是否报告会剥离来自XML字段的所有标记

问候,,
Igor

我已经检查过了,是的,您不能在xml中使用html标记,xml是报告的源,因为报告所见就像一个节点。如果我把它改成CSV,它就会工作

Year,Make,Model,Description,Price
1997,Ford <i><b>Krepko</b></i>,E350,"ac, abs, moon",3000.00
1999,Chevy,"Venture ""Extended Edition""","",4900.00
1999,Chevy,"Venture ""Extended Edition, Very Large""",,5000.00
1996,Jeep,Grand Cherokee,"MUST SELL! air, moon roof, loaded",4799.00
问候,

伊戈尔