mlreportgen.report.ReportLayout class
Package: mlreportgen.report
Page layout of report
Description
Use an object of the mlreportgen.report.ReportLayout
class to specify
report page layout options, such as watermarks, first page numbering, page number
formatting, page size and orientation, and margins.
Note
A report creates an instance of this class and assigns it to the
mlreportgen.report.Report
Layout
property. You do not create the object yourself.
The mlreportgen.report.ReportLayout
class is a handle
class.
Properties
Watermark
— Watermark image
[]
(default) | string scalar | character vector
Watermark image for the report pages, specified as []
or a character vector or string scalar that contains the image path name.
The specified watermark appears on all pages of the report. An empty value,
[]
, indicates that no watermark is used. To use a
different watermark for an individual report section, such as a chapter, set
the Watermark
property of the mlreportgen.report.ReporterLayout
object used by the section
reporter. Valid image types are:
.bmp
.jpg
.pdf
(for PDF output types only).png
.svg
.tiff
FirstPageNumber
— Number to use on first page
[]
(default) | positive integer
Number to use on the first page of each section in the report, specified
as []
or a positive integer. For example, if you set the
first page number for the report to 4, the first page number for every
report chapter is 4. To use a different first page number for an individual
section, set the FirstPageNumber
property of the
mlreportgen.report.ReporterLayout
object used by the section
reporter. The default numbering for the report is []
,
which indicates that the first page of chapter 1 is page 1. All subsequent
pages in the report are numbered sequentially.
PageNumberFormat
— Type of page numbering
[]
(default) | string scalar | character vector
Type of page numbering to use for the report, specified as a string scalar
or character vector. The specified page number format appears on all pages
of the report. To use a different page number format for an individual
section, such as a chapter, set the PageNumberFormat
property of the mlreportgen.report.ReporterLayout
object used by the section
reporter. See the Format
property in mlreportgen.dom.PageNumber
for a list of valid page number formats.
Landscape
— Page orientation
[]
(default) | false
| true
Page orientation for the report, specified as true
or
false
. Set this property to true
to change portrait orientation to landscape orientation and
false
to change landscape orientation to portrait
orientation. If the value is []
, the orientation is
determined by the page size specified by the report layout.
PageSize
— Size of Pages
[]
(default) | mlreportgen.dom.PageSize
object
Size of pages in the report, specified as an mlreportgen.dom.PageSize
object.
PageMargins
— Sizes of page margins, header, footer, and gutter
[]
(default) | mlreportgen.dom.PageMargins
object
Sizes of page margins, header, footer, and gutter in the report, specified
as an mlreportgen.dom.PageMargins
object.
PageBorder
— Page borders
[]
(default) | mlreportgen.dom.PageBorder
object
Page borders, specified as an mlreportgen.dom.PageBorder
object.
Examples
Set First Page Number for Entire Report
Set the page number format for the whole report to Arabic numbers and the page number for the table of contents to Roman numerals. The chapters use the Arabic number format, which is the default format for the whole report. 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'; append(rpt,tp); toc = TableOfContents(); toc.Layout.PageNumberFormat = 'i'; append(rpt,toc); ch = Chapter(); ch.Title = 'Introduction'; 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 report.']; append(sec,txt); append(ch,sec); append(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 report.']; append(sec,txt); append(ch,sec); append(rpt,ch); close(rpt); rptview(rpt);
Version History
Introduced in R2017b
Open Example
You have a modified version of this example. Do you want to open this example with your edits?
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)