/// <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); }
/// <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>())); }
/// <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>())); }