如何防止线路断裂,同时保持色谱柱的宽度不变

发布于 2025-02-13 12:20:29 字数 544 浏览 0 评论 0原文

我正在使用Apache POI创建Excel。我使用setColumnWidth(Colno,width)方法设置列的宽度。现在,当我填充大数据时,发生的事情是,当它超过列宽度时,API添加了\ n,新的行字符。

因此,如果我插入:

  lorem ipsum只是打印和排版的虚拟文本
行业。 Lorem Ipsum一直是该行业的标准虚拟文本
自1500年代以来
将其炒作以制作一本类型的标本书。
 

它被转换为:

  lorem ipsum只是虚拟文本 
打印和排版
行业。 lorem ipsum一直是 
行业的标准虚拟文字
自1500年代以来,一个未知
打印机进行了类型的厨房
并将其炒作以制作类型规格
Imen书。
 

问题是,如果我将文本从该单元格复制并粘贴到单词中,则保留了由于固定宽度而引起的这些额外的线路断裂。

有人知道如何解决这个问题吗?

I am creating an Excel using Apache POI. I set the width of the column using setColumnWidth(colNo, width) method. Now, when I populate large data, what happens is that when it exceeds the column width, the API adds a \n, new line character.

Thus if I insert:

 Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text ever
since the 1500s, when an unknown printer took a galley of type and
scrambled it to make a type specimen book.

It gets converted to:

Lorem Ipsum is simply dummy text of the 
printing  and typesetting
industry. Lorem Ipsum has been  the 
industry's standard dummy text
ever since the 1500s, when an unknown
printer took a  galley of type
and scrambled it to make a type  spec
imen book.

The issue is if I copy and paste the text from this cell to word, these extra line breaks due to fixed width are retained.

Does anyone know how to fix this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文