如何将不完整的传递的字符串修复为Jasper Report文本字段?

时间:2019-02-11 05:35:38

标签: jasper-reports

我有这个Java字符串来自带有Hibernate的Java版本8的H​​ello World ,现在我想知道何时将其传递给jasper报告时,它仅显示来自Jello的Hello World 。我哪里做错了?这是我的代码段:

private JRDataSource getSubjectBean(String subject, ...
    Collection<Subject> coll = new ArrayList<>()..
    coll.add(new Subject(subject, ...

在打印报告时,我做了这样的事情:

...
String subject = jTextField1.getText(); // This is where the String Hello World From Java Version 8 With Hibernate from 
JasperPrint print = JasperFillManager.fillReport(report, params, getSubjectBean(subject, ...

以及我的报告xml:

...
<field name="subject" class="java.lang.String"/>
...

...
<textField>
         <reportElement x="70" y="12" width="384"...
         <textElement markup="none">...
         <textFieldExpression><![DATA[$F{subject}]]></textFieldExpression>
</textField>
...

我想念什么吗?

0 个答案:

没有答案