C
carsten123
Gast
Hi,
ich erzeuge mittels HSSF Excel-Sheets. Die darin enthaltenen Zellen besitzen eine Bedingte Formatierung. So lange sich die Bedingte Formatierung auf den Werte der Zelle selbst beschränkt ist alles super.
Wenn ich jedoch als Bedingung nur eine Formel verwende klappt es nicht, das heißt die Datei wird geschrieben und man kann sie auch mit Excel öffnen, will man sich aber die Bedingte-Formatierung über "Format"->"Bedingte Formatierung" anschauen, erscheint nicht das kleine Fester, das sonst immer erscheint und auch die Formatierung an sich Funktioniert nicht.
Hier mein Quelltext:
in der API steht zur Funktion "createConditionalFormattingRule()" folgendes:
"A factory method allowing to create a conditional formatting rule with a formula.
The formatting rules are applied by Excel when the value of the formula not equal to 0.
TODO - formulas containing cell references are currently not parsed properly "
Aber die API ist meiner Meinung noch veraltet und nicht aktuell (ist mir an anderen Stellen aufgefallen). Ich benutze Apache POI 3.1.
Wieß vielleicht jemand wie es richtig funktioniern könnte, oder ist die Implementierung wirklich fehlerhaft?
Gruß carsten
ich erzeuge mittels HSSF Excel-Sheets. Die darin enthaltenen Zellen besitzen eine Bedingte Formatierung. So lange sich die Bedingte Formatierung auf den Werte der Zelle selbst beschränkt ist alles super.
Wenn ich jedoch als Bedingung nur eine Formel verwende klappt es nicht, das heißt die Datei wird geschrieben und man kann sie auch mit Excel öffnen, will man sich aber die Bedingte-Formatierung über "Format"->"Bedingte Formatierung" anschauen, erscheint nicht das kleine Fester, das sonst immer erscheint und auch die Formatierung an sich Funktioniert nicht.
Hier mein Quelltext:
Code:
HSSFConditionalFormattingRule rule4 = formating.createConditionalFormattingRule("$A$5<$A$6");
HSSFPatternFormatting patternFmt4 = rule4.createPatternFormatting();
patternFmt4.setFillBackgroundColor(HSSFColor.VIOLET.index);
Region [] regions2 =
{
new Region(3,(short)3,3,(short)3)
};
formating.addConditionalFormatting(regions2, rule4);
in der API steht zur Funktion "createConditionalFormattingRule()" folgendes:
"A factory method allowing to create a conditional formatting rule with a formula.
The formatting rules are applied by Excel when the value of the formula not equal to 0.
TODO - formulas containing cell references are currently not parsed properly "
Aber die API ist meiner Meinung noch veraltet und nicht aktuell (ist mir an anderen Stellen aufgefallen). Ich benutze Apache POI 3.1.
Wieß vielleicht jemand wie es richtig funktioniern könnte, oder ist die Implementierung wirklich fehlerhaft?
Gruß carsten