array(2) { ["docs"]=> array(0) { } ["count"]=> int(0) } 111string(0) "" int(1) int(10) int(70) int(8640000) string(13) "likecs_art_db" array(1) { ["query"]=> array(1) { ["match_all"]=> object(stdClass)#28 (0) { } } } array(1) { ["createtime.keyword"]=> array(1) { ["order"]=> string(4) "desc" } } int(10) int(0) int(8640000) array(2) { ["docs"]=> array(0) { } ["count"]=> int(0) } C# 插入excel 单元格数据、写入Excel数据 - 爱码网

         /// <summary>
        /// 插入数据
        /// </summary>
        /// <param name="rowIndex">行号</param>
        /// <param name="columnIndex">列号</param>
        /// <param name="content">内容</param>
        /// <param name="comment">批注</param>
        public static void InsertCell(int rowIndex, int columnIndex, string content, string comment)
        {

            Microsoft.Office.Interop.Excel.ApplicationClass excel = wbb.Application as Microsoft.Office.Interop.Excel.ApplicationClass;

            Microsoft.Office.Interop.Excel.Workbook wb = excel.Workbooks[1];

            int a = wb.Application.ActiveCell.Row;

            Microsoft.Office.Interop.Excel.Worksheet ws = wb.Worksheets[1] as Microsoft.Office.Interop.Excel.Worksheet;

            range = ws.Cells;

            Microsoft.Office.Interop.Excel.Range oCell = range[rowIndex, columnIndex] as Microsoft.Office.Interop.Excel.Range;         

            oCell.Value2 = content;
        }

相关文章: