[Stackoverflow] [Progress OpenEdge ABL] Progress OpenEdge DocxFactory change cell formatting

Status
Not open for further replies.
J

Johan Vergeer

Guest
We're using DocxFactory to generate Excel documents.

I would like to do some formatting so de default can be changed. Based on an example on Github I was able to change the font color of the row contents, but I can't find any documentation on how to change the rest of the cell formatting.

We would like to just have a plain Excel spreadsheet. White background with black content.
The header rows (There can be one or multiple) need to be bold.

The last thing is that we would like to automatically resize the column widths according to the content.

What I have go so far to format the cells:

DEF INPUT PARAM piColumnsCount AS INT NO-UNDO.
DEF VAR cLabelNames AS CHAR NO-UNDO.
DEF VAR cLabelParams AS CHAR NO-UNDO.

// Create ttMeta records for cell formatting
DO ix = 1 TO piColumnsCount:
IF cLabelNames <> "" THEN
ASSIGN
cLabelNames = cLabelNames + "|"
cLabelParams = cLabelParams + "|".

ASSIGN
cLabelNames = cLabelNames + "Field" + STRING(ix, "999")
cLabelParams = cLabelParams + "[Black]".

IF ix MODULO 20 = 0 THEN
DO:
IF cLabelNames <> "" THEN
DO:
CREATE ttMeta.
ASSIGN
ttMeta.cObject = pcObject
ttMeta.cName = cLabelNames
ttMeta.cParam = cLabelParams

cLabelNames = ""
cLabelParams = "".
END.
END.
END.

Continue reading...
 
Status
Not open for further replies.
Top