property ExcelReport.template

Set a default Excel template file.


Name of the template to be used as default template. The extension ‘.crtx’ will be added if not given. The full path to the template file must be given if no template directory has been set.


>>> demo = load_example_data('demo')

Passing the name of the template (only if a template directory has been set)

>>> report = ExcelReport(EXAMPLE_EXCEL_TEMPLATES_DIR)
>>> report.template = 'Line'
>>> sheet_pop = report.new_sheet('Population')
>>> sheet_pop.add_graph(demo.pop['Belgium'],'Belgium')

Passing the full path of the template file

>>> # if no default template directory has been set
>>> # or if the new template is located in another directory,
>>> # you must provide the full path
>>> sheet_pop.template = r'C:\other_templates_dir\Line_Marker.crtx' # doctest: +SKIP
>>> sheet_pop.add_graph(demo.pop['Germany'],'Germany') # doctest: +SKIP