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.dom.RepeatAsHeaderRow class

Package: mlreportgen.dom
Superclasses:

Repeat table row

Description

Specifies to repeat a table row on each new page when a table flows across multiple pages. This format applies only to Microsoft® Word documents.

Construction

repeatAsHeaderRowObj = RepeatAsHeaderRow() repeats table row on each new page when a table flows across multiple pages.

repeatAsHeaderRowObj = RepeatAsHeaderRow(onOff) repeats table row on each new page if onOff is true.

Input Arguments

expand all

Specify one of the following logical values:

  • true or 1 — Table row repeats on each new page when a table flows across multiple pages.

  • false or 0 — Table row does not repeat on each new page when a table flows across multiple pages.

Data Types: logical

Output Arguments

expand all

Repeat table row, represented by an mlreportgen.dom.RepeatAsHeaderRow object.

Properties

expand all

ID for this document element, specified as a character vector. The DOM generates a session-unique ID when it creates the document element. You can specify your own ID.

Tag for document element, specified as a character vector.

A session-unique ID is generated as part of document element creation. The generated tag has the form CLASS:ID, where CLASS is the class of the element and ID is the value of the Id property of the object. You can specify a tag to replace the generated tag.

For example, to make it easier to identify where an issue occurred during document generation, you can specify your own tag value.

Possible logical values are:

  • true or 1 — Table row repeats on each new page when a table flows across multiple pages.

  • false or 0 — Table row does not repeat on each new page when a table flows across multiple pages.

Data Types: logical

Examples

expand all

Create a table with nor repeating row.

import mlreportgen.dom.*;
doctype = 'docx';
d = Document('repeatHeader',doctype);
     
append(d,'Table 1');
table = Table(ones(15, 2));
table.Style = {Border('solid'),RowSep('solid')};
append(d,table);

Create a second table with repeated row with a table row that cannot break across pages.

append(d,'Table 2');
table = Table(ones(15,2));
table.entry(1,1).Children(1).Content = 'Header A';
table.entry(1,2).Children(1).Content = 'Header B';
table.row(1).Style = {RepeatAsHeaderRow(true)};
table.Style = {Border('solid'),RowSep('solid')};
append(d, table);
table.row(6).Style = {AllowBreakAcrossPages(false)};
table.entry(6,1).Children(1).Content = ...
     'Start this row on new page if it does not fit on current page';
for i=2:10
     table.entry(6,1).append(Paragraph(Text(i)));
end
     
close(d);
rptview(d.OutputPath,doctype);

Generate the report.

close(d);
rptview(d.OutputPath,doctype);
Was this topic helpful?