Package: mlreportgen.report
Superclasses:
Page layout of report
Page layout options (watermarks, first page number, page number format, and page orientation) for the report.
Note
Reports create instances of this object that are assigned to the Report Layout properties. You do not need to create this object yourself.
Set the page number format for the whole report to Arabic numbers. Set the table of contents to use Roman numerals. This chapters use the default Arabic number format. The first page of the first chapter defaults to 1.
import mlreportgen.report.* rpt = Report('newreport'); rpt.Layout.PageNumberFormat = 'n'; tp = TitlePage(); tp.Title = 'New Report'; tp.Author = 'MathWorks'; add(rpt,tp); toc = TableOfContents(); toc.Layout.PageNumberFormat = 'i'; add(rpt,toc); ch = Chapter(); ch.Title = 'Introduction'; %ch.Layout.PageNumberFormat = 'n'; sec = Section('First Section of Chapter 1'); txt = ['This is the first section of chapter 1. ',... 'The page number format is Arabic numbers, ',... 'which is the default for the first chapter.']; add(sec,txt); add(ch,sec); add(rpt,ch); ch = Chapter(); ch.Title = '2nd chapter'; sec = Section('First Section of Chapter 2'); txt = ['This is the first section of chapter 2. ',... 'The page number format is Arabic numbers, ',... 'which is the format defined for the whole report.']; add(sec,txt); add(ch,sec); add(rpt,ch) ch = Chapter(); ch.Title = '3nd chapter'; sec = Section('First Section of Chapter 3'); txt = ['This is the first section of chapter 3. ',... 'The page number format is Arabic numerals, ',... 'which is the format defined for the whole report.']; add(sec,txt); add(ch,sec); add(rpt,ch) rptview(rpt);
mlreportgen.dom.PageNumber
| mlreportgen.report.Report
| mlreportgen.report.Reporter
| mlreportgen.report.ReporterLayout