larray.ReportSheet.template
- property ReportSheet.template
Set a default Excel template file.
- Parameters
- templatestr or Path
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.
Examples
>>> demo = load_example_data('demography_eurostat')
Passing the name of the template (only if a template directory has been set)
>>> report = ExcelReport(EXAMPLE_EXCEL_TEMPLATES_DIR) >>> report.template = 'Line'
>>> sheet_population = report.new_sheet('Population') >>> sheet_population.add_graph(demo.population['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_population.template = r'C:\other_templates_dir\Line_Marker.crtx' >>> sheet_population.add_graph(demo.population['Germany'],'Germany')