Jasper reports 文本字段中的多个字段

Jasper reports 文本字段中的多个字段,jasper-reports,Jasper Reports,我有一个包含3个标题的XML文档 <page> <title> <title> <title> 而且效果很好。如果标题2和标题3为空,则会出现问题。假设如果title2在XML中为空,则结果类似于blow:I This is the title 1 ,,This is title 3 对此有何建议 像这样的方法应该会奏效: ($F{title}!=null?$F{title}:) +($F{title2}!

我有一个包含3个标题的XML文档

<page> 
      <title>
      <title>
      <title>
而且效果很好。如果标题2和标题3为空,则会出现问题。假设如果title2在XML中为空,则结果类似于blow:I

This is the title 1 ,,This is title 3

对此有何建议

像这样的方法应该会奏效:

($F{title}!=null?$F{title}:) +($F{title2}!=null?,“+F{title2}:”) +($F{title3}!=null?,“+F{title3}:”)

这是假设: a) 空表示空 b) 字段$F{title}永远不会为空


如果我在假设(b)上错了,这个表达式只会稍微复杂一点。可以使用?

条件表达式完成此操作:这是一条路要走。
This is the title 1 ,,This is title 3