Ejemplo n.º 1
0
        public ExcelCells(IGxError errAccess, ExcelDocument document, object workBook, object selectedSheet, int rowPos, int colPos, int height, int width, bool readOnly)
        {
            doc            = document;
            m_errAccess    = errAccess;
            pWidth         = width;
            pHeight        = height;
            cntCells       = 0;
            pColPos        = colPos;
            pSelectedSheet = (ExcelWorksheet)selectedSheet;
            this.readOnly  = readOnly;

            try
            {
                pCellsRange = getExcelCell(rowPos, pColPos, pColPos + (pWidth - 1), rowPos + (pHeight - 1));
                pCells      = new ExcelRange[width * height + 1];
                string address  = pCellsRange.Address;
                int    startRow = pCellsRange.Start.Row;
                int    endRow   = pCellsRange.End.Row;
                int    startCol = pCellsRange.Start.Column;
                int    endCol   = pCellsRange.End.Column;
                for (int i = startRow; i <= endRow; i++)
                {
                    for (int j = startCol; j <= endCol; j++)
                    {
                        cntCells++;
                        pCells[cntCells] = pCellsRange[i, j];
                    }
                }
                pCellsRange.Address = address;
            }

            catch (Exception e)
            {
                GXLogging.Error(log, "ExcelCells error", e);
                m_errAccess.setErrDes("Invalid cell coordinates");
                m_errAccess.setErrCod((short)8);
            }
        }
Ejemplo n.º 2
0
 public ExcelCells(IGxError errAccess, ExcelDocument doc, object workBook, object selectedSheet, int rowPos, int colPos, int height, int width)
     : this(errAccess, doc, workBook, selectedSheet, rowPos, colPos, height, width, false)
 {
 }