Create a Title Page

You can add a title page to your report using the mlreportgen.report.TitlePage class. It is much easier and more efficient to use this class rather than using DOM objects to create and add a title page to your report. This class has predefined holes and formatting for the:

  • Title

  • Subtitle

  • Image

  • Author

  • Publisher

  • Publication date

You can exclude items you do not want on your title page and you can edit the TitlePage template to add more items.

This example shows code that creates a title page, which uses default formatting.

import mlreportgen.report.*
rpt = Report('output','pdf');

tp = TitlePage();
tp.Title = 'Aircraft Tests';
tp.Subtitle = 'Monthly Data';
tp.Image = which('b747.jpg');
tp.Author = 'John Smith';
tp.Publisher = 'MathWorks';
tp.PubDate = date();

add(rpt,tp);
close(rpt);
rptview(rpt);

For information and more examples, see mlreportgen.report.TitlePage.