formily | 📱🚀 🧩 Cross Device & High Performance Normal Form | Form library
kandi X-RAY | formily Summary
kandi X-RAY | formily Summary
📱🚀 🧩 Cross Device & High Performance Normal Form/Dynamic(JSON Schema) Form/Form Builder -- Support React/React Native/Vue 2/Vue 3
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of formily
formily Key Features
formily Examples and Code Snippets
Community Discussions
Trending Discussions on formily
QUESTION
I have already created the excel files already has such as createConditionalFormattingRule
With defrent kind like if the cell value EQUAL to another one :
ANSWER
Answered 2021-Aug-12 at 11:05In current Apache poi 5.0.0
SheetConditionalFormatting
does not have a method to create a ConditionalFormattingRule
for top 10. But it has SheetConditionalFormatting.createConditionalFormattingColorScaleRule()
. So your linked excample which uses underlying org.openxmlformats.schemas.spreadsheetml.x2006.main.*
classes for creating color scale rule is outdated.
But top 10 rule settings are more complex than color scale rule settings. For color scale rule all settings are in sheet's CTConditionalFormatting
. For top 10 rule a fill pattern formatting needs to be used. That pattern formatting links to the style part of the workbook.
So best way would be creating a XSSFConditionalFormattingRule
for top 10 which sets type STCfType.TOP_10
and rank. This ConditionalFormattingRule
already provides a method to create pattern formatting.
Unfortunately constructor of XSSFConditionalFormattingRule
is not public as well as the method to get CTCfRule
. So reflection needs to be used.
Following complete example provides XSSFConditionalFormattingRule createConditionalFormattingRuleTop10(XSSFSheetConditionalFormatting sheetCF, int rank)
to create a XSSFConditionalFormattingRule
for top 10 given a special rank. All other stuff is like the default stuff for creating conditional formatting as described in Busy Developers' Guide to HSSF and XSSF Features - Conditional Formatting.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install formily
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page