QtExcel / QXlsx

Excel file(*.xlsx) reader/writer library using Qt 5 or 6. Descendant of QtXlsxWriter.

Home Page:https://qtexcel.github.io/QXlsx/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Conditional formatting fails saving "format"

Julieng031 opened this issue · comments

Hello,

when I try to run the "conditional formatting" example:

    ConditionalFormatting cf1;
    Format fmt1;
    fmt1.setFontColor(Qt::green);
    fmt1.setBorderStyle(Format::BorderDashed);
    cf1.addHighlightCellsRule(ConditionalFormatting::Highlight_LessThan, "40", fmt1);
    cf1.addRange("B3:B21");
    xlsx.addConditionalFormatting(cf1);

... saved file cannot be opened by Excel without error. I can see that the conditional format type is correct (ie Highlight_LessThan) and the formula too ("40"). However, the associated format fails. Opening the xlsx archive, file "xl/styles.xml", I have the impression that the format is not saved in the tag.

Do I miss something ? Thanks in advance.

Dear @Julieng031

Sorry for the late reply.
I created a repository for testing. https://github.com/JayTwoLab/qxlsx-issues-155
Can you make a pull request for testing?

I tried to do it. First time I add code on GitHub, hope I did it well !