Hi
I Use Open XML to Extend the Excel Buffer Functionality but I don't know how to set cell background color.
For example, I use this code to set the font :
//Create Font color
font1 := XlWrkBkWriter.FirstWorksheet.DefaultCellDecorator.Font.CloneNode(TRUE);
fontcolor := fontcolor.Color;
fontcolor.Rgb := FontHexValue.HexBinaryValue(ColorFont);
font1.Color := fontcolor;
//Create font size
FontSize := FontSize.FontSize;
FontSize.Val := FontSizeDoubleValue.DoubleValue(DimensionFont);
font1.FontSize := FontSize;
// Create a new Font Text
FontName := FontName.FontName;
FontName.Val := FontNameStringValue.FromString(NameFont);
font1.FontName := FontName;
Decorator.Font:=font1;
XlWrkShtWriter.SetCellValueText(RigaCorrente,column,FORMAT(ValoreVariant),Decorator)
Help me !! ](*,) ](*,)
Thanks in advance
Comments
Hope it helps.
Regards
But I use this variable
XlWrkShtWriter :
Microsoft.Dynamics.Nav.OpenXml.Spreadsheet.WorksheetWriter.'Microsoft.Dynamics.Nav.OpenXml, Version=7.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
to write into cells.
how can I replicate your suggestion?
There are several blogs showing you how to do this, and it is a free download.
http://mibuso.com/blogs/davidmachanick/