Example #1
0
        /// <summary>
        /// 构造函数
        /// 初始化_XlsDoc对象
        /// </summary>
        public ExportExcel(MyDocument doc, string[] needColumns)
        {
            MyDoc  = doc;
            XlsDoc = new XlsDocument();
            string sheetName = string.Format("{0}", MyDoc.DocName);

            sheetName = string.IsNullOrEmpty(sheetName) ? "sheet1" : sheetName;
            CurSheet  = XlsDoc.Workbook.Worksheets.Add(sheetName);
            if (needColumns == null || needColumns.Length == 0)
            {
                Content = ContentFactory.CreateInstance(MyDoc.Content);
            }
            else
            {
                Content = ContentFactory.CreateInstance(MyDoc.Content, needColumns);
            }
        }
Example #2
0
 public ExportPdf(MyDocument doc, string[] columnsName)
 {
     MyDoc   = doc;
     Content = ContentFactory.CreateInstance(doc.Content, columnsName);
 }