Farben per SQL in Prodat werden per Spaltenname und BOOL an bestimmten Oberflächen erzeugt.
Mehrere gleichartige Spaltenbezeichnungen werden interpretiert und bei True dargestellt.
Gelb gewinnt vor Grün, Rot gewinnt vor Gelb und Grün. Feldreihenfolge: der Erste mit True gewinnt
mögliche Felder¶
CimRed CimYellow CimGreen CimBlue CimBrown CimGray
CimColor
CimBold CimItalic CimUnterline CimStrikeOut
CimFontRed CimFontGreen
CimFormat
- Gültigkeit: ganzzeilig
- Gültigkeit: Spalte oder Zelle mit Feldname als Präfix "field_format" (z.B. ak_nr_cimred)
- Auswertung: das erste Vorkommen (ungleich NULL, FALSE und '') hat immer Vorrang
- es gilt die Erstellungsreihenfolge der Columns -> stimmt aber meistens mit der Reihenfolge der SQL-Felder überein (Daten aus Cache des Grids)
- doppelt gejoint möglich (cimred, cimred_1, cimred_2 bis cimred_3)
Parameter für CimFormat (das Präfix "Cim" kann entfallen)¶
CimRed CimYellow CimGreen CimBlue CimBrown CimGray + CimDarkRed CimOrange CimDarkOrange CimLightBlue CimDarkBlue
clBlack clMaroon clGreen clOlive clNavy clPurple clTeal clGray clSilver clRed clLime clYellow clBlue clFuchsia clAqua clLtGray clDkGray clWhite clMoneyGreen clSkyBlue clCream clMedGray clInfoBk clHotLight
CimColor
CimBold CimItalic CimUnterline CimStrikeOut
CimFontRed CimFontGreen
CimFontName/Font
CimFontSize/Size
- Mehrere Angaben per Komma getrennt.
'cimred=True'
, 'cimred'
(nur für Booleanwerte und gilt als True) oder 'cimred=:ag_done'
(Referenz auf Booleanspalte)
- ebefalls ganzzeilig und zellenweise möglich ("field_format -> ak_nr_cimred=True)
- ungültige/unbekannte Formatnamen werden ignoriert (nichts ins Log geschrieben, da je ein Aufruf pro gezeichneter Zelle)
Werte für CimColor¶
Datentypen der DB-Felder¶
- CimColor/Color = Integer oder Text
- CimFormat = Text
- CimFontName = Text (z.B. Arial oder Microsoft Sans Serif -> siehe charmap.exe)
- CimFontSize = Integer (Default = 9)
- alles Andere = Boolean oder ':field' (verlinkung mit anderem Booleanfeld)
Beispiele¶
SELECT 'rot ' AS a, true AS cimred, true AS cimgreen;
SELECT 'grün' AS a, true AS cimgreen, true AS cimred;
SELECT 1 AS a, 2 AS b, 3 AS c, true AS cimred, false AS b_cimred -- ganze Zeile
UNION
SELECT 1 AS a, 2 AS b, 3 AS c, false AS cimred, true AS b_cimred -- nur B
- Konkatenieren für CimFormat
SELECT 1 AS a, concat_ws(',',
'cimgreen',
IfThen(true, 'bold', null),
IfThen(false, 'fontsize=4', null)
) AS CimFormat --'cimgreen,bold' AS CimFormat
- Alles das Gleiche (mehrere Varianten zur Übergabe von CimRed)
SELECT 1 AS aaa, true AS xxx,
true AS cimred, --xxx AS cimred,
':xxx' AS cimred,
concat_ws(',',
'red',
'cimred',
'cimred=True',
'cimred=:xxx',
IfThen(true, 'cimred', null) --IfThen(xxx, 'cimred', null)
) AS cimformat
SELECT
'A' AS a, '$0000FF' AS a_cimcolor,
'B' AS b, x'0000FF'::INT AS b_cimcolor, -- 255 AS b_cimcolor
'C' AS c, '#FF0000' AS c_cimcolor,
'D' AS d, 'clRed' AS d_cimcolor,
'E' AS e, 'CimRed' AS e_cimcolor,
'Z' AS z, NULL::INT AS z_cimcolor
- Megademo
SELECT
a, b, c, a=1 AS CimRed, 'Size=5' AS a_CimFormat,
b=5 AS b_CimBlue, IfThen(b=8, x'FFAAFF'::INT, null)::INT AS b_CimColor, --IfThen macht aus dem INT ein DECIMAL
'cimgreen,bold' AS c_CimFormat
FROM (
SELECT 1 AS a, 2 AS b, 3 AS c
UNION
SELECT 4, 5, 6
UNION
SELECT 7, 8, 9
) AS x
ORDER BY a
SELECT
a, b, c,
a=1 AS CimRed, a=1 AS CimYellow, false AS CimGreen, false AS CimBlue, false AS CimGray, null::INT AS CimColor,
false AS CimBold, false AS CimItalic, false AS CimFontRed, false AS CimFontGreen,
null::VARCHAR AS CimFormat,
false AS a_CimRed, false AS a_CimYellow, false AS a_CimGreen, false AS a_CimBlue, false AS a_CimGray, null::INT AS a_CimColor,
false AS a_CimBold, false AS a_CimItalic, false AS a_CimFontRed, false AS a_CimFontGreen,
'Size=5' AS a_CimFormat,
false AS b_CimRed, false AS b_CimYellow, false AS b_CimGreen, b=5 AS b_CimBlue, b=5 AS b_CimGray, IfThen(b=8, x'FFAAFF'::INT, null) AS b_CimColor,
false AS b_CimBold, false AS b_CimItalic, false AS b_CimFontRed, false AS b_CimFontGreen,
null AS b_CimFormat,
false AS c_CimRed, false AS c_CimYellow, false AS c_CimGreen, false AS c_CimBlue, false AS c_CimGray, null::INT AS c_CimColor,
false AS c_CimBold, false AS c_CimItalic, false AS c_CimFontRed, false AS c_CimFontGreen,
concat_ws(',', 'cimgreen', IfThen(true, 'bold', null)) AS c_CimFormat --'cimgreen,bold' AS c_CimFormat
FROM (
SELECT 1 AS a, 2 AS b, 3 AS c
UNION
SELECT 4, 5, 6
UNION
SELECT 7, 8, 9
) AS x
ORDER BY a