示例#1
0
 /// <summary>
 /// Sets the format properties of the given style based on the given map.
 /// </summary>
 /// <param name="style">The cell style</param>
 /// <param name="workbook">The parent workbook.</param>
 /// <param name="properties">The map of format properties (String -&gt; Object).</param>
 private static void SetFormatProperties(
         Zephyr.Utils.NPOI.SS.UserModel.ICellStyle style, HSSFWorkbook workbook, Hashtable properties)
 {
     style.Alignment = (Zephyr.Utils.NPOI.SS.UserModel.HorizontalAlignment)GetShort(properties, ALIGNMENT);
     style.BorderBottom = (Zephyr.Utils.NPOI.SS.UserModel.BorderStyle)GetShort(properties, BORDER_BOTTOM);
     style.BorderLeft = (Zephyr.Utils.NPOI.SS.UserModel.BorderStyle)GetShort(properties, BORDER_LEFT);
     style.BorderRight = (Zephyr.Utils.NPOI.SS.UserModel.BorderStyle)GetShort(properties, BORDER_RIGHT);
     style.BorderTop = (Zephyr.Utils.NPOI.SS.UserModel.BorderStyle)GetShort(properties, BORDER_TOP);
     style.BottomBorderColor = (GetShort(properties, BOTTOM_BORDER_COLOR));
     style.DataFormat = (GetShort(properties, DATA_FORMAT));
     style.FillBackgroundColor = (GetShort(properties, FILL_BACKGROUND_COLOR));
     style.FillForegroundColor = (GetShort(properties, FILL_FOREGROUND_COLOR));
     style.FillPattern = (Zephyr.Utils.NPOI.SS.UserModel.FillPatternType)GetShort(properties, FILL_PATTERN);
     style.SetFont(workbook.GetFontAt(GetShort(properties, FONT)));
     style.IsHidden = (GetBoolean(properties, HIDDEN));
     style.Indention = (GetShort(properties, INDENTION));
     style.LeftBorderColor = (GetShort(properties, LEFT_BORDER_COLOR));
     style.IsLocked = (GetBoolean(properties, LOCKED));
     style.RightBorderColor = (GetShort(properties, RIGHT_BORDER_COLOR));
     style.Rotation = (GetShort(properties, ROTATION));
     style.TopBorderColor = (GetShort(properties, TOP_BORDER_COLOR));
     style.VerticalAlignment = (Zephyr.Utils.NPOI.SS.UserModel.VerticalAlignment)GetShort(properties, VERTICAL_ALIGNMENT);
     style.WrapText = (GetBoolean(properties, WRAP_TEXT));
 }