Excel Generator

1 min read

info

The service is integrated into the following modules:

Functionality

The Excel Generator Service enables developers to easily convert a pandas data frame to a nicely formatted Excel File. It is used as part of a tool or module.

This service is built on top of the xlsxwriter library.

Configuration

Default Configuration

json
{
    "uploadSuffix": "_answers.docx",
    "uploadScopeId": null,
    "uploadToChat": true,
    "renameColMap": null,
    "tableHeaderFormat": {
        "bg_color": "#966919",
        "bold": true,
        "font_color": "white",
        "text_wrap": true,
    },
    "tableDataFormat":{
        "bg_color": "#FFFFFF",
        "bold": false,
        "font_color": "black",
        "text_wrap": true,
        "border": 1,
        "valign": "top",
    }
}

Field Name

Description

Type

Default Value

Required

uploadSuffix

The suffix of the generated Excel file.

string

_answer.docx

No

uploadScopeId

The scope id into which the generated docx file is uploaded.

string

null

No

uploadToChat

Whether to upload the generated file to the chat.

boolean

true

No

renameColMap

This setting lets you rename columns when exporting data.

By default, a column might be exported with a name like old_name, but if you want it to appear as something like "New Name", you can use this parameter to customize it.

Example: To rename old_name to New Name, set the parameter like this:

json
{
  "old_name": "New Name"
}

dict

null

No

tableHeaderFormat

The tableHeaderFormat setting lets you customize how table headers look in exported files.

It accepts a dictionary of style options, where you can define things like:

  • Background color

  • Font size and color

  • Bold text

  • Text wrapping

These style options follow the rules of the xlsxwriter library.

dict

json
{
  "bg_color": "#966919",
  "bold": true,
  "font_color": "white",
  "text_wrap": true,
}

No

tableDataFormat

The tableDataFormat setting lets you customize how data cells appear in exported files.

It accepts a dictionary of style settings, where you can control things like:

  • Background color

  • Font color and boldness

  • Text wrapping

  • Cell borders and vertical alignment

These style options follow the rules of the xlsxwriter library.

dict

json
{
  "bg_color": "#FFFFFF",
  "bold": false,
  "font_color": "black",
  "text_wrap": true,
  "border": 1,
  "valign": "top",
}

No

Last updated