Example #1
0
        /// <summary>
        /// 导出Excel(用于Web)
        /// </summary>
        /// <param name="dataSet">数据集,DataSetName="产出物名称"</param>
        /// <param name="stream">流</param>
        public static void ExportForBS(DataSet dataSet, Stream stream)
        {
            ProductRule   productRule = GetProductRule(dataSet.DataSetName, true);
            ProductWriter writer      = ProductWriter.NewInstance(productRule, dataSet);

            writer.Export(stream);
        }
Example #2
0
        /// <summary>
        /// 导出Excel
        /// </summary>
        /// <param name="dataSet">数据集,DataSetName="产出物名称"</param>
        /// <param name="exportfile">绝对路径;导出文件名</param>
        public static void Export(DataSet dataSet, string exportfile)
        {
            ProductRule productRule = _config.GetRules(dataSet.DataSetName, true);

            MatchExcelVersion(productRule, ref exportfile);
            ProductWriter writer = ProductWriter.NewInstance(productRule, dataSet);

            writer.Export(exportfile);
        }