lu
4 天以前 a6f65537fd87ae065fe5cec62863ac4380d2a745
DevApp/Gs.DevApp/UserControl/CopyXls.cs
@@ -1,4 +1,5 @@
using DevExpress.Spreadsheet;
using CefSharp.DevTools.Debugger;
using DevExpress.Spreadsheet;
using DevExpress.XtraEditors;
using System;
using System.Collections.Generic;
@@ -33,6 +34,7 @@
                {
                    IWorkbook workbook = spreadsheetControl1.Document;
                    workbook.LoadDocument(filePath);
                   // SetCellText(spreadsheetControl1.ActiveWorksheet, location, item.F_Name, true);
                }
                else
                {
@@ -66,5 +68,19 @@
        {
            spreadsheetControl1.SaveDocument();
        }
        /// <summary>
        /// 从数据库里读取到Excel
        /// </summary>
        /// <param name="workSheet"></param>
        /// <param name="coordinates">位置格式如A1 B2</param>
        /// <param name="coordValue">值</param>
        /// <param name="isBold">是否加粗</param>
        private void SetCellText(Worksheet workSheet, string coordinates, string coordValue, bool isBold)
        {
            workSheet.Cells[coordinates].Value = coordValue;
            workSheet.Cells[coordinates].Style.Font.Bold = isBold;
        }
    }
}