我就简单写了下代码,代码如下:
List<TableCell> lstXX = new List<TableCell>();
foreach (TableCell pNext in pOuterMostTable.Cells)
{
if (pNext.Length == -1)
continue;
lstXX.Add(pNext);
}
foreach (Table pNextTable in pOuterMostTable.NestedTables)
{
foreach (TableCell pNext in pNextTable.Cells)
{
if (pNext.Length == -1)
continue;
lstXX.Add(pNext);
}
}
foreach (TableCell pNext in lstXX)
{
sX += String.Format("Row = {0},Column = {1},Length = {2},Text = {3}, Start = {4}, Position = {5},Width = {6} \n",
pNext.Row, pNext.Column, pNext.Length, pNext.Text, pNext.Start, pNext.Position,pNext.Width);
}
结果:
Row = 1,Column = 1,Length = 2,Text = 日期, Start = 1, Position = 0,Width = 575
Row = 1,Column = 2,Length = 2,Text = 时间, Start = 4, Position = 575,Width = 615
Row = 1,Column = 3,Length = 4,Text = T(℃), Start = 7, Position = 1190,Width = 540
Row = 1,Column = 4,Length = 9,Text = P/HR次/min, Start = 12, Position = 1730,Width = 660
Row = 1,Column = 5,Length = 6,Text = B次/min, Start = 22, Position = 2390,Width = 735
Row = 1,Column = 6,Length = 4,Text = SPO2, Start = 29, Position = 3125,Width = 540
Row = 1,Column = 7,Length = 2,Text = 意识, Start = 34, Position = 3665,Width = 435
Row = 1,Column = 8,Length = 2,Text = 入量, Start = 37, Position = 4100,Width = 495
Row = 1,Column = 10,Length = 2,Text = 出量, Start = 40, Position = 5180,Width = 555
Row = 1,Column = 12,Length = 5,Text = 阴道分泌物, Start = 43, Position = 6260,Width = 645
Row = 1,Column = 14,Length = 2,Text = 腹部, Start = 49, Position = 7460,Width = 510
Row = 1,Column = 16,Length = 3,Text = 其他1, Start = 52, Position = 8810,Width = 930
Row = 1,Column = 17,Length = 4,Text = 特殊情况, Start = 56, Position = 9740,Width = 3030
Row = 1,Column = 18,Length = 2,Text = 签名, Start = 61, Position = 12770,Width = 838
Row = 2,Column = 8,Length = 2,Text = 内容, Start = 64, Position = 4100,Width = 495
Row = 2,Column = 9,Length = 2,Text = ML, Start = 67, Position = 4595,Width = 585
Row = 2,Column = 10,Length = 2,Text = 内容, Start = 70, Position = 5180,Width = 555
Row = 2,Column = 11,Length = 2,Text = ML, Start = 73, Position = 5735,Width = 525
Row = 2,Column = 12,Length = 3,Text = 有/无, Start = 76, Position = 6260,Width = 645
Row = 2,Column = 13,Length = 2,Text = 性状, Start = 80, Position = 6905,Width = 555
Row = 2,Column = 14,Length = 3,Text = 有/无, Start = 83, Position = 7460,Width = 510
Row = 2,Column = 15,Length = 2,Text = 部位, Start = 87, Position = 7970,Width = 840
这里不存在对不对应的问题。请帮忙查看原因。
|