QXlsx icon indicating copy to clipboard operation
QXlsx copied to clipboard

Conditional formatting fails saving "format"

Open Julieng031 opened this issue 3 years ago • 2 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.

Julieng031 avatar Apr 10 '21 16:04 Julieng031

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?

j2doll avatar Apr 15 '21 13:04 j2doll

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

Julieng031 avatar Apr 17 '21 08:04 Julieng031