コード例 #1
0
ファイル: CellExt1.cs プロジェクト: ikvm/test
 public CellExt1(Env env, int initRowCap, int initColCap)
 {
     SubRptType = SRT_NONE;
     int_1      = NORMAL;
     bool_0     = false;
     NewInput   = false;
     object_0   = PropertyDefine.CRT_GRID;
     _env       = env;
     if (env == null)
     {
         env = ConvertTool.Env;
     }
     matrix    = new Matrix(initRowCap, initColCap);
     cellIdMap = new StringMap();
     cellList  = new Queue();
     newCell(0, 0);
 }
コード例 #2
0
ファイル: CellExt1.cs プロジェクト: ikvm/test
        public virtual void clearCellRef()
        {
            cellIdMap    = null;
            cellList     = null;
            Current      = null;
            SavedCurrent = null;
            int rowSize = RowSize;
            int colSize = ColSize;

            for (int i = 1; i < rowSize; i++)
            {
                for (int j = 1; j < colSize; j++)
                {
                    CellExt ext = getCell(i, j);
                    if (ext != null)
                    {
                        ext.clearCellRef();
                    }
                }
            }
        }
コード例 #3
0
ファイル: CellExt1.cs プロジェクト: ikvm/test
 public virtual void calculate()
 {
     try
     {
         Hashtable dataSetsMap = _env.DataSetsMap;
         if (dataSetsMap != null)
         {
             foreach (var item in dataSetsMap.Values)
             {
                 if (null != item)
                 {
                     var set = item as DataSet;
                     if (null != set)
                     {
                         set.finish();
                     }
                 }
             }
         }
         bool complicated = Complicated;
         checkMacros();
         prepareCalculate();
         initMerged();
         Queue queue = new Queue();
         while (!cellList.Empty)
         {
             CellExt cell = (CellExt)cellList.Renamed;
             object  obj2 = cell.getPropValue(PropertyDefine.GRID_DATA_TYPE /*301*/);
             if (!PropertyDefine.CDT_GRAPH.Equals(obj2) && !PropertyDefine.CDT_FLASH.Equals(obj2))
             {
                 try
                 {
                     Current = cell;
                     cell.calculate();
                     cell.clearDependCells();
                     continue;
                 }
                 catch (Exception0 exception2)
                 {
                     if (exception2.Cell.dependOn(cell))
                     {
                         throw new ReportError(new StringBuilder(exception2.Cell.SourceId).Append("与").Append(cell.SourceId).Append("循环引用").ToString());
                     }
                     cell.addDependCell(exception2.Cell);
                     cellList.put(cell);
                     continue;
                 }
                 catch (Exception exception3)
                 {
                     throw exception3;
                 }
             }
             queue.put(cell);
         }
         resetDSCurrent();
         setDSCurrent();
         int_1 = GRAPH;
         while (!queue.Empty)
         {
             CellExt ext = (CellExt)queue.Renamed;
             Current = ext;
             ext.calculate();
         }
         method_6();
         if (SubRptType != SRT_IMPORT)
         {
             addMergedCells();
         }
         method_7();
         if (Input)
         {
             try
             {
                 new InputExp(this).calculate();
             }
             catch (Exception exception)
             {
                 throw new ReportError("报表为填报时计算出错,错误信息为 " + exception.Message);
             }
         }
         int_1 = FINISHED;
     }
     catch (ReportError error)
     {
         if (Current != null)
         {
             error.CellId = Current.SourceId;
         }
         throw error;
     }
     catch (Exception exception4)
     {
         if (Current == null)
         {
             throw new ReportError(exception4.Message, exception4);
         }
         if (exception4 is CircularRefineException)
         {
             throw new ReportError(new StringBuilder("单元格").Append(((CircularRefineException)exception4).Cell.SourceId).Append("中有错误,").Append(exception4.Message).ToString().ToString(), exception4);
         }
         throw new ReportError(new StringBuilder("单元格").Append(Current.SourceId).Append("中有错误,").Append(exception4.Message).ToString().ToString(), exception4);
     }
 }