Jxl 和格式化单元格的最大数量
当我使用 jxl 编写 Excel 文件并使用您自己的单元格格式时,我收到此警告:格式化单元格的最大数量已过期。使用默认格式”。我有大约 350 个单元格需要格式化,这对我来说似乎相对较少。我做错了什么吗?我使用循环来设置单元格格式。或者有什么方法可以增加格式化单元格的数量我的整个代码这么长,但这是一个进行格式化的简单示例:
for (int=0;i<30;i++) } ws.getWritableCell(2, i).setCellFormat(sumrow());
{
When I'm writing Excel files with jxl and use your own cell format, I get this warning: The maximum number of formatted cells has exprired. Using default format". I have about 350 cells that need to be formatted, which seems relatively little to me. Am I doing something wrong? I use loops to set my cell format. Or is there any way to increase the number of formatted cells? My whole code this long, but here is a simple example of doing formatting:
for (int=0;i<30;i++) }
ws.getWritableCell(2, i).setCellFormat(sumrow());
{
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您如何创建
CellFormat
对象?您想要做的是确保重用 CellFormat 对象,而不是在某个循环中重新创建它们。
除非您真的有 350 个单元格,每个单元格都有不同的格式。否则,创建一个
CellFormat
对象并将其传递给setCellFormat
。How are you creating the
CellFormat
objects?What you want to do is to make sure you are reusing the
CellFormat
objects and not recreating them in a loop somewhere.That is unless you really have 350 cells that each have a different formatting. Otherwise create a single
CellFormat
object and pass that intosetCellFormat
.将 NumberFormat 设置为 EXPONENTIAL。这对我有用。像这样:-
数字格式.指数
Make the NumberFormat to EXPONENTIAL. It worked for me. Like this:-
NumberFormats.EXPONENTIAL