mlreportgen.report.ReportLayout Class
Namespace: 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) | character vector | string scalar
Watermark image, specified as []
or as a character vector or string scalar
that contains the image path name. The watermark appears on all pages of the report
section. If the Watermark
property is []
, the
watermark for the section is the same as the watermark for the report. If the
Watermark
property of the layout objects for the report section
and the report are []
, no watermark appears.
Valid image types are:
.emf
.gif
.jpg
.pdf
.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.
Data Types: double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
PageNumberFormat
— Type of page numbering
[]
(default) | character vector | string scalar
Type of page numbering to use for the report, specified as a character
vector or string scalar. 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.
Data Types: char
| string
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.
Data Types: logical
PageSize
— Size of pages in layout
mlreportgen.dom.PageSize
object
Size of pages in layout, specified as an mlreportgen.dom.PageSize
object.
Attributes:
NonCopyable | true |
PageMargins
— Sizes of margins, header, footer, and gutter
mlreportgen.dom.PageMargins
object
Sizes of the margins, header, footer, and gutter for this page
layout, specified as an mlreportgen.dom.PageMargins
object.
Attributes:
NonCopyable | true |
PageBorder
— Page borders for layout
[]
(default) | mlreportgen.dom.PageBorder
object
Page borders for layout, specified as an mlreportgen.dom.PageBorder
object.
Attributes:
NonCopyable | true |
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 R2017bR2024b: Removal of BMP for image output
Report Generator no longer supports BMP (bitmap) as an output image format. This affects
snapshots, images from files, and watermarks in both the Report Explorer and the Report,
DOM, and PPT APIs. See print
for more information.
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)