Create a chapter reporter that adds a chapter to the report. This class inherits from
creates a reporter that
generates a chapter. The chapter has a new page layout defined by the default template
of the reporter.
ch = Chapter()
The default template is a portrait page with a header and a footer. The header is
empty. If a chapter is the first chapter of the report, the footer contains an
automatically generated page number that starts with 1. If it is not the first chapter,
the page numbering continues from the last page of the previous chapter. Use the
Layout property to override some of the page layout features of
the chapter, such as its orientation.
To add content to the chapter, use the
Before you add a chapter to a report, add all the content that you want into
that chapter. Once you add that chapter to a report
add(report,chapter)), you cannot add more content to
creates a report chapter containing a chapter title with the specified title text.
ch = Chapter(
sets properties using name-value pairs. You can specify multiple name-value pair
arguments in any order. Enclose each property name in single quotes.
ch = Chapter(
title— Chapter title
Chapter title, specified as a string or character array. The title appears at the beginning of the chapter and in the header of all chapter pages except the first page. The title also appears in the table of contents of the report. The title is numbered by default.
To turn off numbering for this chapter, use the
Numbered property of the chapter. To turn off
numbering for this and all other chapters in the report, use the
If numbered, the title is prefixed in English reports by a string in
the form Chapter N., where
N is the automatically
generated chapter number. In some other locales, the English prefix is
translated to the language of the locale. See the
Locale property of
mlreportgen.report.Report for a list of translated
A chapter reporter is a type of section reporter and inherits its properties. The
Layout property is the only property that is not inherited from
Layout— Layout of this chapter
Layout of this chapter, specified as an
mlreportgen.report.ReporterLayout object. Use
Layout to override some of the chapter layout
properties, which are defined in the template for the chapter. First page
number and page orientation are examples of chapter layout properties. See
chapter.Layout.Landscape = true
A chapter reporter is a type of section reporter and inherits its methods. See
mlreportgen.report.Section for descriptions of the methods.
|add||Add section content|
|createTemplate||Create section template|
|customizeReporter||Create custom section reporter class|
|getClassFolder||Section class definition file location|
|getTitleReporter||Get section title reporter|
|number||Set section numbering|
|customizeReporter||Create class derived from Reporter class|
|getImpl||Get implementation of reporter|
Handle. To learn how handle classes affect copy operations, see Copying Objects (MATLAB).
Add a chapter to the report. Set its layout orientation to landscape. Add a section to that chapter.
import mlreportgen.report.* import mlreportgen.dom.* rpt = Report('My Report','pdf'); add(rpt,TitlePage('Title','My Report')); chapter = Chapter('Images'); chapter.Layout.Landscape = true; add(chapter,Section('Title','Boeing 747', ... 'Content',Image(which('b747.jpg')))); add(rpt,chapter); close(rpt); rptview(rpt);