如何在一行Excel单元格中包含长文本? [英] How can I have long text in a single line excel cell?
问题描述
我正在使用jasper报表生成Excel工作表.一个单元格可以包含长文本,我发现它已被剪切为适合单元格宽度的文本.
I'm generating excel sheet using jasper report. A cell can contain long text and I found that it was cut the text to fit the cell width.
参数isStrechWithOverflow="true"
部分地解决了该问题,但是我不想更改单元格尺寸,我想在单行单元格中使用长文本.
The parameter isStrechWithOverflow="true"
partially solve the problem, but I do not want to change cell dimension, I'd like to have long text in the single line cell.
有可能吗?我相信我已经尝试了所有选项
Is possible at all ? I believe I've tried all the options
推荐答案
您正在寻找以下属性:
net.sf. jasperreports.export.xls.auto.fit.row .和 net.sf.jasperreports.export. xls.wrap.text
这样,您可以将isStrechWithOverflow="true"
(用于其他导出)保留在textField上.
This way you can leave isStrechWithOverflow="true"
(for other exports) on the textField's.
<property name="net.sf.jasperreports.export.xls.auto.fit.row" value="false"/>
以避免适合该行.
示例:
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="SimpleTest" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" isIgnorePagination="true" uuid="e4188d8a-c7f9-4f7d-8f0f-ada07b89d42f">
<property name="net.sf.jasperreports.export.xls.auto.fit.row" value="false"/>
<property name="net.sf.jasperreports.export.xls.wrap.text" value="false"/>
... here goes the rest of your report
</jasperReport>
注意:示例中jasperReport
标记上的设置是任意的
Note: the settings on the jasperReport
tag in example are arbitrary
这篇关于如何在一行Excel单元格中包含长文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!