Ejemplo n.º 1
0
 /// <summary>
 ///     格式化
 /// </summary>
 /// <param name="sheetAdapter">Sheet适配器</param>
 public override void Format(SheetAdapter sheetAdapter)
 {
     IRow row = sheetAdapter.GetRow(Parameter.RowIndex);
     if (null == row)
     {
         throw new ExcelReportFormatException("row is null");
     }
     ICell cell = row.GetCell(Parameter.ColumnIndex);
     if (null == cell)
     {
         throw new ExcelReportFormatException("cell is null");
     }
     cell.SetValue(Value);
 }
Ejemplo n.º 2
0
        /// <summary>
        ///     格式化
        /// </summary>
        /// <param name="sheetAdapter">Sheet适配器</param>
        public override void Format(SheetAdapter sheetAdapter)
        {
            IRow row = sheetAdapter.GetRow(Parameter.RowIndex);
            if (null == row)
            {
                throw new ExcelReportException("row is null");
            }
            ICell cell = row.GetCell(Parameter.ColumnIndex);
            if (null == cell)
            {
                throw new ExcelReportException("cell is null");
            }

            cell.SetValue(cell.StringCellValue.Replace(string.Format("$[{0}]", Parameter.Name), Value.CastTo<string>()));
        }
Ejemplo n.º 3
0
        /// <summary>
        ///     格式化
        /// </summary>
        /// <param name="sheetAdapter">Sheet适配器</param>
        public override void Format(SheetAdapter sheetAdapter)
        {
            IRow row = sheetAdapter.GetRow(Parameter.RowIndex);

            if (null == row)
            {
                throw new ExcelReportFormatException("row is null");
            }
            ICell cell = row.GetCell(Parameter.ColumnIndex);

            if (null == cell)
            {
                throw new ExcelReportFormatException("cell is null");
            }
            cell.SetValue(Value);
        }
Ejemplo n.º 4
0
        /// <summary>
        ///     格式化
        /// </summary>
        /// <param name="sheetAdapter">Sheet适配器</param>
        public override void Format(SheetAdapter sheetAdapter)
        {
            IRow row = sheetAdapter.GetRow(Parameter.RowIndex);

            if (null == row)
            {
                throw new ExcelReportException("row is null");
            }
            ICell cell = row.GetCell(Parameter.ColumnIndex);

            if (null == cell)
            {
                throw new ExcelReportException("cell is null");
            }

            cell.SetValue(cell.StringCellValue.Replace(string.Format("$[{0}]", Parameter.Name), Value.CastTo <string>()));
        }