【问题标题】:How to set Excel cell format in iReport如何在 iReport 中设置 Excel 单元格格式
【发布时间】:2011-07-24 10:47:07
【问题描述】:

我正在尝试将报告导出为 xls,但是当我打开导出的文件时,我注意到所有单元格格式都是数字,并且所有数据都用 ' 写入,例如文本数据(整数字段和双字段也...)所以我不能在 Excel 中应用任何公式,如 SUM。

如何根据我的 iReport TextField 类表达式保持单元格格式?

我正在使用 iReport 4.0.2。

谢谢大家。

【问题讨论】:

    标签: export-to-excel ireport cell-formatting


    【解决方案1】:

    我一直在寻找同样的问题,发现如下:

    http://jasperreports.sourceforge.net/sample.reference/xlsformula/index.html

    您可以在ireport的export excel设置下将“检测单元格类型”设置为默认true。

    问候

    【讨论】:

      【解决方案2】:

      在你的<textField> 元素中使用这个:

      <reportElement x="0" y="0" width="100" height="20" uuid="fb1a31bf-e600-4ed0-8eb1-2e48f82b90ce">
        <property name="net.sf.jasperreports.export.xls.pattern" value="0.00"/>
      </reportElement>
      

      value="..." 是您的单元格模式。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-01-15
        • 2014-04-28
        • 1970-01-01
        • 1970-01-01
        • 2022-06-15
        相关资源
        最近更新 更多