jxl 合并后的单元格怎么赋值啊?

我现在有一个excel模板,我选中单元格后给其写入数字,可是合并后的单元格,赋值的时候后台会出现:Warning:RangeA18-A27containsmorethan... 我现在有一个excel模板,我选中单元格后给其写入数字,可是合并后的单元格,赋值的时候后台会出现:
Warning: Range A18-A27 contains more than one data cell. Setting the other cells to blank.
然后整个合并后的单元格就是是空的了。
展开
 我来答
百度网友253c4da
推荐于2016-11-08 · TA获得超过1.4万个赞
知道小有建树答主
回答量:134
采纳率:100%
帮助的人:72.3万
展开全部
231 /***
232 * Checks the cell ranges for intersections, or if the merged cells
233 * contains more than one item of data
234 */
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 }
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式