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 or string scalar. The DOM generates a session-unique ID when it creates the document element. You can specify your own ID.

Tag for this document element, specified as a character vector or string scalar.

The DOM generates a session-unique tag as part of the creation of this object. The generated tag has the form CLASS:ID, where CLASS is the object class and ID is the value of the Id property of the object. Specifying your own tag value can help you to identify where an issue occurred during document generation.

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

collapse 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);