JasperReports:如何使用Excel导出器格式化数字数据 [英] JasperReports: How to format numeric data with Excel exporter

查看:345
本文介绍了JasperReports:如何使用Excel导出器格式化数字数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 iReport 2.0.2
我在Excel导出器的帮助下生成报告后格式化数字数据时出现问题。

I'm using iReport 2.0.2. I have a problem with formatting numeric data after generating report with help of Excel exporter.

例如, 85110057689 字符串在Excel文件中显示为 8.51100e + 10 (由于在 iReport 中使用Excel中的预览按钮)。

For example, the 85110057689 string is showing as 8.51100e+10 in Excel file (as result of using "preview in Excel" button in iReport).

请建议如何将格式更改为简单(非科学)。

Please suggest how to change the format to the simple (not scientific).

推荐答案

我们可以使用 net.sf.jasperreports.export.xls.detect.cell.type 用于解决问题的属性。

We can use net.sf.jasperreports.export.xls.detect.cell.type property for solving issue.

文件引用:


net.sf.jasperreports.export.xls.detect.cell.type

其值用作IS_DETECT_CELL_TYPE导出标志的默认状态的属性。

Property whose value is used as default state of the IS_DETECT_CELL_TYPE export flag.

指定是否出口应考虑原始文本字段表达式的
类型,并相应地设置单元格类型和
值。

Specifies whether the exporter should take into consideration the type of the original text field expressions and set the cell types and values accordingly.



<例如,我们可以为整个报告设置此属性:

For example we can set this property for the whole report:

<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" ...>
    <property name="net.sf.jasperreports.export.xls.detect.cell.type" value="true"/>

这篇关于JasperReports:如何使用Excel导出器格式化数字数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆