Excel xlsx export problem for background color = clBtnFace

Hello

We use FastReport VCL 5.3.14 Prof / XE6

Exporting controls with clBtnFace background color to XLSX results in black Excel cells.

1. Set background color of TfrxMemoView control to clBtnFace
2. Preview of the report -> ok
3. Export to Excel XLSX -> Excel cell has black background color -> contents is not readable anymore

Please see attached PDF and sample project.

Best regards
Tom

Comments

  • gpigpi
    edited 11:39AM
    Modify frxOfficeOpen.pas:
    uses Windows;
    
    function RGBSwap(c: TColor): TColor;
    var
    rgb: array[0..2] of Byte;
    i: Integer;
    begin
    if c < 0 then //add
    c := GetSysColor(c and $000000FF); //add
    for i := 0 to 2 do
    begin
    rgb[i] := c and $ff;
    c := c shr 8;
    end;
    

Leave a Comment