Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

mlreportgen.report.ReporterLayout class

Package: mlreportgen.report
Superclasses:

Layout for reporter

Description

Page layout options (watermark, first page number, and page number format) for the report.

Note

Reports create instances of this object that are assigned to the Reporter Layout properties. You do not need to create this object yourself.

Properties

expand all

Watermark image for this reporter, specified as a string or character array indicating the image path name. The specified watermark appears on all pages of the reporter. Valid image types:

  • .bmp

  • .jpg

  • .pdf (for PDF output types only)

  • .png

  • .svg

  • .tiff

Number to use on the first page of this reporter in a Work or PDF report, specified as a positive integer.

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 mlreportgen.dom.PageNumber for a list of valid page number formats.

Page orientation for this reporter, specified as a logical value. The default orientation is portrait. Set this property to true to use landscape orientation.

Examples

Set First Page Number for a Chapter

Add three chapters reporters to a report. The first chapter uses default values for first page number and page orientation. The second chapter uses 5 as the first page number and 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);

ch = Chapter();
ch.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(ch,sec);
add(rpt,ch); 

ch = Chapter(); 
ch.Title = '2nd chapter';
ch.Layout.FirstPageNumber = 1;
ch.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(ch,sec);
add(rpt,ch)

ch = Chapter(); 
ch.Title = '3rd chapter';
sec = Section('First Section of Chapter 2'); 
txt = ['This is the first section of chapter 2. ',...
      '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(ch,sec);
add(rpt,ch)

rptview(rpt);

Introduced in R2017b

Was this topic helpful?