larray.ReportSheet.add_title
- ReportSheet.add_title(title, width=None, height=None, fontsize=11)[source]
Add a title item to the current sheet.
Note that the current method only add a new item to the list of items to be generated. The report Excel file is generated only when the
to_excel
is called.- Parameters
- titlestr
Text to write in the title item.
- widthint, optional
width of the title item. The current default value is used if None (see
set_item_default_size
). Defaults to None.- heightint, optional
height of the title item. The current default value is used if None (see
set_item_default_size
). Defaults to None.- fontsizeint, optional
fontsize of the displayed text. Defaults to 11.
Examples
>>> report = ExcelReport()
>>> first_sheet = report.new_sheet('First_sheet') >>> first_sheet.add_title('Title banner with default width, height and fontsize') >>> first_sheet.add_title('Larger title banner', width=1200, height=100) >>> first_sheet.add_title('Bigger fontsize', fontsize=13)
>>> # do not forget to call 'to_excel' to create the report file >>> report.to_excel('Report.xlsx')