private static void SetCellProperties(PivotExportCellInfo cellInfo, CellSelection cellSelection) { var fill = GenerateFill(cellInfo.Background); if (fill != null) { cellSelection.SetFill(fill); } SolidColorBrush solidBrush = cellInfo.Foreground as SolidColorBrush; if (solidBrush != null) { cellSelection.SetForeColor(new ThemableColor(solidBrush.Color)); } if (cellInfo.FontWeight.HasValue && cellInfo.FontWeight.Value != FontWeights.Normal) { cellSelection.SetIsBold(true); } SolidColorBrush solidBorderBrush = cellInfo.BorderBrush as SolidColorBrush; if (solidBorderBrush != null && cellInfo.BorderThickness.HasValue) { var borderThickness = cellInfo.BorderThickness.Value; var color = new ThemableColor(solidBorderBrush.Color); //var leftBorder = new CellBorder(GetBorderStyle(borderThickness.Left), color); //var topBorder = new CellBorder(GetBorderStyle(borderThickness.Top), color); var rightBorder = new CellBorder(GetBorderStyle(borderThickness.Right), color); var bottomBorder = new CellBorder(GetBorderStyle(borderThickness.Bottom), color); var insideBorder = cellInfo.Background != null ? new CellBorder(CellBorderStyle.None, color) : null; cellSelection.SetBorders(new CellBorders(null, null, rightBorder, bottomBorder, insideBorder, insideBorder, null, null)); } }
private void SetCellValue(string value, CellIndex cellIndex, string fontFamilyName, bool isItalic, bool isBold) { CellSelection cell = this.Worksheet.Cells[cellIndex]; cell.SetValue(value); cell.SetFontFamily(new ThemableFontFamily(fontFamilyName)); cell.SetIsItalic(isItalic); cell.SetIsBold(isBold); }
public void GetSetClearIsBold() { #region radspreadsheet-features-formatting-cells_1 Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); CellSelection selection = worksheet.Cells[0, 0, 5, 5]; selection.SetIsBold(true); bool isBold = selection.GetIsBold().Value; selection.ClearIsBold(); #endregion }
public void GetSetClearIsBold() { #region radspreadprocessing-working-with-cells-get-set-clear-properties_1 Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); CellSelection selection = worksheet.Cells[0, 0, 5, 5]; selection.SetIsBold(true); bool isBold = selection.GetIsBold().Value; selection.ClearIsBold(); #endregion }