1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

Progress OpenEdge DocxFactory change cell formatting

Discussão em 'StackOverflow' iniciado por fdantas, Dezembro 18, 2017.

  1. fdantas

    fdantas Administrator Moderador

    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...

Compartilhe esta Página