internal bool AddDocumentMap(DocumentMap docMap) { if (docMap == null) { return(false); } m_excel.SetCurrentSheetName(ExcelRenderRes.DocumentMap); int num = 0; m_excel.SetColumnExtents(0, m_excel.MaxColumns - 1); m_excel.SetSummaryRowAfter(after: false); m_excel.DefineCachedStyle("DocumentMapHyperlinkStyle"); m_excel.GetCellStyle().Color = m_excel.AddColor("Blue"); m_excel.GetCellStyle().Underline = Underline.Single; m_excel.GetCellStyle().Name = "Arial"; m_excel.GetCellStyle().Size = 10.0; m_excel.EndCachedStyle(); while (docMap.MoveNext() && num <= m_excel.MaxRows) { if (num % m_excel.RowBlockSize == 0) { for (int i = 0; i < m_excel.RowBlockSize; i++) { m_excel.AddRow(i + num); } } DocumentMapNode current = docMap.Current; m_excel.SetRowContext(num); m_excel.SetColumnContext(current.Level - 1); m_excel.SetCellValue(current.Label, TypeCode.String); if (num == 0) { m_excel.GetCellStyle().Bold = 700; m_excel.GetCellStyle().Name = "Arial"; m_excel.GetCellStyle().Size = 10.0; m_excel.GetCellStyle().Color = m_excel.AddColor("Black"); } else { m_excel.AddBookmarkLink(current.Label, current.Id); m_excel.UseCachedStyle("DocumentMapHyperlinkStyle"); } m_excel.SetRowProperties(num, 240, (byte)(current.Level - 1), current.Level > 2, autoSize: false); m_excel.AddMergeCell(num, current.Level - 1, num, 32); num++; } for (int j = 0; j < m_excel.MaxColumns; j++) { m_excel.SetColumnProperties(j, 20.0, 0, collapsed: false); } return(true); }
private static BorderProperties FillBorderProperties(IExcelGenerator excel, BorderProperties currBorder, BorderProperties border, ExcelBorderPart part, object style, object width, object color) { BorderProperties borderProperties = currBorder; if (style != null) { if (borderProperties == null) { borderProperties = new BorderProperties(border, part); } borderProperties.Style = LayoutConvert.ToBorderLineStyle((RPLFormat.BorderStyles)style); } if (width != null) { if (borderProperties == null) { borderProperties = new BorderProperties(border, part); } borderProperties.Width = LayoutConvert.ToPoints((string)width); } if (color != null && !color.Equals("Transparent")) { if (borderProperties == null) { borderProperties = new BorderProperties(border, part); } borderProperties.Color = excel.AddColor((string)color); } return(borderProperties); }
internal static void FillAllBorders(RPLStyleProps style, ref BorderProperties leftBorder, ref BorderProperties rightBorder, ref BorderProperties topBorder, ref BorderProperties bottomBorder, ref IColor backgroundColor, IExcelGenerator excel) { if (style[34] != null && !style[34].Equals("Transparent")) { backgroundColor = excel.AddColor((string)style[34]); } FillLeftBorderProperties(style, excel, ref leftBorder); FillRightBorderProperties(style, excel, ref rightBorder); FillTopBorderProperties(style, excel, ref topBorder); FillBottomBorderProperties(style, excel, ref bottomBorder); }
private void FillBorderProperties(IExcelGenerator excel, BorderProperties border, object style, object width, object color) { if (style != null) { border.Style = LayoutConvert.ToBorderLineStyle((RPLFormat.BorderStyles)style); } if (width != null) { border.Width = LayoutConvert.ToPoints((string)width); } if (color != null && !color.Equals("Transparent")) { border.Color = excel.AddColor((string)color); } }