jxl 合并后的单元格怎么赋值啊?
答案:1 悬赏:50 手机版
解决时间 2021-12-02 17:11
- 提问者网友:箛茗
- 2021-12-01 22:34
jxl 合并后的单元格怎么赋值啊?
最佳答案
- 五星知识达人网友:煞尾
- 2021-12-01 23:17
231
235 private void checkRanges()
236 {
237 try
238 {
239 SheetRangeImpl range = null;
240
241 // Check all the ranges to make sure they only contain one entry
242 for (int i = 0; i < ranges.size(); i++)
243 {
244 range = (SheetRangeImpl) ranges.get(i);
245
246 // Get the cell in the top left
247 Cell tl = range.getTopLeft();
248 Cell br = range.getBottomRight();
249 boolean found = false;
250
251 for (int c = tl.getColumn(); c <= br.getColumn(); c++)
252 {
253 for (int r = tl.getRow(); r <= br.getRow(); r++)
254 {
255 Cell cell = sheet.getCell(c, r);
256 if (cell.getType() != CellType.EMPTY)
257 {
258 if (!found)
259 {
260 found = true;
261 }
262 else
263 {
264 logger.warn("Range " + range +
265 " contains more than one data cell. " +
266 "Setting the other cells to blank.");
267 Blank b = new Blank(c, r);
268 sheet.addCell(b);
269 }
270 }
271 }
272 }
273 }
274 }
275 catch (WriteException e)
276 {
277 // This should already have been checked - bomb out
278 Assert.verify(false);
279 }
280 }
235 private void checkRanges()
236 {
237 try
238 {
239 SheetRangeImpl range = null;
240
241 // Check all the ranges to make sure they only contain one entry
242 for (int i = 0; i < ranges.size(); i++)
243 {
244 range = (SheetRangeImpl) ranges.get(i);
245
246 // Get the cell in the top left
247 Cell tl = range.getTopLeft();
248 Cell br = range.getBottomRight();
249 boolean found = false;
250
251 for (int c = tl.getColumn(); c <= br.getColumn(); c++)
252 {
253 for (int r = tl.getRow(); r <= br.getRow(); r++)
254 {
255 Cell cell = sheet.getCell(c, r);
256 if (cell.getType() != CellType.EMPTY)
257 {
258 if (!found)
259 {
260 found = true;
261 }
262 else
263 {
264 logger.warn("Range " + range +
265 " contains more than one data cell. " +
266 "Setting the other cells to blank.");
267 Blank b = new Blank(c, r);
268 sheet.addCell(b);
269 }
270 }
271 }
272 }
273 }
274 }
275 catch (WriteException e)
276 {
277 // This should already have been checked - bomb out
278 Assert.verify(false);
279 }
280 }
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯