Exemplo n.º 1
0
        /// <summary>
        /// 获取一个Cell
        /// </summary>
        /// <param name="row"></param>
        /// <param name="column"></param>
        /// <returns></returns>
        public dynamic Cell(int row, int column)
        {
            string rangStr    = ExcelUtilityMethod.ConvertToTitle(column + 1) + (row + 1).ToString();
            object tenmpRange = ExcelUtilityMethod.GetProperty(m_workSheet, "Range",
                                                               new object[] { rangStr });

            return(ExcelUtilityMethod.GetProperty(tenmpRange, "Value"));
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获取一个Range
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public Range Range(int row, int column)
        {
            string rangStr    = ExcelUtilityMethod.ConvertToTitle(column + 1) + (row + 1).ToString();
            object tenmpRange = ExcelUtilityMethod.GetProperty(m_workSheet, "Range",
                                                               new object[] { rangStr });

            return(new Range(tenmpRange));
        }
Exemplo n.º 3
0
        /// <summary>
        /// 获取一个Cell
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public void Cell(int row, int column, dynamic input)
        {
            string rangStr    = ExcelUtilityMethod.ConvertToTitle(column + 1) + (row + 1).ToString();
            object tenmpRange = ExcelUtilityMethod.GetProperty(m_workSheet, "Range",
                                                               new object[] { rangStr });

            ExcelUtilityMethod.SetProperty(tenmpRange, "Value", new object[] { input });
        }
Exemplo n.º 4
0
        /// <summary>
        /// 获取一个Range
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public Range Range(int rowOne, int columnOne, int rowTwo, int columnTwo)
        {
            string rangStrOne = ExcelUtilityMethod.ConvertToTitle(columnOne + 1) + (rowOne + 1).ToString();
            string rangStrTwo = ExcelUtilityMethod.ConvertToTitle(columnTwo + 1) + (rowTwo + 1).ToString();
            string rangStr    = rangStrOne + ":" + rangStrTwo;
            object tenmpRange = ExcelUtilityMethod.GetProperty(m_workSheet, "Range",
                                                               new object[] { rangStr });

            return(new Range(tenmpRange));
        }