Esempio n. 1
0
        public int FillBlock(DataTable table)
        {
            var rowIndex = StartParseRowIndex;

            for (var i = 0; i < table.Rows.Count; i++)
            {
                CountedMap.Clear();
                if ((DynamicColumn != null) && !IsDynamicCloumnsCreated)
                {
                    DynamicColumn.CheckColumn(this, Holder, rowIndex, table, i);
                }
                foreach (var groupKey in GroupKeyList)
                {
                    if (groupKey.ReusedKey == null)
                    {
                        groupKey.ReusedKey = SearchKey.FindReusedKey(groupKey.ValueColName);
                    }
                    var copyKey = groupKey.Copy();
                    if (copyKey.SearchKey != null)
                    {
                        copyKey.SearchKey.FillKey(table, i);
                    }
                    Holder.AddValue(CountedMap, copyKey, table, i);
                }
                for (var k = 0; k < TplLineList.Count; k++)
                {
                    var updateLine = TplLineList[k];
                    var isNewLine  = updateLine.FillLine(Holder, rowIndex, table, i);
                    if (isNewLine)
                    {
                        FillLastLine(k, LastUsedLine, rowIndex - 1, table, LastUsedLineValueIndex); //?填充上一行值
                        LastUsedLine           = updateLine;
                        LastUsedLineValueIndex = i;
                        if ((i + 1) >= table.Rows.Count)
                        {
                            FillLastLine(k, updateLine, rowIndex, table, LastUsedLineValueIndex);
                        }

                        rowIndex  += 1;
                        RowsCount += 1;
                    }
                }
            }
            MergeHGroupCells();
            if (!table.ExtendedProperties.ContainsKey("TableType") ||
                (table.ExtendedProperties["TableType"].ToString() != "CustumEmpty"))
            {
                MergeVGroupCells();
            }
            return(RowsCount);
        }