// Create new Font, cloned from existing Font Font := WrkbookWriter.FirstWorksheet.DefaultCellDecorator.Font.CloneNode(TRUE); // Create a new Font Color FontColor := FontColor.Color; FontColor.Rgb := FontHexValue.HexBinaryValue('0000EEEE'); Font.Color := FontColor; // Create a new Font Size FontSize := FontSize.FontSize; FontSize.Val := FontSizeDoubleValue.DoubleValue(30); Font.FontSize := FontSize; // Create a new Font Text FontName := FontName.FontName; //FontNameStringValue := FontNameStringValue.StringValue('Arial'); FontName.Val := FontNameStringValue.FromString('Arial'); Font.FontName := FontName; // Get the collection of Fonts that already exists Fonts := WrkbookWriter.Workbook.WorkbookPart.WorkbookStylesPart.Stylesheet.Fonts; // Add the new font to the collection of fonts and increate the number of fonts with one. IF OpenXmlHelper.AppendChild(Fonts,Font) THEN Fonts.Count.Value := Fonts.Count.Value + 1; // Add the Font to a decorator Decorator := WrkbookWriter.FirstWorksheet.DefaultCellDecorator; Decorator.Font := Font;
Comments
I am home with sick kids today but I will look up the AL code Monday to see, what you can do.
Software Design Engineer II
Dynamics NAV Office 365
Microsoft
This posting is provided "AS IS" with no warranties, and confers no rights.