Layout for reporter
Page layout options (watermark, first page number, and page number format) for the report.
Reports create instances of this object that are assigned to the Reporter Layout properties. You do not need to create this object yourself.
Watermark— Watermark image
(default) | string | character array
Watermark image for this reporter, specified as a string, character array,
. A string or character array indicates the image
path name. The specified watermark appears on all pages of the reporter. An
, indicates that no watermark is included. Valid
FirstPageNumber— First page number
Number to use on the first page of this reporter in a Word or PDF report,
specified as an integer or
. To continue page numbering
from the previous layout, enter
. To specify the first page number, enter a
The default for Chapter page numbering is that the first page of the first chapter is 1.
PageNumberFormat— Type of page numbering
Type of page numbering to use for this reporter in a Word or PDF report,
specified as a string or character array. See the
format property in
for a list of valid page number formats.
Landscape— Page orientation for reporter
Page orientation for this reporter, specified as a logical value. The
default orientation is portrait. Set this property to
true to use landscape orientation.
Add three chapters reporters to a report. The first chapter uses default values for first page number and page orientation. The second chapter resets the first page number to 1 and uses landscape page orientation. Neither first page number nor page orientation is set in the third chapter. It uses the default first page number, which continues from the previous chapter, and default page orientation.
import mlreportgen.report.* rpt = Report('newreport'); tp = TitlePage(); tp.Title = 'New Report'; tp.Author = 'MathWorks'; add(rpt,tp) ch1 = Chapter(); ch1.Title = 'First Chapter'; sec = Section('First Section of Chapter 1'); txt = ['This is the first section of chapter 1. ',... 'The first page number for this ',... 'chapter is 1, which is the default. ',... 'The page orientation is also the default.']; add(sec,txt) add(ch1,sec) add(rpt,ch1) ch2 = Chapter(); ch2.Title = '2nd chapter'; ch2.Layout.FirstPageNumber = 1; ch2.Layout.Landscape = true; sec = Section('First Section of Chapter 2'); txt = ['This is the first section of chapter 2. ',... 'The first page number is set to 1 and the ',... 'page orientation is set to landscape.']; add(sec,txt) add(ch2,sec) add(rpt,ch2) ch3 = Chapter(); ch3.Title = '3rd chapter'; sec = Section('First Section of Chapter 3'); txt = ['This is the first section of chapter 3. ',... 'Neither first page number nor page ',... 'orientation is set for this chapter. ',... 'The first page number uses the default, ',... 'which continues from the previous page. ',... 'The page orientation also uses the default, ',... 'which is portrait.']; add(sec,txt) add(ch3,sec) add(rpt,ch3) rptview(rpt)