如果合并了单元格,则无法添加excel表 - epplus [英] Not able to add excel table if cells are merged - epplus
本文介绍了如果合并了单元格,则无法添加excel表 - epplus的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
想要绘制一个excel表,并且所选的单元格区域具有合并的单元格,因为表格未被绘制,
打开excel文件时收到错误消息。
Hi,
want to draw a excel table and the cell range selected has the merged cells, becuase of which the Table is not getting drawn,
when opening excel file getting a error message.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><logFileName>error088200_01.xml</logFileName><summary>Errors were detected in file 'D:\ConvetDT\RecordDefinationtest.xlsx'</summary><removedFeatures><removedFeature>Removed Feature: Table from /xl/tables/table2.xml part (Table)</removedFeature></removedFeatures><repairedRecords><repairedRecord>Repaired Records: Table from /xl/tables/table1.xml part (Table)</repairedRecord></repairedRecords></recoveryLog>
我尝试过:
What I have tried:
ws.Cells["B2:C2"].Merge = true;
ws.Cells["B3:C3"].Merge = true;
ws.Cells["B4:C4"].Merge = true;
ws.Cells["B5:C5"].Merge = true;
ExcelTableCollection tblcollection = ws.Tables;
ExcelTable table = tblcollection.Add(ws.Cells["A2:C5"]
推荐答案
你不能有合并的单元格在表格中.Excel不支持。
删除表格,或删除合并的单元格。
You cannot have merged cells within a table. Excel does not support that.
Either remove the table, or remove the merged cells.
这篇关于如果合并了单元格,则无法添加excel表 - epplus的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文