You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When setting up conditional format for type "cell" and using a >= or <= criteria, the value parameter is not taken into account and therefore the conditional style does not work
Steps to reproduce the issue:
Create a conditional style format like this :
if pctOKStyle, err = cg.workbook.NewConditionalStyle({"font":{"bold":true, "color":"#38761D"}}); err != nil {
log.Printf("Failed to create OKStyle : %v", err)
}
if pctNOKStyle, err = cg.workbook.NewConditionalStyle({"font":{"color":"#FF9900"}}); err != nil {
log.Printf("Failed to create NOKStyle : %v", err)
}
pctFormat := fmt.Sprintf([{"type":"cell","criteria":">","format":%d,"value":"0"},{"type":"cell","criteria":"<=","format":%d,"value":"0"}], pctNOKStyle, pctOKStyle)
if err := workbook.SetConditionalFormat(detailsSheet, "A1:A38"), pctFormat); err != nil {
log.Printf("Failed to set conditional format on col %s : %v", c, err)
}
Describe the results you received:
for cells with values <=0 , the font color is not changed
Describe the results you expected:
One should see orange font when cell value is >0 and green font when <=0
However, the green format is never applied
Output of go version:
go version go1.14.1 darwin/amd64
When setting up conditional format for type "cell" and using a >= or <= criteria, the value parameter is not taken into account and therefore the conditional style does not work
Steps to reproduce the issue:
if pctOKStyle, err = cg.workbook.NewConditionalStyle(
{"font":{"bold":true, "color":"#38761D"}}
); err != nil {log.Printf("Failed to create OKStyle : %v", err)
}
if pctNOKStyle, err = cg.workbook.NewConditionalStyle(
{"font":{"color":"#FF9900"}}
); err != nil {log.Printf("Failed to create NOKStyle : %v", err)
}
pctFormat := fmt.Sprintf(
[{"type":"cell","criteria":">","format":%d,"value":"0"},{"type":"cell","criteria":"<=","format":%d,"value":"0"}]
, pctNOKStyle, pctOKStyle)if err := workbook.SetConditionalFormat(detailsSheet, "A1:A38"), pctFormat); err != nil {
log.Printf("Failed to set conditional format on col %s : %v", c, err)
}
Describe the results you received:
for cells with values <=0 , the font color is not changed
Describe the results you expected:
One should see orange font when cell value is >0 and green font when <=0
However, the green format is never applied
Output of
go version
:go version go1.14.1 darwin/amd64
Excelize version or commit ID:
Commit ID:
66d0272
Environment details (OS, Microsoft Excel™ version, physical, etc.):
Mac OS 10.15.4 / Excel 16.16.20
The text was updated successfully, but these errors were encountered: