Ejemplo n.º 1
0
sheet.addData('B', 2, "設定")
sheet.addData('I', 2, "値")
sheet.addData('J', 2, "備考")

sheet.addFont(['B'], [1], name='Arial', bold=True)
sheet.addFont(['B', 'I', 'J'], [2], name='Meiryo UI', color=COLOR_LIGHT)

sheet.addBackgroundColor(list("BCDEFGHIJ"), [2], 'solid', COLOR_BG_DARK)

sheet.addBorder(list("BCDEFGHIJ"), [2], 'thin', COLOR_WEEK_BLACK,
                ['top', 'bottom'])
sheet.addBorder(['B', 'I', 'J'], [2], 'thin', COLOR_WEEK_BLACK, ['left'])
sheet.addBorder(['J'], [2], 'thin', COLOR_WEEK_BLACK, ['right'])

endpoint = 3
for host in schema.getHosts():
    sheet.addData('B', endpoint, host['name'])
    sheet.addFont(list("BCDEFGHIJ"), [endpoint], name='Arial')
    sheet.addBorder(list("BCDEFGHIJ"), [endpoint], 'thin', COLOR_WEEK_BLACK,
                    ['top'])
    sheet.addBorder(['B', 'I', 'J'], [endpoint], 'thin', COLOR_WEEK_BLACK,
                    ['left'])
    sheet.addBorder(['J'], [endpoint], 'thin', COLOR_WEEK_BLACK, ['right'])
    endpoint += 1

    sheet.addData('C', endpoint, 'vars')
    sheet.addFont(list("BCDEFGHIJ"), [endpoint], name='Arial')
    sheet.addBorder(list("CDEFGHIJ"), [endpoint], 'thin', COLOR_WEEK_BLACK,
                    ['top'])
    sheet.addBorder(['B', 'C', 'I', 'J'], [endpoint], 'thin', COLOR_WEEK_BLACK,
                    ['left'])