Пример #1
0
        /// <summary>
        /// 输出表头
        /// </summary>
        /// <param name="startTime">起始时间</param>
        /// <param name="endTime">终止时间</param>
        /// <param name="xlExport">xlExport对象</param>
        private static void _WriteHeader(string startTime, string endTime, ReportExportToExcel xlExport)
        {
            //插入文字
            _ExcelCellValue[] excelCellValue = new _ExcelCellValue[]
            {
                new _ExcelCellValue(1, 3, "保税部" + startTime + "至" + endTime + "经营情况统计"),
                new _ExcelCellValue(2, 1, "项目"),
                new _ExcelCellValue(2, 2, "船名"),
                new _ExcelCellValue(2, 3, "货主"),
                new _ExcelCellValue(2, 4, "货名"),
                new _ExcelCellValue(2, 5, "数量(吨)/TEU"),
            };

            //插入文字
            xlExport.SetCellSetValue(excelCellValue, 1, 1, 2, 5);
            //设置列宽(第一列到最后一列)
            xlExport.SetColumnWidth(1, 5, 20);
            //设置行高
            xlExport.SetRowHeight(1, 2, 14);
            //设置(行1,列1,行2,列5)居中
            Range range = xlExport.GetRange(1, 1, 2, 5);

            xlExport.SetCellsAlignment(range);
            //设置表头边框
            xlExport.SetAllCellsBorderExclusiveRL(2, 1, 2, 5, ExcelBorderWeight.Thin);
        }
Пример #2
0
        /// <summary>
        /// 输出表头
        /// </summary>
        /// <param name="startTime">起始时间</param>
        /// <param name="endTime">终止时间</param>
        /// <param name="xlExport">xlExport对象</param>
        private static void _WriteHeader(string startTime, string endTime, ReportExportToExcel xlExport)
        {
            //插入文字
            _ExcelCellValue[] excelCellValue = new _ExcelCellValue[]
            {
                new _ExcelCellValue(1, 3, startTime + "至" + endTime + "客户经营报表"),
                new _ExcelCellValue(2, 1, "客户名称"),
                new _ExcelCellValue(2, 2, "报税类型"),
                new _ExcelCellValue(2, 3, "货名"),
                new _ExcelCellValue(2, 4, "船名"),
                new _ExcelCellValue(2, 5, "提单数(吨)"),
                new _ExcelCellValue(2, 6, "放货状态"),
                new _ExcelCellValue(2, 7, "入库总数(吨)"),
                new _ExcelCellValue(2, 8, "已出货(吨)"),
                new _ExcelCellValue(2, 9, "余货(吨)"),
                new _ExcelCellValue(2, 10, "已生成账单(元)"),
                new _ExcelCellValue(2, 11, "已付款(元)"),
                new _ExcelCellValue(2, 12, "未付款(吨)"),
            };

            //插入文字
            xlExport.SetCellSetValue(excelCellValue, 1, 1, 2, 12);
            //设置列宽(第一列到最后一列)
            xlExport.SetColumnWidth(1, 12, 20);
            //设置行高
            xlExport.SetRowHeight(1, 2, 14);
            //设置(行1,列1,行2,列12)居中
            Range range = xlExport.GetRange(1, 1, 2, 12);

            xlExport.SetCellsAlignment(range);
            //设置表头边框
            xlExport.SetAllCellsBorderExclusiveRL(2, 1, 2, 12, ExcelBorderWeight.Thin);
        }