-
MATLAB® Report Generator™ User's Guide R2015a
-
How to Contact MathWorks Latest news: www.mathworks.com Sales and services: www.mathworks.com/sales_and_services User community: www.mathworks.com/matlabcentral Technical support: www.mathworks.com/support/contact_us Phone: 508-647-7000 The MathWorks, Inc. 3 Apple Hill Drive Natick, MA 01760-2098 MATLAB® Report Generator™ User's Guide © COPYRIGHT 1999–2015 by The MathWorks, Inc. The software described in this document is furnished under a license agreement.
-
Revision History January 1999 December 2000 June 2004 August 2004 October 2004 December 2004 April 2005 September 2005 March 2006 September 2006 March 2007 September 2007 First printing Second printing Third printing Online only Online only Online only Online only Online only Online only Online only Fourth printing Fifth printing March 2008 October 2008 October 2008 March 2009 September 2009 March 2010 September 2010 April 2011 September 2011 March 2012 September 2012 March 2013 September 2013 March 2014
-
-
Contents 1 2 Getting Started MATLAB Report Generator Product Description . . . . . . . . . Key Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2 1-2 MATLAB Code and Results Presentation . . . . . . . . . . . . . . . . 1-3 Report Creation Workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . Approaches for Creating Reports . . . . . . . . . . . . . . . . . . . . . . Interactive Report Generation . . . . . . . . . . . . . . . . . . . . . . . .
-
3 vi Contents Add Report Content Using Components . . . . . . . . . . . . . . . . . Report Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Specify Report Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . Create a Title Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Add a Chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Add Introductory Text to the First Chapter . . . . . . . . . . . . . Add an Image . . . . . .
-
Save a Report Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Save a Setup Under Its Existing Name . . . . . . . . . . . . . . . . . Save a Setup Under a New Name . . . . . . . . . . . . . . . . . . . . . 4 3-9 3-9 3-9 Load Report Setup into MATLAB Workspace . . . . . . . . . . . 3-10 Insert Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Point-and-Click Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . Drag-and-Drop Method . . . . . . .
-
Report Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 viii Contents 4-12 Report Generation Preferences . . . . . . . . . . . . . . . . . . . . . . . Report Generator Preferences Pane . . . . . . . . . . . . . . . . . . . File Format and Extension . . . . . . . . . . . . . . . . . . . . . . . . . Image Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Report Viewing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
-
6 Display Property Name/Property Value Pairs . . . . . . . . . . . . Edit Table Titles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Enter Text into Table Cells . . . . . . . . . . . . . . . . . . . . . . . . . Add, Replace, and Delete Properties in Tables . . . . . . . . . . Format Table Columns, Rows, and Cells . . . . . . . . . . . . . . . Zoom and Scroll . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Select a Table . . . . . . . . . . . . . . . . . . . . . . . . .
-
Header and Footers in Word Conversion Templates . . . . . . x Contents 6-10 Copy a Conversion Template . . . . . . . . . . . . . . . . . . . . . . . . . Copy a Conversion Template . . . . . . . . . . . . . . . . . . . . . . . . 6-12 6-12 Open a Conversion Template . . . . . . . . . . . . . . . . . . . . . . . . . 6-14 Set Conversion Template Properties . . . . . . . . . . . . . . . . . . 6-15 Move a Conversion Template . . . . . . . . . . . . . . . . . . . . . . . . .
-
7 8 Create Custom Components About Custom Components . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2 Create Custom Components . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-3 Define Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Required Component Data . . . . . . . . . . . . . . . . . . . . . . . . . . Specify the Location of Component Files . . . . . . . . . . . . . . . . Set Component Display Options . . . . . . . . . . . . . . . . . . . . . .
-
9 Edit, Save, or Delete a Stylesheet . . . . . . . . . . . . . . . . . . . . . . Edit a Stylesheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Save a Stylesheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Delete a Stylesheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-5 8-5 8-7 8-8 Edit Stylesheet Data Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . Data Item Categories in Built-In Stylesheets . . . . . . . . . . . .
-
10 11 12 13 How to Compare XML Files . . . . . . . . . . . . . . . . . . . . . . . . . . . Select Files to Compare . . . . . . . . . . . . . . . . . . . . . . . . . . . . Change Comparison Type . . . . . . . . . . . . . . . . . . . . . . . . . . . XML Comparison Examples . . . . . . . . . . . . . . . . . . . . . . . . . See Also . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-4 9-4 9-5 9-5 9-5 Explore the XML Comparison Report . . . . . . . . . . . . . . . . . . .
-
xiv Contents Document Object Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DOM Object Help and Documentation . . . . . . . . . . . . . . . . 13-4 13-4 Construct a DOM Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-6 Import the DOM API Package . . . . . . . . . . . . . . . . . . . . . . . . 13-7 Get and Set DOM Object Properties . . . . . . . . . . . . . . . . . . . 13-8 Create a Document Object to Hold Content . . . . . . . . . . . . .
-
Use Subforms in a Report . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-31 Create Document Part Template Libraries . . . . . . . . . . . . 13-33 Create a Document Part Template Library in a Microsoft Word Template File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-33 Create a Document Part Template Library in an HTML Template File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-35 Object-Oriented Report Creation . . . . . . . . . . . . . . . . . . . .
-
xvi Contents Create a Link Target . . . . . . . . . . . . . . . . . . . . . . . . . . . . Create an External Link . . . . . . . . . . . . . . . . . . . . . . . . . . Create an Internal Link . . . . . . . . . . . . . . . . . . . . . . . . . . Add Text or Images to Links . . . . . . . . . . . . . . . . . . . . . . . 13-73 13-74 13-74 13-74 Create and Format Images . . . . . . . . . . . . . . . . . . . . . . . . . . Create an Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
-
Support for HTML Character Entities . . . . . . . . . . . . . . . 13-104 Display Report Generation Messages . . . . . . . . . . . . . . . . Report Generation Messages . . . . . . . . . . . . . . . . . . . . . . Display DOM Default Messages . . . . . . . . . . . . . . . . . . . Create and Display a Progress Message . . . . . . . . . . . . . 13-106 13-106 13-106 13-107 Compile a Report Program . . . . . . . . . . . . . . . . . . . . . . . . . 13-110 Create a Microsoft Word Template . . . . . . . . . . .
-
-
1 Getting Started • “MATLAB Report Generator Product Description” on page 1-2 • “MATLAB Code and Results Presentation” on page 1-3 • “Report Creation Workflow” on page 1-4 • “How MATLAB Report Generator and MATLAB Software Interact” on page 1-6 • “Report Components” on page 1-7 • “Report Explorer” on page 1-8 • “Supported Report Formats” on page 1-11
-
1 Getting Started MATLAB Report Generator Product Description Design and generate reports from MATLAB applications MATLAB Report Generator lets you create richly formatted Microsoft® Word, HTML, or PDF reports that present results from your MATLAB programs and applications. You can use the prebuilt, customizable Word and HTML templates to lay out and format reports. You can also design and create reports based on your organization’s templates and standards.
-
MATLAB Code and Results Presentation MATLAB Code and Results Presentation You can use the MATLAB Report Generator to create reports for sharing your MATLAB code and presenting the results of the code. In addition, MATLAB provides several methods for presenting MATLAB code and results, including: • MATLAB publish command • MATLAB notebook command MATLAB enables you to publish your MATLAB code quickly, so that you can describe and share your code with others, even if they do not have MATLAB software.
-
1 Getting Started Report Creation Workflow Approaches for Creating Reports You can create and generate reports : • Interactively, using the Report Explorer • Programmatically, using the DOM (Document Object Model) API You can use the Report Explorer graphical interface to create reports without having to write code. Using the programmatic approach, you can integrate report generation into analysis and testing applications. For more information, see “Programmatic Report Creation”.
-
Report Creation Workflow Report Generator Generate M-code Open Report Explorer (GUI) Create setup file Add components Apply stylesheet Generate report To practice using this report creation workflow, see “Working with Components”.
-
1 Getting Started How MATLAB Report Generator and MATLAB Software Interact The MATLAB Report Generator and MATLAB software interact to create reports. You can access the Report Explorer from the MATLAB command line. The following table summarizes these interactions. User Interface MATLAB Report Generator Interaction Description Report Explorer The Report Explorer provides a graphical interface. For more information, see “Report Explorer” on page 1-8.
-
Report Components Report Components Types of Report Components Components are MATLAB objects that specify the content of a report. The MATLAB Report Generator provides a set of components for specifying the types of content that commonly occur in MATLAB-based reports. The Simulink® Report Generator provides additional components to facilitate generation of reports from Simulink models. You can also create custom components to handle content specific to your application.
-
1 Getting Started Report Explorer About the Report Explorer Use the Report Explorer to: • Create and modify report setup files. • Apply stylesheets to format the generated report. • Specify the report file format. • Generate reports. Open the Report Explorer using one of these approaches: • From the MATLAB Toolstrip, in the Apps tab, in the Database Connectivity and Reporting section, click Report Generator. • In the MATLAB Command Window, enter report.
-
Report Explorer Library pane The Report Explorer has three panes: • The Outline pane on the left shows the hierarchy of components in currently opened report setup files. Report components can reside within other report components, creating parent, child, and sibling relationships. • The Library pane in the middle lists the objects available in the context of the Outline pane.
-
1 Getting Started Outline Pane Context Library Pane Contents No report setup file is open. Reports Report setup file is open. Components Stylesheet is open. Stylesheet attributes • The Properties pane contents depend on the Outline pane context. If no report setup file is open, on the right displays tasks the Report Explorer can perform. If a report setup file is open, the Properties pane displays the properties for the item that is currently selected in the Options pane.
-
Supported Report Formats Supported Report Formats When the report-generation process first creates a report, it generates a DocBook XML source file. You can customize this XML as needed. For more information on how to customize DocBook XML, see the OASIS™ DocBook TC Web page at http:// www.oasis-open.org/committees/docbook and the online version of DocBook: The Definitive Guide by Norman Walsh and Leonard Muellner, with contributions from Bob Stayton at http://www.docbook.org/tdg/en/html/docbook.html.
-
-
2 Create Your First Report • “Create a MATLAB Report” on page 2-2 • “Create a Report Setup File” on page 2-3 • “Add Report Content Using Components” on page 2-5 • “Generate a Report” on page 2-39
-
2 Create Your First Report Create a MATLAB Report This example shows how to create a report that explains and illustrates magic squares – matrices whose columns, rows, and diagonals each add up to the same number (see the magic function reference in the MATLAB documentation). To create this report, you perform these main tasks: • “Create a Report Setup File” on page 2-3 • “Add Report Content Using Components” on page 2-5 Note: You do not need to know the MATLAB software to use this example.
-
Create a Report Setup File Create a Report Setup File To set up the magic squares report, first create a setup file to store the setup. Then add MATLAB objects, called components, to the setup to specify the report content. To create the report setup file: 1 Start a MATLAB software session. 2 Open the Report Explorer. From the MATLAB Toolstrip, in the Apps tab, in the Database Connectivity and Reporting section, click Report Generator. 3 Select File > New to create a report setup file.
-
2 Create Your First Report The new file name appears in the Outline pane. To create the content for the report, see “Add Report Content Using Components” on page 2-5.
-
Add Report Content Using Components Add Report Content Using Components In this section...
-
2 Create Your First Report Title Page component Chapter component Text component Text component Figure Snapshot component 2-6
-
Add Report Content Using Components Specify Report Variables The magic squares report uses variables defined in the MATLAB workspace to specify the number and sizes of squares to display and whether to display the variables as tables of numbers or images of color-coded squares: • The magicSizeVector variable specifies an array of magic square sizes • largestDisplayedArray variable specifies the size of the largest magic square to be displayed as an array of numbers You could require that a user create thes
-
2 Create Your First Report The icon in the upper left corner of the Eval component indicates that this component cannot have child components. By default, any components you add with the Eval component selected are siblings to this component. The options for the Evaluate MATLAB Expression component appear in the Properties pane. 4 To exclude the MATLAB code details and its output in this report, clear the Insert MATLAB expression in report and Display command window output in report check boxes.
-
Add Report Content Using Components %This MATLAB code sets up two variables %that define how the report runs. %magicSizeVector is a list of MxM %Magic Square sizes to insert into %the report. Note that magic %squares cannot be 2x2. magicSizeVector=[4 8 16 32]; %largestDisplayedArray sets the %limit of array size that will be %inserted into the report with the %Insert Variable component.
-
2 Create Your First Report 1 In the Outline pane on the left, select the Eval component. 2 In the Options pane in the middle, under the Formatting category, double-click Title Page to add the component to the report. Because the Eval component icon indicates that this component cannot have children, the Title Page component is a sibling of the Eval component. Likewise, the Title Page component also cannot have child components.
-
Add Report Content Using Components a In the Title text box, enter Magic Squares. b In the Subtitle text box, enter Columns, Rows, Diagonals: Everyone is Equal. c Under Options, choose Custom author from the selection list. d In the field to the right of the Custom author field, enter Albrecht Durer. Albrecht Dürer created an etching that contains a magic square. Your final report includes an image of that etching. 4 e Select the Include copyright holder and year check box.
-
2 Create Your First Report The pane should look as follows: 5 Save the report. Add a Chapter Note: This section builds on the previous tasks described in the step-by-step example summarized in “Create a MATLAB Report” on page 2-2.
-
Add Report Content Using Components If you have not completed the previous sections of this example, see open the completed report setup file: Magic Squares Report. Add a chapter to the report by using the Chapter/Subsection component. 1 In the Outline pane on the left, select the Title Page component. 2 In the Library pane in the middle, under the Formatting category, double-click Chapter/Subsection. The Outline pane looks as follows.
-
2 Create Your First Report Add Introductory Text to the First Chapter Note: This section builds on the previous tasks described in the step-by-step example summarized in “Create a MATLAB Report” on page 2-2. If you have not completed the previous sections of this example, see open the completed report setup file: Magic Squares Report. Include introductory text in the first chapter by adding the Paragraph and Text components. 1 In the Outline pane on the left, select the Chapter component.
-
Add Report Content Using Components 3 By default, the Paragraph component inherits its text from its child components. Add two Text components. Note: The Text component must have the Paragraph component as its parent. 4 In the Library pane, under the Formatting category, double-click Text. 5 Double-click Text again to add a second component. The Outline pane looks as follows. 6 In the Outline pane, select the first Text component.
-
2 Create Your First Report square (shown in the upper right portion of the image) could aid in the cure of melancholy. The engraving's date (1514) can be found in the lower row of numbers in the square. 10 Save the report. The contents of the first chapter are now complete. Add an Image Note: This section builds on the previous tasks described in the step-by-step example summarized in “Create a MATLAB Report” on page 2-2.
-
Add Report Content Using Components 4 With the Eval component still selected, do the following in the Properties pane on the right: a Clear the Insert MATLAB expression in report and Display command window output in report check boxes. You do not want to include the code or its output in the report. b In the Expression to evaluate in the base workspace text box, replace the existing text with the following MATLAB code. Tip Copy and paste this text from the HTML documentation into the Report Explorer.
-
2 Create Your First Report This MATLAB code displays the Dürer etching in a MATLAB figure window. c In the Evaluate expression if there is an error text box, replace the existing text with the following text: disp(['Error during eval: ', evalException.message]) This code executes if an error occurs while loading the Dürer etching. The Properties pane on the right looks as follows.
-
Add Report Content Using Components 5 In the Outline pane on the left, select the Eval component. 6 In the Library pane in the middle, under the Handle Graphics category, doubleclick Figure Snapshot.
-
2 Create Your First Report To inline an image component (such as Image or Figure Snapshot), include it within a Paragraph component. 7 In the Properties pane: a In the Paper orientation list, select Portrait. b In the Invert hardcopy list, select Don't invert. Selecting this option specifies not to change the image's on-screen colors for printing.
-
Add Report Content Using Components The next three steps set up the report to delete the image from the MATLAB workspace after the image has been added to the report. 8 In the Outline pane, select the Figure Snapshot component. 9 In the Library pane, under the MATLAB category, double-click Evaluate MATLAB Expression. 10 In the Properties pane: a Clear the Insert MATLAB expression in report and Display command window output in report check boxes.
-
2 Create Your First Report • “Create the Magic Square” on page 2-29 • “Add Display Logic” on page 2-32 • “Display the Magic Square” on page 2-34 Create a For Loop Note: This section builds on the previous tasks described in the step-by-step example summarized in “Create a MATLAB Report” on page 2-2. If you have not completed the previous sections of this example, see open the completed report setup file: Magic Squares Report. 1 In the Outline pane on the left, select the Chapter component.
-
Add Report Content Using Components This For Loop component appears inside the Chapter component. However, the magic squares should be processed after the first chapter, so the for component should be a sibling of the Chapter component, not a child. 3 In the Outline pane, select the for component. 4 Click the left arrow to make the for component a sibling, not a child, of the Chapter component.
-
2 Create Your First Report a In the End text box, replace the existing text with the following text: length(magicSizeVector) This is the length of the vector that contains the various sizes for the magic square matrices. b In the Variable name text box, replace the existing text with the following text: MAGIC_SQUARE_INDEX This variable acts as a loop index. The Outline pane looks as follows. 6 Save the report.
-
Add Report Content Using Components Next create a chapter for each square by adding a Chapter component to the report as a child of the For Loop component. This causes the Report Generator to create a chapter on each iteration of the For Loop during report generation. 1 In the Outline pane on the left, select the for component. 2 In the Library pane in the middle, under the Formatting category, double-click Chapter/Subsection. It becomes a child of the for component.
-
2 Create Your First Report 4 Save the report. Determine the Matrix Size Note: This section builds on the previous tasks described in the step-by-step example summarized in “Create a MATLAB Report” on page 2-2. If you have not completed the previous sections of this example, see open the completed report setup file: Magic Squares Report.
-
Add Report Content Using Components Extract the size of each magic square matrix from magicSizeVector using an Evaluate MATLAB Expression component. 1 In the Outline pane on the left, select the bottom Chapter component. 2 In the Library pane in the middle, under the MATLAB category, double-click Evaluate MATLAB Expression. 3 In the Properties pane on the right: a Clear the Insert MATLAB expression in report and Display command window output in report check boxes.
-
2 Create Your First Report 4 Save the report. Insert the Magic Square Size into the Report Note: This section builds on the previous tasks described in the step-by-step example summarized in “Create a MATLAB Report” on page 2-2. If you have not completed the previous sections of this example, see open the completed report setup file: Magic Squares Report. Insert the size of the magic square into the report using the Paragraph and Insert Variable components.
-
Add Report Content Using Components 4 In the Library pane, under the MATLAB category, double-click Insert Variable. 5 In the Properties pane on the right: a In the Variable name text box, enter magic_Square_Size. b In the Display as list, select Inline text. The Outline pane looks as follows. 6 Save the report. Create the Magic Square Note: This section builds on the previous tasks described in the step-by-step example summarized in “Create a MATLAB Report” on page 2-2.
-
2 Create Your First Report To create the magic square and display the associated matrix or image, use the Evaluate MATLAB Expression component. 1 In the Outline pane on the left, select the bottom Paragraph component. 2 In the Library pane in the middle, under the MATLAB category, double-click Evaluate MATLAB Expression. Make this component a sibling of the Paragraph component, not a child, as described in the next two steps. 3 In the Outline pane, select the Eval component.
-
Add Report Content Using Components c In the Evaluate expression if there is an error text box, replace the existing text with the following: disp(['Error during eval: ', evalException.message]) This code executes if an error occurs while creating and displaying the magic square. The Properties pane looks as follows. 6 Save the report.
-
2 Create Your First Report Add Display Logic Note: This section builds on the previous tasks described in the step-by-step example summarized in “Create a MATLAB Report” on page 2-2. If you have not completed the previous sections of this example, see open the completed report setup file: Magic Squares Report. Use Logical If, Logical Then, and Logical Else components to determine whether to display the magic square as an array of numbers or as an image.
-
Add Report Content Using Components magic_Square_Size<=largestDisplayedArray This command tests whether the current matrix size (magic_Square_Size) is less than or equal to the value assigned in the first Eval component of the report (largestDisplayedArray=15). To process the result of this Logical If component, create two child components —Logical Then and Logical Else. If magic_Square_Size is less than or equal to 15, the matrix variable appears in the report.
-
2 Create Your First Report 7 On the Library pane, under Logical and Flow Control, double-click Logical Then. The then component appears above the else component. 8 Save the report. Display the Magic Square Note: This section builds on the step-by-step example presented in “Create a MATLAB Report” on page 2-2. To see the completed report setup file, open Magic Squares Report. 1 2-34 In the Outline pane on the left, select the then component.
-
Add Report Content Using Components 2 In the Library pane in the middle, under the MATLAB category, double-click Insert Variable. 3 In the Properties pane on the right: a In the Variable name text box, enter mySquare, which is the variable that contains the magic square of the specified size. b In the Title list, select None. c In the Array size limit text box, enter 0. The Properties pane on the right looks as follows.
-
2 Create Your First Report 7 In the Library pane, under the Handle Graphics category, double-click Figure Snapshot. 8 In the Properties pane: a In the Paper orientation list, select Portrait. b In the Image size list, select Custom. c Under the Image size list, enter [5 4] for the custom image size. d In the Invert hardcopy list, select Invert. This option changes dark axes colors to light axes colors, and vice versa. The Properties pane on the right looks as follows.
-
Add Report Content Using Components The Outline pane looks like the following.
-
2 Create Your First Report 9 2-38 Save the report.
-
Generate a Report Generate a Report Note: This section builds on the step-by-step example presented in “Create a MATLAB Report” on page 2-2. To see the completed report setup file, open Magic Squares Report. Now the report contains all the components it needs. On the toolbar, click the Report icon to generate the report. The following dialog box appears. 1 A Message List window appears, displaying informational and error messages as the report processes.
-
2 Create Your First Report 2 An image of the etching appears briefly. 3 Images of two magic square images of sizes 16 and 32 appear briefly. 4 In the Outline pane on the left of your Report Explorer window, each component of the report setup file is highlighted as it is executed. At the beginning of this example you specified HTML as the output format of this report. When processing finishes, the MATLAB Web browser opens and displays the report's HTML file.
-
Generate a Report 2-41
-
-
3 Set Up a Report • “Report Setups” on page 3-2 • “Create a New Setup File” on page 3-4 • “Open a Report Setup” on page 3-6 • “Close a Report Setup” on page 3-8 • “Save a Report Setup” on page 3-9 • “Load Report Setup into MATLAB Workspace” on page 3-10 • “Insert Components” on page 3-11 • “Set Component Properties” on page 3-12 • “Move Components” on page 3-13 • “Delete Components” on page 3-15 • “Deactivate Components” on page 3-16 • “Send Components to the MATLAB Workspace” on page 3-17
-
3 Set Up a Report Report Setups In this section... “Setup Hierarchy” on page 3-2 “Setup Files” on page 3-2 “Create a Report Setup” on page 3-3 A report setup is a set of MATLAB objects, called components, that specifies the content and form of a report. The MATLAB Report Generator provides a setup editor, called the Report Explorer, that you use to create and edit report setups. Once you create a setup, you can generate a report from it, using the Report Explorer or MATLAB commands.
-
Report Setups .rpt. For example, the name of the setup file for a setup named myreport would be myreport.rpt. Create a Report Setup To create a report setup: • Create a new setup file. • Insert components to define the content and format of the report. • Set component properties. • Save the setup. Once you create a template, you can execute it to generate an instance of the type of report that it defines.
-
3 Set Up a Report Create a New Setup File In this section... “Create Setup File Using the Report Explorer” on page 3-4 “Create Setup File Programmatically” on page 3-4 “Working with Setup Files” on page 3-4 Create a new setup file either interactively from the Report Explorer or programmatically. Create Setup File Using the Report Explorer 1 If the Report Explorer is not already open, from the MATLAB Toolstrip, in the Apps tab, in the Database Connectivity and Reporting section, click Report Generator.
-
Create a New Setup File • “Save a Report Setup” on page 3-9 3-5
-
3 Set Up a Report Open a Report Setup In this section... “Opening a Setup on the MATLAB Path” on page 3-6 “Opening a Setup Not on the MATLAB Path” on page 3-7 “Opening a Setup Programmatically” on page 3-7 To make changes to a saved report setup, you must open its setup file. Open a report setup either interactively from the Report Explorer or programmatically. Opening a Setup on the MATLAB Path Tip Use the setedit command to obtain a list of all the report setups on the MATLAB path.
-
Open a Report Setup Opening a Setup Not on the MATLAB Path Tip Use the setedit command to obtain a list of all the report setups on the MATLAB path. To open a setup that resides off the MATLAB path: 1 If the Report Explorer is not already open, from the MATLAB Toolstrip, in the Apps tab, in the Database Connectivity and Reporting section, click Report Generator.. 2 In the Report Explorer, select File > Open or select the file open button on the Report Explorer toolbar. A file browser opens.
-
3 Set Up a Report Close a Report Setup In this section... “Close a Setup Using the Report Explorer” on page 3-8 “Close a Setup Programmatically” on page 3-8 Closing a setup removes the setup from the Report Explorer and from memory. Close a Setup Using the Report Explorer 1 In the Report Explorer, in the Outline pane, select the setup root node. 2 In Report Explorer, use one of these approaches: • Click the Delete button. • Select File > Close.
-
Save a Report Setup Save a Report Setup In this section... “Save a Setup Under Its Existing Name” on page 3-9 “Save a Setup Under a New Name” on page 3-9 Save a Setup Under Its Existing Name 1 In the Report Explorer, in the Outline pane, select the setup root node. 2 In Report Explorer, use one of these approaches: • Click the Save button. • Select File > Save. • From the context menu of the root node of the setup file, select Save.
-
3 Set Up a Report Load Report Setup into MATLAB Workspace To load a setup into the MATLAB workspace without loading it into the Report Explorer, use the rptgen.loadRpt function. You can then modify the setup programmatically. For example, the following code loads a setup into memory, sets its output type to PDF, and generates a report. setupRoot = rptgen.loadRpt('simple-report'); setupRoot.Format = 'pdf-fop'; setupRoot.
-
Insert Components Insert Components In this section... “Point-and-Click Method” on page 3-11 “Drag-and-Drop Method” on page 3-11 “Fix Context Violations” on page 3-11 Point-and-Click Method 1 In the Report Explorer, in the Outline pane, select the parent node of the component to be inserted. For example, if you are inserting a paragraph into a section, select the section that will contain the paragraph. 2 In the Library pane, select the type of component that you want to insert in the report setup.
-
3 Set Up a Report Set Component Properties In this section... “Edit Component Property Values” on page 3-12 “Computed Property Values” on page 3-12 Edit Component Property Values Most components have properties that you can set to select optional features. For example, the Text component lets you specify the color of the text that it generates among other properties. To set component properties: 1 In the Report Explorer, in the Outline pane, select the component.
-
Move Components Move Components In this section... “Point-and-Click Method” on page 3-13 “Drag-and-Drop Method” on page 3-14 Point-and-Click Method 1 In the Report Explorer, in the Outline pane, select the component that you want to move. 2 Reposition the component in the setup hierarchy, using one of these approaches: • On the Report Explorer toolbar, use the move buttons. • From the Edit menu, use the move commands. • From the context menu of the component, use the move commands.
-
3 Set Up a Report Move Command or Button Effect Move Right Moves a component down one level in the hierarchy. The component becomes the child of the sibling that formerly preceded it in the hierarchy. Drag-and-Drop Method 3-14 1 In the Report Explorer, in the Outline pane, select the component that you want to move. 2 Drag the component and drop it on the component that you want to be its parent.
-
Delete Components Delete Components 1 In the Report Explorer, in the Outline pane, select the component that you want to delete. 2 Delete the component, using one of these approaches: • On the Report Explorer toolbar, click the Delete button. • Select Edit > Delete. • From the context menu of the component, select Delete.
-
3 Set Up a Report Deactivate Components You can deactivate any component in a report setup. Deactivating a component causes it to be skipped during generation of a report. Deactivating components can be useful for debugging setups. For example, you can deactivate a component that you suspect is causing an error or you can activate only the components you want to debug, thereby cutting the time required to verify a fix.
-
Send Components to the MATLAB Workspace Send Components to the MATLAB Workspace You can send the components of a setup from the Report Explorer to the MATLAB workspace. This allows you to inspect and set their properties at the MATLAB command line. Sending components to the workspace can be useful for creating or debugging MATLAB programs that create report setups and generate reports from them.
-
-
4 Generate a Report • “Generate a Report” on page 4-2 • “Select Report Generation Options” on page 4-4 • “Report Generation Preferences” on page 4-13 • “Change Report Locale” on page 4-17 • “Convert XML Documents to Different File Formats” on page 4-18 • “Create a Report Log File” on page 4-21 • “Generate MATLAB Code from Report Setup File” on page 4-22 • “Troubleshooting Report Generation Issues” on page 4-25
-
4 Generate a Report Generate a Report In this section... “Run a Report” on page 4-2 “Report Output Options” on page 4-2 Run a Report You can generate a MATLAB Report Generator report using one of these methods: • In the Report Explorer Outline pane, select a report and do one of the following actions: • In the Report Explorer toolbar, click the Report button . • Press CTL+R. • Select File > Report. • From the MATLAB command line, use the report command.
-
Generate a Report • “Create a Report Log File” on page 4-21 • “Report Description” on page 4-12 • “Change Report Locale” on page 4-17 4-3
-
4 Generate a Report Select Report Generation Options In this section...
-
Select Report Generation Options To set defaults for report generation options that you can override with the Report Options dialog box or with individual components, use the Report Generator Preferences pane. For details, see “Report Generation Preferences” on page 4-13. Report Output Format In the Report Explorer, in the File format text box, choose the report output format. Using a template when generating a report provides several benefits, compared to generating a report without using a template.
-
4 Generate a Report File Format Using Report Templates To use a template for report generation, select one of these options: • PDF (from template) • HTML (from template) • Word (from template) If you use a template, then from the list of templates, you can specify a template other than the default template. Each output format that does not use a template has a default stylesheet associated with it. Specify the stylesheet in the text box next to the File format text box.
-
Select Report Generation Options Viewer Format Description Stylesheets DocBook DocBook (no transform) Produce a report in DocBook format N/A Tip To create and use customized styles, see “Create a New Stylesheet”. PDF: Image Formats PDF reports only support bitmap (.bmp), .jpeg (.jpg), and Scalable Vector Graphics (.svg). The SVG format is only supported for Simulink models and Stateflow charts. For example, MATLAB figures do not display in SVG when you select the SVG format for PDF reports.
-
4 Generate a Report Note: Some Web and Print stylesheets include an automatically generated list of titles, which includes table titles and figures with titles.
-
Select Report Generation Options Web Stylesheet Description Truth Table HTML stylesheet HTML on multiple pages; suppresses chapter headings and table of contents Multi-page Web HTML, with each chapter on a separate page Single-page Web HTML on a single page Single-page Unnumbered Chapters & Sections HTML on a single page; chapters and sections are not numbered Single-page Numbered Chapters & Sections HTML on a single page; chapters and sections are numbered Single-page Simple HTML on a single
-
4 Generate a Report Report Generation Processing The Report Options dialog box includes several options for controlling report processing. Option Purpose View report after generation View the report automatically. When report generation finishes, the viewer associated with the report output format displays the report. Note: On Linux and Macintosh platforms, the report output displays in Apache OpenOffice, which must be installed in /Applications/OpenOffice.app.
-
Select Report Generation Options Option Purpose contents. If a report requires multiple compilations, the processing can be quite time-consuming. To minimize compilations, consider using separate reports to report on the contents of a model and on the results of simulating that model. Evaluate this string after generation Specify MATLAB code for processing to occur after the report is generated. For example, you could specify to close a model.
-
4 Generate a Report Report File Name In the Report Explorer, in the Report Options dialog box, use the Filename field to specify a file name for the report file. Select one of the following options. File Name Option The same file name as the report setup file Same as setup file (default) A file name different from the report Custom. setup file name Enter the name of the report. You can use % notation to specify a file name in the Custom text box.
-
Report Generation Preferences Report Generation Preferences In this section... “Report Generator Preferences Pane” on page 4-13 “File Format and Extension” on page 4-14 “Image Formats” on page 4-15 “Report Viewing” on page 4-15 “Reset to Defaults” on page 4-16 Report Generator Preferences Pane To set defaults for report generation options, use the Report Generator Preferences pane. You can override these preferences with the Report Options dialog box or with individual components.
-
4 Generate a Report File Format and Extension To specify the default file format for reports, use the Format ID preference. The default preference is web (HTML). You can select from a range of file formats, such as PDF, Microsoft Word, or LaTex. Note: For reports that use the Word Document format, you must have Microsoft Word installed on the machine that you use to generate the report.
-
Report Generation Preferences The Extension preference reflects the standard file extension for the file format specified with the Format ID preference. You can change the extension. Image Formats To set the default image formats associated with the output format for a report, use the following preferences. Preference Purpose Simulink Images Specify the format for Simulink images to include in the report. Stateflow Images Specify the format for Stateflow charts to include in the report.
-
4 Generate a Report Preference Purpose Visible in Report Explorer Deselect this check box to make the current output format unavailable in the Report Explorer. For example, if your specified report format is Word document and you deselect this check box, then the Microsoft Word document format is no longer available for reports created using the Report Explorer.
-
Change Report Locale Change Report Locale Versions 2.0 and later of the MATLAB Report Generator and Simulink Report Generator software use the locale (system language settings) through the Oracle® Java interface; therefore, they should use the language specified on your system. Alternatively, you can change the language directly in Java from the MATLAB command line. The following example sets the language to Italian: java.util.Locale.setDefault(java.util.Locale.
-
4 Generate a Report Convert XML Documents to Different File Formats In this section... “Why Convert XML Documents?” on page 4-18 “Convert XML Documents Using the Report Explorer” on page 4-18 “Convert XML Documents Using the Command Line” on page 4-20 “Edit XML Source Files” on page 4-20 Why Convert XML Documents? You can generate a report in a different output file format without regenerating it by using either the Report Explorer File Converter or the rptconvert command.
-
Convert XML Documents to Different File Formats 2 Select your XML source file using one of the following options: • Click Browse in the Properties pane on the right to browse to the location of your XML source. • Double-click a file name in the Options pane in the middle to automatically enter it into the Source file field in the Properties pane. 3 Select your output format and stylesheet: a In the File format text box, select an output format. b In the Stylesheet text box, select a stylesheet.
-
4 Generate a Report For more information about customizing stylesheets, see “Create a New Stylesheet”. 4 Use the View Report when done converting check box to indicate whether you want to view the report after it has conversion. 5 To begin the conversion, click Convert file. Convert XML Documents Using the Command Line To convert files using the command line, use the rptconvertfunction.
-
Create a Report Log File Create a Report Log File A log file describes the report setup file report-generation settings and components.
-
4 Generate a Report Generate MATLAB Code from Report Setup File You can generate MATLAB code versions of report setup files in the form of a MATLAB file (*.m). A MATLAB file of a report setup file is useful for various purposes, including generating reports and modifying report setup files programmatically. To generate a MATLAB file, load a report setup file into the Report Explorer and click File > Generate MATLAB File. After the MATLAB file generates, it opens in the MATLAB Editor.
-
Generate MATLAB Code from Report Setup File 5 To generate the figloop_tutorial report from this MATLAB file, run the following command in the MATLAB Command Window: report(buildfigloop_tutorial); The MATLAB Report Generator software runs and displays the report.
-
4 Generate a Report 4-24
-
Troubleshooting Report Generation Issues Troubleshooting Report Generation Issues In this section... “Memory Usage” on page 4-25 “HTML Report Display on UNIX Systems” on page 4-25 Memory Usage By default, the MATLAB software sets a limit of 100 MB on the amount of memory the Oracle Java Virtual Machine (JVM™) software can allocate. The memory that the report generation process uses to build a document must fit within this limit.
-
-
5 Add Content with Components • “Components” on page 5-2 • “Report Structure Components” on page 5-4 • “Table Formatting Components” on page 5-5 • “Property Table Components” on page 5-6 • “Summary Table Components” on page 5-17 • “Logical and Looping Components” on page 5-21 • “Edit Figure Loop Components” on page 5-22
-
5 Add Content with Components Components Components are MATLAB objects that specify the content of a report. Add components to specify the types of content that commonly occur in reports. The MATLAB Report Generator provides a set of components for specifying the types of content that commonly occur in MATLAB-based reports. The Simulink Report Generator provides additional components to facilitate generation of reports from Simulink models.
-
Components Component Formatting When you generate a report, in the Report Options dialog box, in the File format field you specify the type of report output you want. For example, you can generate a report in PDF, HTML, or Microsoft Word format. For each format, you can choose to apply styles from either of these style definition sources: • An HTML or Word report conversion template • A Model Explorer stylesheet for HTML, Word, or PDF.
-
5 Add Content with Components Report Structure Components Use report structure components to organize the content of your report into chapters, sections, paragraphs, lists, tables, and other standard document structure elements. The following table summarizes the report structure components. 5-4 Component Usage Title Page Generate a title page for a report. Chapter/Subsection Parent components that generate the content of a chapter or chapter subsection.
-
Table Formatting Components Table Formatting Components Use table formatting components to organize generated content into tables. The following table summarizes the table formatting components. Component Usage Table Parent a table body component. Can also parent column specification components and a table header and a table footer component. Specifies properties of the table as a whole (for example, its title, number of columns, and border). Table Body Parent the rows that make up the table body.
-
5 Add Content with Components Property Table Components In this section...
-
Property Table Components Many types of property table components are available, including: • MATLAB Property Table • Simulink Property Table (requires Simulink Report Generator) • Stateflow Property Table (requires Simulink Report Generator) The component used in this example represents MATLAB Report Generator property table components, all of which exhibit similar behavior.
-
5 Add Content with Components Open the Example Report Template This example uses the figloop-tutorial report template. To open the figure loop tutorial report template, at the MATLAB command line enter: setedit figloop-tutorial Examine the Property Table Output Property pages for all property table components are similar in form. In the Outline pane, select the Figure Prop Table component. To modify table settings, in the Handle Graphics Property Table dialog box, click the Edit... button.
-
Property Table Components Select Object Types Property table components offer multiple object types on which to report. For example, the Handle Graphics Property Table lets you report on a figure, an axes object, or a Handle Graphics object. You can select a different object type on which to report in the Object type list in the Properties pane for the component.
-
5 Add Content with Components split mode. Split mode supports only one property name/property value pair per cell. If more than one property pair appears in a cell, only the first pair appears in the report; all subsequent pairs are ignored. Display Options Property name/property value pairs can appear in cells in several ways. To specify how a given property name/property value pair appears in a cell, select that field in the table (for this tutorial, select the Name property).
-
Property Table Components Format Options To specify alignment for text in a given cell, in the toolbar at the bottom of the dialog box use the four justification buttons. Select the HandleVisibility table row. Then select the double-justify button (the last button to the right).
-
5 Add Content with Components Edit Table Titles Table titles can contain properties and text. By default, the title of a table is the same as the value of the % property. You can modify this property to modify the table title. Note: Table titles are always in nonsplit mode. Enter Text into Table Cells For the text to be visible, the table must be in nonsplit mode. Clear Split property/ value cells. To enter text into the HandleVisibility table cell, double-click the cell.
-
Property Table Components If you type text outside the angle brackets, the text appears as is in the report. Text inside the table brackets must specify a valid property name. If you enter an invalid property name, the property name appears in the report without a property value. Add, Replace, and Delete Properties in Tables Adding Table Properties To add a Handle Graphics property to a table, use the following steps.
-
5 Add Content with Components b In the Properties Type drop-down list at the upper-right of the dialog box, select a property type. c In the Properties list, select the property you want to add. d Click the << Add button, or double-click the property name. The property appears in the table row. Alternatively, if you know the name of the property you want to add, enter the property name directly into the cell as described in “Enter Text into Table Cells”.
-
Property Table Components Button Action Delete selected column Add row (added above the selected row) Delete selected row Resize Columns To resize the width of a column, click and drag its vertical borders as needed. Merge and Split Cells To merge or split table cells, select a row and then click one of the buttons described in the following table.
-
5 Add Content with Components Zoom and Scroll You can zoom in and out of the table with the zoom buttons, which are located to the left of the horizontal scroll bar. Button Action Zoom in Zoom out You can scroll vertically and horizontally using the table scroll bars. Select a Table To display property name/property value pairs, you can select a preset table or use a custom table. • A preset table is built-in and formatted.
-
Summary Table Components Summary Table Components In this section... “About Summary Table Components” on page 5-17 “Open the Example Report Template” on page 5-18 “Select Object Types” on page 5-19 “Add and Remove Properties” on page 5-19 “Set Relative Column Widths” on page 5-20 “Set Object Row Options” on page 5-20 About Summary Table Components Summary table components insert tables that include specified properties for objects into generated reports.
-
5 Add Content with Components Many types of summary table components are available, including: • Handle Graphics Summary Table • Simulink Summary Table (requires Simulink Report Generator) • Stateflow Summary Table (requires Simulink Report Generator) The component used in this example represents MATLAB Report Generator summary table components, all of which exhibit similar behavior Open the Example Report Template This example uses the figloop-tutorial report template.
-
Summary Table Components setedit figloop-tutorial Select Object Types You can use the Object type selection list to choose Handle Graphics object types for the summary table, including blocks, signals, systems, and models. The figloop-tutorial reports on figure objects. Add and Remove Properties You can select object properties to appear in the summary table from the Property Columns pane.
-
5 Add Content with Components To remove a property from the table: 1 2 Select the property in the Property columns table. Click the Delete property button. The property name is removed from the Property columns table. Note: After making changes in the Report Explorer, click Apply to make the changes take effect. You can define your own properties by entering their names into the Property columns table using valid variable notation.
-
Logical and Looping Components Logical and Looping Components Logical and looping components execute conditionally, determining when a child component executes or how many times a child component executes. A looping component runs its child components a specified number of times. There are several looping components, such as logical loops and Handle Graphics loops. For an example that uses loop components, see “Edit Figure Loop Components”.
-
5 Add Content with Components Edit Figure Loop Components In this section... “Figure Loop in a Report” on page 5-22 “Figure Properties” on page 5-23 “Loop on the Current Figure” on page 5-24 “Loop on Visible Figures” on page 5-24 “Loop on Figures with Tags” on page 5-24 “Modify Loop Section Options” on page 5-24 Figure Loop in a Report This example uses the Figure Loop, which is representative of many types of loops. The Figure Loop component runs its child components several times.
-
Edit Figure Loop Components Figure Properties Figure properties control which figures appear in the report. Table 1.1 of the figlooptutorial report includes a summary of the properties of the figures used in this tutorial.
-
5 Add Content with Components For this example, do not change these properties. For more information, see “Add, Replace, and Delete Properties in Tables” on page 5-13. Loop on the Current Figure To include only the current figure in the report, select Current figure only from the Include figures selection list. The current figure is the figure that is current when the report generates.
-
Edit Figure Loop Components in each loop appear in the report by using the options in the Figure Loop component's Section Options pane. • Create Section for Each Object in Loop — Create an individual section for each object found in the loop, using the object title as the section title. This option is useful when a loop does not contain a Chapter/Subsection component that organizes the loop results. • Display the Object Type in the Section Title — Precede section titles with object titles.
-
-
6 Template-Based Report Formatting • “Report Conversion Templates” on page 6-2 • “Generate a Report Using a Template” on page 6-4 • “Conversion Template Contents” on page 6-5 • “Copy a Conversion Template” on page 6-12 • “Open a Conversion Template” on page 6-14 • “Set Conversion Template Properties” on page 6-15 • “Move a Conversion Template” on page 6-16 • “Delete a Conversion Template” on page 6-17 • “Customize Microsoft Word Report Styles” on page 6-18 • “Customize Microsoft Word Part Templates” on page
-
6 Template-Based Report Formatting Report Conversion Templates In this section... “Templates for Report Conversion” on page 6-2 “Custom Templates” on page 6-2 “Custom Component Styles” on page 6-2 “Benefits of Using Templates” on page 6-2 Templates for Report Conversion By selecting the Word (from template) output type, you can cause the Report Generator to use a Microsoft Word template to convert the XML content for a report to a Word or PDF document.
-
Report Conversion Templates • Does not use Java memory to convert report XML content to HTML, Word, or PDF. Converting report XML content without using a template can cause Java to run out of memory. Also, templates allow you to use your knowledge of Word and HTML document formatting to format reports.
-
6 Template-Based Report Formatting Generate a Report Using a Template 1 In Report Explorer, in the Outline pane, select the report. 2 In the Report Options dialog box that appears in the Properties pane, set the File format field to one of these options: • HTML (from template) • PDF (from template) • Word (from template) 3 Optionally, from the list of templates available for the current file format, select a template.
-
Conversion Template Contents Conversion Template Contents In this section... “Default Styles” on page 6-5 “Part Templates” on page 6-9 “Header and Footers in Word Conversion Templates” on page 6-10 A report conversion template contains: • A main template with default style definitions for report elements. • Part templates for the report elements such as title pages, chapters, and titles for sections and tables. Part templates contain fill-in-the-blanks holes for generated content. • Headers and footers.
-
6 6-6 Template-Based Report Formatting Style Report Explorer Components the Style Formats rgBody Text component rgChapter Chapter component rgChapterTitle Chapter component title rgCopyright Title Page component copyright rgFigure Paragraph that contains an image generated by a snapshot or Image component, to adjust the spacing of images relative to adjacent paragraphs rgFigureCaption The caption for Image component and snapshot components rgFigureTitle The Image component and snapshot com
-
Conversion Template Contents Style Report Explorer Components the Style Formats rgProgramListing Code generated by: • Text component with Show text as syntax highlighted MATLAB code option is selected • MATLAB Function Block component • Truth Table component rgPubDate Title page report creation date rgPubDatePrefix Title page report creation date prefix rgSect1Title Section title for first-level section in a chapter rgSect1TitleNumber Number for Section title for first-level section in a chapter
-
6 6-8 Template-Based Report Formatting Style Report Explorer Components the Style Formats rgSect3TitleText Text for Section title for third-level section in a chapter rgSect4Title Section title for fourth-level section in a chapter rgSect4TitleNumber Number for Section title for fourth-level section in a chapter rgSect4TitlePrefix Prefix for Section title for fourth-level section in a chapter rgSect4TitleText Text for Section title for fourth-level section in a chapter rgSect5Title Section t
-
Conversion Template Contents Part Templates The conversion templates include template parts to format specific elements of a report. Part Template Report Explorer Components the Part Template Formats rgRectoTitlePage Title Page Front title page contents, including the report title, subtitle, author, and an image. rgVersoTitlePage Title Page Back title page contents, including the date published, copyright, legal notice, and abstract.
-
6 Template-Based Report Formatting Part Template Report Explorer Components the Part Template Formats Table title, including prefix (such as Table, number, and title) and for the content. rgFigureTitle Table and Array-BasedTable Table title, including prefix (such as Table, number, and title) and for the content. Part Template Holes Part templates include fill-in-the-blanks hole markup. The report converter fills holes with content that the MATLAB Report Generator generates.
-
Conversion Template Contents Related Examples • “Generate a Report Using a Template” on page 6-4 • “Copy a Conversion Template” on page 6-12 • “Customize Microsoft Word Report Styles” on page 6-18 • “Customize Microsoft Word Part Templates” on page 6-21 • “Customize a Microsoft Word Title Page Template” on page 6-30 More About • “Report Conversion Templates” on page 6-2 6-11
-
6 Template-Based Report Formatting Copy a Conversion Template Copy a Conversion Template 1 In Report Explorer, select Tools > Edit Document Conversion Template. The Template Browser appears in the Report Explorer. 2 In the Library pane (middle pane), select a template from the list of Word or HTML templates. For example, select Default Word Template. 3 In the Template Browser, click Copy template. A file browser appears.
-
Copy a Conversion Template More About • “Report Conversion Templates” on page 6-2 6-13
-
6 Template-Based Report Formatting Open a Conversion Template 1 In Report Explorer, select Tools > Edit Document Conversion Template. The Template Browser appears in the Report Explorer. 2 Select a template from the list of Word and HTML templates in the Library pane. For example, select Default Word Template. The properties of the template appear in the Report Explorer Properties pane. 3 In the Template Browser, click Open template. If you open a default template, you cannot edit it.
-
Set Conversion Template Properties Set Conversion Template Properties For custom conversion templates, you can specify properties to describe the template. 1 In Report Explorer, select Tools > Edit Document Conversion Template. 2 From the list of templates in the Library pane, click the template whose properties you want to set. 3 In the fields at the top of the Properties pane, specify properties for the template.
-
6 Template-Based Report Formatting Move a Conversion Template You can change the location of a template file. 1 In Report Explorer, select Tools > Edit Document Conversion Template. The Template Browser appears in the Report Explorer. 2 In the Report Explorer, select the template to move. 3 In the Template Browser, select Move template. 4 In the file browser, navigate to the new location for the template file. Enter a file name, using the appropriate extension for the type of template (.dotx or .
-
Delete a Conversion Template Delete a Conversion Template 1 In Report Explorer, select Tools > Edit Document Conversion Template. The Template Browser appears in the Report Explorer. 2 In the Report Explorer, select the template to delete. 3 In the Template Browser, select Delete template and click Yes.
-
6 Template-Based Report Formatting Customize Microsoft Word Report Styles In this section... “Customize Default Microsoft Word Component Styles” on page 6-18 “Create Styles in a Microsoft Word Template” on page 6-18 You can customize report styles in a custom Word conversion template or add styles to a custom Word template. For more information about Word styles, see the Microsoft Word documentation.
-
Customize Microsoft Word Report Styles 1 In the Report Explorer, select Tools > Edit Document Conversion Template. 2 In the list of templates in the middle pane, select a custom template. 3 In the Properties pane, click Open stylesheet. 4 If applicable, select an existing style to use as a starting point for the new style. 5 Click the New Style button. 6 Specify a name for the new style and define the style characteristics. To save the new style definition, click OK and close the dialog box.
-
6 Template-Based Report Formatting • 6-20 “Conversion Template Contents” on page 6-5
-
Customize Microsoft Word Part Templates Customize Microsoft Word Part Templates In this section...
-
6 Template-Based Report Formatting Display the Developer Ribbon in Word To work with holes in a Word template, use the Word Developer ribbon. If the Developer tab is not showing in your Word ribbon, add it to the ribbon. 1 In Word, select File > Options. 2 In the Word Options dialog box, select Customize Ribbon. 3 In the Customize the Ribbon list, select the Developer check box and click OK. Tip If you do not see Developer check box in the list, set Customize the Ribbon to Main Tabs.
-
Customize Microsoft Word Part Templates 10 In the Create New Building Block dialog box, set Name to the part template name (for example, rgChapter) and the Category to mlreportgen. Click OK. 11 In the template, delete the customized part template. 12 Save the main template. Set Default Text Style for a Hole Your template can specify the name of a style to use as a default to format text generated for a hole.
-
6 Template-Based Report Formatting 10 Select the part template and click the Quick Parts button. 11 Click Save Selection to Quick Part Gallery. 12 In the Create New Building Block dialog box, set Name to the part template name (for example, rgChapter) and the Category to mlreportgen. Click OK. 13 Save and close the template.
-
Customize Microsoft Word Part Templates Distinguish Inline and Block Holes The Report Explorer supports two types of holes: inline and block. • Use an inline hole is for content that you can include in a Word paragraph. • Use a block hole for content that you cannot embed in a paragraph. You can configure the Word editor to provide visual cues that indicate whether a hole is an inline or block hole. Note: If you do not have a custom Word conversion template, see “Copy a Conversion Template” on page 6-12.
-
6 Template-Based Report Formatting Avoid Changing Block Holes to Inline Holes Do not change a block hole to an inline hole. You can accidentally change a block hole to an inline hole by removing the paragraph marker of an inline hole that is followed by a block hole. For example, if you delete the paragraph marker for the rgChapterTitle inline hole, the rgChapterContent block hole changes to an inline hole.
-
Customize Microsoft Word Part Templates Tip To display Word markup for the part template, on the Word ribbon, in the Developer tab, click Design Mode. 7 Write down the name of the part template you are customizing, because you need to enter that name later in this procedure. 8 In the rgChapter part template, delete the rgChapterTitlePrefix hole. Select the hole markup and click the Delete key. 9 In the template, select all of the contents of the part template. 10 Right-click and select Properties.
-
6 Template-Based Report Formatting Add an Inline Hole The only kind of holes that you can add to a part template are the holes that the Report Explorer supports for that part template. For example, for the rgChapter part template, the only inline holes that you can reinsert are rgChapterTitlePrefix, rgChapterTitleNumber, and rgChapterTitle holes. Do not add multiple instances of the same kind of hole in a part template.
-
Customize Microsoft Word Part Templates 13 In the template, select all of the contents of the part template and click the Delete button. 14 Save and close the template. Add a Block Hole The only kind of holes that you can add to a part template are the holes that the Report Explorer supports for that part template. For example, for the rgChapter part template, the block hole that you can reinsert is rgChapterContent holes. Do not add multiple instances of the same kind of hole in a part template.
-
6 Template-Based Report Formatting Customize a Microsoft Word Title Page Template In this section... “Create a Custom Template” on page 6-30 “Change the Color of a Report Title” on page 6-31 “Assign the Template to a Report” on page 6-33 “Customize Title Page Content and Layout” on page 6-34 The Report Explorer default Word document conversion template contains document part templates for the front (recto) and back (verso) side of a report title page.
-
Customize a Microsoft Word Title Page Template 7 Apply the properties by selecting another template in the list of templates. Change the Color of a Report Title You can customize the Magic Square Template (see “Create a Custom Template” on page 6-30) to use blue text for the report title. 1 In the Report Explorer, select Tools > Edit Document Conversion Template. 2 In the Report Explorer list of Word templates, select Magic Square Template. 3 In the Template Browser, click Open style sheet.
-
6 Template-Based Report Formatting 5 6-32 In the Modify Style dialog box for rgTitle, click the down arrow for Automatic. Select the blue color box and click OK.
-
Customize a Microsoft Word Title Page Template 6 In the Manage Styles dialog box, click OK. 7 Save and close the template. Assign the Template to a Report You can assign the customized template to the magic-square.rpt Report Explorer report. 1 In the Report Explorer, select Report Generator node. 2 In the Report Explorer, in the list of reports, select magic_square.rpt.
-
6 Template-Based Report Formatting 3 In the Report Options pane, click Open report. 4 In the magic_squares report, add a Title Page component. In the Title Page dialog box, set the Title field to Magic Squares. 5 Below the Title Page component, add a Chapter component. 6 In the Report Options dialog box, set File format to Word (from template) and instead of Default Word Template, select Magic Squares Template. 7 Generate the report. Select the magic_squares report.
-
Customize a Microsoft Word Title Page Template 4 In the Quick Parts gallery, select rgRectoTitlePage to insert of the front title page part template in the main document conversion template. Tip To display Word markup for the part template, on the Word ribbon, in the Developer tab, click Design Mode. 5 Highlight the rgImage hole and drag it above the rgTitle hole. 6 Delete the rgAuthor hole. 7 Select the rgRectoTitlePage part template and click the Quick Parts button.
-
6 Template-Based Report Formatting Create a Custom HTML Template In this section... “Copy an HTML Template” on page 6-36 “Select an HTML Editor” on page 6-37 “Edit HTML Styles in a Template” on page 6-37 Copy an HTML Template To customize the format styles used in the default HTML template, you need to copy that template (or a template that was copied from the default template) and modify or add style definitions in the copy. 1 In Report Explorer, select Tools > Edit Document Conversion Template.
-
Create a Custom HTML Template Select an HTML Editor By default, when you edit an HTML style sheet, the style sheet appears in the MATLAB Editor. To use a different editor for editing an HTML template: 1 In the Report Explorer, select File > Preferences 2 In Edit HTML Command, enter a MATLAB expression that opens the HTML editor you want to use.
-
6 Template-Based Report Formatting More About • 6-38 “Report Conversion Templates”
-
7 Create Custom Components • “About Custom Components” on page 7-2 • “Create Custom Components” on page 7-3 • “Define Components” on page 7-6 • “Specify Tasks for a Component to Perform” on page 7-13 • “Customized Components” on page 7-19
-
7 Create Custom Components About Custom Components In most cases, the components provided with the MATLAB Report Generator software should be more than adequate for your needs. You can, however, create custom components if you want to generate a report via functionality that is not available in the standard MATLAB Report Generator components. For example, you can create a component that inserts a corporate logo into your report, or a component that plots data.
-
Create Custom Components Create Custom Components To create a component: 1 Open the Report Explorer. 2 Select one of the component creation choices from the Tools menu: • To create a custom component, select Create Component. • To create a custom component from an existing component, select Create Component from. • To create a component from an existing version 1 component, select Create Component from V1.
-
7 Create Custom Components 3 Specify properties of the component in the Properties pane of the Report Explorer. For more information, see “Define Components” on page 7-6. 4 Specify tasks you want the component to perform by editing the MATLAB files that comprise the framework of the component. For more information, see “Specify Tasks for a Component to Perform” on page 7-13. 5 Build the component. For more information, see “Build Components” on page 7-11.
-
Create Custom Components Note: You must restart the MATLAB software session before using a newly created or rebuilt component.
-
7 Create Custom Components Define Components In this section...
-
Define Components 1 Class Directory Field. Specify a class name for your component. The build process creates a folder with the name you specify and places the component's files in it. The class folder name must be unique for each component in the package. By convention, component class names begin with an uppercase or lowercase letter c; for example, cUserDefinedComponent. 2 Package Directory Field. Specify the folder in which to store files for groups of components you create.
-
7 Create Custom Components 3 Category Name. Specify the category of components to which the new component belongs. The component appears under this category in the Options pane in the middle of the Report Explorer. Predefined choices appear in the Category name list. Select a component category from this list. To create a custom component category, type the name for the category into the Category name field. This category name appears in the list of available categories in the Report Explorer.
-
Define Components Specify Component Properties Component properties determine how a component behaves and what information it inserts into a report. To see the current value of a component's property, double-click it in the Outline pane on the left in the Report Explorer. For example, the following figure displays the property values for New_String_Property. Add Properties to Components You add properties to a component from the properties list.
-
7 Create Custom Components 7-10 2 Right-click the name of a predefined property in the Options pane in the middle. From the context menu, select Add property. 3 Left-click the name of a property in the Options pane, and then drag it on top of a component in the Outline pane on the left. 4 Double-click the property name in the Options pane in the middle. The property is added to the component and property values appear in the Properties pane on the right.
-
Define Components Specify Component Properties 1 Property Name. Create a name for the new property. A property name must be a valid MATLAB variable name, and must be unique within a component. 2 Data Type. Specify the property's data type. Options are: • Double • Enumeration • Integer • String • String Vector • % Use this data type to include the value of a variable in the MATLAB workspace in a component.
-
7 Create Custom Components component and stores them in the specified folder. For more information about specifying where components are stored, see “Specify the Location of Component Files” on page 7-6. Note: Existing files in this location are overwritten. Rebuild Existing Components To add, remove, or change properties of an existing component, use the Rebuild Constructor button. This button becomes active only after you have previously created a component using the Build Component button.
-
Specify Tasks for a Component to Perform Specify Tasks for a Component to Perform In this section...
-
7 Create Custom Components The execute command has the following syntax: out = execute(thisComp, parentDoc) Where: • thisComp is a handle to the component that you are running. • parentDoc is a handle to the document that you are generating. • out is a Document Object Model (DOM) node or string to add to the report. For information on manipulating DOM nodes, see xmlwrite in the MATLAB documentation. One or more default lines of code within the execute.m file show each property for the component.
-
Specify Tasks for a Component to Perform For more information, enter help(rptgen.cfr_list) at the MATLAB command line. Create Text To create text, replace the ParaText property value with a text string: out = execute(rptgen.cfr_paragraph(... 'ParaText', paraSrc,... parentDoc); For more information, enter help(rptgen.cfr_paragraph) at the command line. Create Figures To create figures, specify a figure in the FigureHandle property value. figSrc = gcf; out = execute(rptgen_hg.chg_fig_snap(...
-
7 Create Custom Components olstring = getOutlineString(thisComp) Where: • thisComp is the component whose description you are specifying. • olstring is a single-line string that displays information about the component. It can contain a maximum of 32 characters. Customize the string to include additional information about the component, such as information about its properties. In the following example, the truncatestring function converts input data into a single-line string.
-
Specify Tasks for a Component to Perform Note: Do not modify fields that are not explicitly included in this file. These fields are subject to change in future releases. Specify Additional Component Properties You can edit additional MATLAB files to customize your component further. To access these files, right-click the component in the Outline pane on the left in the Report Explorer and select Edit files from its context menu.
-
7 Create Custom Components compDesc = 'An example component'; Change a Component Display Name The display name in getName.m is the same value as the Display name field in the Report Explorer. The following example shows how to edit the compName string in this file to change a component's display name to Example Component: compName = 'Example Component'; Change a Component Category Name The category name in getType.m is the same value as the Category name field in the Report Explorer.
-
Customized Components Customized Components In this section... “Fetching Securities Data and Displaying It in a Table” on page 7-19 “Displaying Securities Data in Two Tables” on page 7-24 Note: These examples require the Datafeed Toolbox™ software. Fetching Securities Data and Displaying It in a Table This example shows how to create a component that fetches securities data and displays it in a report as a table. 1 Create a component named Equity Values in the class folder named CStockTicker.
-
7 Create Custom Components 3 To build the new component, click the Build button in the Report Explorer. The Equity Values component now appears in the Options pane in the middle of the Report Explorer. 4 Edit the component's execute.m file to retrieve stock market data and display it in a table in the generated report. a In the @CStockTicker folder, open execute.m. b Enter the following text into execute.m.
-
Customized Components stockQuote = fetch(GOOG, thisComp.Ticker); stockQuote.Date = datestr(stockQuote.Date,1); stockQuote.Time = datestr(stockQuote.Time,13); out = execute(rptgen.cfr_table(... 'Source', stockQuote,... 'numHeaderRows', 0,... 'TableTitle', 'Stock Market Pricing Data'),... parentDoc); 5 Append the security symbol, goog, to the component name. Enter the following text into getOutlineString.m. function olstring=getOutlineString(thisComp) olstring = [getName(thisComp),' - ',thisComp.
-
7 Create Custom Components 6 Modify the getdialogschema.m file to change the appearance of the Properties pane. Enter the following text into this file to display the last quoted price for the security in the Properties pane. function dlgStruct = getdialogschema(thisComp, name) try currQuote = fetch(yahoo, thisComp.Ticker); quoteStr = sprintf('Last value: %g', currQuote.Last); catch quoteStr = sprintf('Warning: ... "%s" is not a valid symbol.', thisComp.Ticker); end dlgStruct = thisComp.dlgMain(name,...
-
Customized Components thisComp.dlgWidget('Ticker',... 'DialogRefresh',true,... 'RowSpan',[1 1],'ColSpan',[1 1]); thisComp.dlgText(quoteStr,... 'RowSpan',[2 2],'ColSpan',[1 1]); },'Stock',... 'LayoutGrid',[3 2],... 'RowStretch',[0 0 1],... 'ColStretch',[0 1])); The Properties pane for the component, Equity Values, now looks as follows. 7 Click File > Report to generate the report. The following output appears in the report.
-
7 Create Custom Components Displaying Securities Data in Two Tables This example, which shows how to use multiple properties within a component, expands upon “Fetching Securities Data and Displaying It in a Table” on page 7-19. 1 Create a report setup file and save it as stockreport.rpt. Add two Equity Values components to the setup file. 2 Edit the entry in the New marker property field to change the ticker property of the second component to '^GSPC' (S&P 500 index). 3 Run the report.
-
Customized Components 7-25
-
-
8 Create Custom Stylesheets • “Stylesheets” on page 8-2 • “Create a New Stylesheet” on page 8-4 • “Edit, Save, or Delete a Stylesheet” on page 8-5 • “Edit Stylesheet Data Items” on page 8-9 • “Stylesheet Cells for Headers and Footers” on page 8-23 • “Customized Stylesheets” on page 8-29 • “PDF Fonts for Non-English Platforms” on page 8-40
-
8 Create Custom Stylesheets Stylesheets In this section... “Built-In Versus Custom Stylesheets” on page 8-2 “Customize Stylesheets Using Data Items” on page 8-3 Built-In Versus Custom Stylesheets Stylesheets specify formatting and display settings for reports. The report-generation process uses stylesheets to convert reports from DocBook XML format to a format that you specify.
-
Stylesheets Name Description Note: This field is not editable. In most cases, the stylesheets provided with the MATLAB Report Generator software should be more than adequate for your needs. However, you may want to modify the built-in stylesheets to meet special requirements. For example, suppose one of the built-in stylesheets meets your requirements, but you want to change the page orientation. You can create a custom stylesheet by editing the built-in stylesheet to your specifications.
-
8 Create Custom Stylesheets Create a New Stylesheet To create a stylesheet: 1 Open the Report Explorer. 2 From the menu bar, click Tools > Edit Stylesheet. 3 In the Properties pane on the right, choose the built-in stylesheet for the format with which you want to work. Options are: • New HTML. Creates a stylesheet for HTML reports. • New multi-page HTML. Creates a stylesheet for HTML reports with more than one page. • New FO (PDF). Creates a stylesheet for PDF reports. • New DSSSL (RTF).
-
Edit, Save, or Delete a Stylesheet Edit, Save, or Delete a Stylesheet In this section... “Edit a Stylesheet” on page 8-5 “Save a Stylesheet” on page 8-7 “Delete a Stylesheet” on page 8-8 Edit a Stylesheet To edit a stylesheet: 1 In Report Explorer, select a report setup file in the Outline pane on the left. 2 From the menu bar, click Tools > Edit Stylesheet. The Report Explorer displays as follows. • The Outline pane on the left displays the structure of stylesheets you create.
-
8 Create Custom Stylesheets You can use the Report Explorer to work with stylesheets as follows.
-
Edit, Save, or Delete a Stylesheet Task Pane to Use Action Open an existing stylesheet Properties Click the name of the stylesheet, which appear in the Open Stylesheets area Select a stylesheet to use for converting an XML source file Options Select a stylesheet by clicking on it View a list of customized styles in Outline a stylesheet Expand any open stylesheet View a list of styles in a stylesheet Outline or Options Double-click the stylesheet View a list of stylesheets available for editin
-
8 Create Custom Stylesheets 2 Select File > Save As from the menu bar and specify a new name for the stylesheet (to avoid overwriting built-in stylesheets). You must save the file in a folder in your MATLAB path for the stylesheet to appear in the Report Explorer. The file name must be unique in the MATLAB path. By convention, MATLAB Report Generator stylesheets have .rgs as their file name extension.
-
Edit Stylesheet Data Items Edit Stylesheet Data Items In this section... “Data Item Categories in Built-In Stylesheets” on page 8-9 “Edit Data Items in Simple or Advanced Edit Mode” on page 8-13 “Data Items” on page 8-13 Data Item Categories in Built-In Stylesheets You can edit data items in built-in stylesheets to customize them. Data items appear in categories, according to their function.
-
8 Create Custom Stylesheets Category Description of Data Items in Category Pagination and General Styles Specifications of page orientation, margins, double-sided, paper type, hyphenation, line height, columns, master font, draft mode, watermark, blank pages, rules for headers and footers, and content of headers and footers Note: You can specify parameters in this category, such as margin widths and header and footer height, in units of inches (in), millimeters (mm), or picas (pi), where 1 pica = 1/6 i
-
Edit Stylesheet Data Items Category of Style Description of Data Items in Category Chunking Options related to using an explicit TOC for chunking, depth of section chunks, navigational graphics, and display of titles in headers and footers Stylesheet Extensions Line numbering, graphic size, and table columns extensions Graphics Specification of default width and depth, use of HTML embed for SVG, viewports, and options related to scaling attributes HTML Specifications related to dynamically served
-
8 Create Custom Stylesheets • DocBook print parameters, see http://docbook.sourceforge.
-
Edit Stylesheet Data Items Category of Style Description of Data Items in Category Tables Specification of width in simple list VariableLists Options and specifications for term length and formatting Verbatim Environments Specifications for width, enumeration, size, indentation, line frequency, and callouts Vertical Spacing Specifications for space between lines and paragraphs Edit Data Items in Simple or Advanced Edit Mode • To edit a data item in simple edit mode, edit a simple string that corr
-
8 Create Custom Stylesheets stylesheet. The Options pane in the middle shows a list of available stylesheet data items. The Properties pane on the right displays Stylesheet Editor: Data. It also includes the following information: • The value of the data item is in a pane labeled Value in simple edit mode or Value (XML) in advanced edit mode. • To the right of the value is the Edit as XML toggle button. • The Preview pane includes a partial view of the stylesheet that specifies the data item.
-
Edit Stylesheet Data Items Edit Boolean and Enumerated Values In the previous figure, theShow Comments data item is of type Boolean. Its current value is true(1). Change this value using the menu list for the value field. In this case, the only other possible value is false(2).
-
8 Create Custom Stylesheets Edit Strings For the values of some data items, the Report Explorer displays text in the editable Value field. You can specify an XML expression, though you are not required to do so. Edit XML Expressions To make complex changes to a stylesheet, consider using Advanced edit mode. This enables you to edit XML expressions directly in the Value (XML) pane. If this pane does not appear, click Edit as XML to switch to advanced edit mode. Make sure that you enter valid XML.
-
Edit Stylesheet Data Items To adjust the grid used to position the title page elements (such as the title and author) on the page, in the Properties pane specify: • Columns — The number of columns in the page grid • Width — The width of each column • Rows — The number of rows in the page grid • Width — The width of each row To view the grid layout on the generated title page, select Show grid. By default, all of the title page elements appear on the title page.
-
8 Create Custom Stylesheets 1 In the Properties pane, in the Include on title page list, select an element to exclude. 2 Click the right arrow button. The element appears in the Exclude from Title Page list. To specify properties for an individual title page element: 1 In Properties pane, in the Include on title page list, select the title page element.
-
Edit Stylesheet Data Items Modify Title Placement Properties The Title Placement data items, which are in the Miscellaneous category, control the position of titles for figures and tables. Selecting one of these data items for editing causes the Properties pane on the right to display possible values in a menu list. Specify whether you want the title to appear before or after a given figure or table.
-
8 Create Custom Stylesheets Modify Attributes An attribute is a data item that specifies information for an XML element. An attribute must be a child of an attribute set. For more information, see “Edit Attribute Sets” on page 8-20. Note: The information in the Help area of the Properties pane of an attribute describes the set to which the attribute belongs. Edit Attribute Sets An attribute set consists of a group of attributes.
-
Edit Stylesheet Data Items Edit Varpair Values Data items in RTF stylesheets appear as varpair data items, which are name/value pairs of information. RTF stylesheets are the only type of stylesheet that includes varpair data items. Edit varpair data items as strings or as Boolean values. Boolean values appear as true (#t) and false (#f). Note: You cannot edit RTF stylesheet data items as XML. Note: Data of type varpair is sometimes represented in stylesheets as DSSSL rather than XML.
-
8 Create Custom Stylesheets on the right looks different from code associated with other kinds of MATLAB Report Generator stylesheets. Delete Data Items To delete a customized data item: 8-22 1 Right-click the data item in the Outline pane on the left. 2 Select Delete.
-
Stylesheet Cells for Headers and Footers Stylesheet Cells for Headers and Footers In this section... “About Stylesheet Cells and Cell Groups” on page 8-23 “Headers and Footers” on page 8-24 “Add Content to Headers and Footers Using Templates” on page 8-26 “Insert Graphics Files” on page 8-27 “Modify Fonts and Other Properties” on page 8-27 About Stylesheet Cells and Cell Groups Use stylesheet cells to specify content of headers and footers in PDF reports.
-
8 Create Custom Stylesheets You can use many combinations of conditions and values to customize content of headers and footers. The MATLAB Report Generator software provides several predefined conditions that are frequently used. These predefined cells appear in the Properties panes for the Header Content and for Footer Content cell groups.
-
Stylesheet Cells for Headers and Footers Label Definition Description Condition Condition that must be met for content to appear in the report This is a selection list of frequently used and predefined conditions.
-
8 Create Custom Stylesheets Possible conditions and their values as coded in XML are shown in the following table.
-
Stylesheet Cells for Headers and Footers documents. For details about XSLT, see the Web site for the World Wide Web Consortium (W3C®) at http://www.w3.org/TR/xslt. To use a template to specify content for a header or footer: 1 In the Append template list, select the type of content you want to add. 2 Click Append. The Properties pane on the right displays default content for the type you select. Edit the XML code to change the default content.
-
8 Create Custom Stylesheets Each of these attribute sets is a pagination style data item for PDF stylesheets. You can edit a particular attribute in the set by selecting it in the Outline pane on the left. For an example of modifying font size and other properties of a PDF report, see “Change Font Size, Page Orientation, and Paper Type of a Generated Report” on page 8-35.
-
Customized Stylesheets Customized Stylesheets In this section... “Number Pages in a Report” on page 8-29 “Add Graphics to Headers in PDF Reports” on page 8-30 “Change Font Size, Page Orientation, and Paper Type of a Generated Report” on page 8-35 “Edit Font Size as a Derived Value in XML” on page 8-37 Number Pages in a Report This example shows how to edit a stylesheet cell to number the upper-right side of all pages in the generated report.
-
8 Create Custom Stylesheets 3 Click Append. Add Graphics to Headers in PDF Reports This example shows how to include an image in the center of the header of each page in a PDF report, excluding the report's title page and the first page of each chapter. You do this by editing default header content for a PDF stylesheet. This example uses the report setup file mfile-report.rpt. You can use any bitmap or jpeg file as image content.
-
Customized Stylesheets Note: PDF reports only support bitmap (.bmp), jpeg (.jpg), and Scalable Vector Graphics (.svg) images. To include this image file in the center of each header in the body of a PDF report: 1 Open mfile-report.rpt by entering the following at the MATLAB command prompt: setedit mfile-report 2 3 Create a custom stylesheet. a Select Tools > Edit Stylesheet in the menu bar of the Report Explorer. b Click New FO (PDF) in the Properties pane on the right.
-
8 Create Custom Stylesheets d Delete the text in the Value (XML) field. e Select Graphic from the Append template selection list and click Append. The Properties pane on the right shows the XML code that tells the File Converter to include the graphic.
-
Customized Stylesheets 4 By default, the name of the graphic is logo.bmp. Change all instances of this name to sample_logo.bmp in the Value (XML) field. 5 Save the stylesheet. 6 Make sure that the amount of room available in the header is large enough to accommodate the image file. a In the Options pane in the middle, double-click Region Before Extent, which is in the Pagination and General Styles folder.
-
8 Create Custom Stylesheets 7 b By default the value for the height of the header is 0.4 inch. Replace this value with 1.0in. c Save the stylesheet. Generate the report with the new styles. a Select mfile-report.rpt in the Outline pane on the left. b In the selection lists under the Report Format and Stylesheet area of the Properties pane on the right: • Specify Acrobat (PDF) for File format • Specify Logo stylesheet for PDF. c 8-34 Click Report on the toolbar to generate the report.
-
Customized Stylesheets Change Font Size, Page Orientation, and Paper Type of a Generated Report This example shows how to: • Generate an XML source file without converting it to a supported report format • Make section headers in a report larger • Change the report page orientation to landscape • Change the report paper type to A4 Create a custom stylesheet by editing an existing stylesheet to change the appearance of the wsvar-report report, which is provided with the MATLAB Report Generator software.
-
8 Create Custom Stylesheets The MATLAB Report Generator software converts the XML source file for wsvar-report to PDF format, and then opens the PDF document. 3 Make the report headers more prominent. a In the File Converter, click Edit. The Report Explorer displays the Unnumbered Chapters and Sections stylesheet. b In the Properties pane on the right, enter Custom Large Section Headers as the stylesheet name. c Enter the description No chapter and section numbering, larger section titles.
-
Customized Stylesheets The customheader.rgs stylesheet appears as an available stylesheet in the Options pane in the middle of the Report Explorer. It also appears as an option in the File Converter. 4 Use the new stylesheet to convert the current XML source file. a In the Stylesheet Editor: Main Properties pane on the right, click Send to File Converter The File Converter appears, with the customheader.rgs stylesheet selected. b 5 6 Click Convert file. Change page orientation and paper type.
-
8 Create Custom Stylesheets 4 In the Attributes area of the Properties pane on the right, click Font Size - . The Report Explorer looks as follows.
-
Customized Stylesheets The font size value is a product of $body.font.master and 2.0736. To change the font size to a larger size, change the multiplication factor to 3.0736. Tip You specify the value for the $body.font.master data item in the Body Font Master property. This property is in the Pagination and General Styles category in the Options pane in the middle. The default value of this data item is 10. Changing this value causes the derived values to change accordingly.
-
8 Create Custom Stylesheets PDF Fonts for Non-English Platforms In this section... “PDF Font Support for Languages” on page 8-40 “Identifying When to Specify a Font” on page 8-40 “Stylesheets Override PDF Font Mapping” on page 8-41 “Non-English PDF Font Mapping Tasks” on page 8-41 “lang_font_map.
-
PDF Fonts for Non-English Platforms Stylesheets Override PDF Font Mapping PDF stylesheets for the MATLAB Report Generator specify fonts for body text, copyright, quotes, symbols, dingbats, monospace, sans serif, and titles. The PDF stylesheet settings override the PDF font mapping entries. If you do not specify a PDF stylesheet, then you can use PDF language font mapping entries to change the default fonts for English reports.
-
8 Create Custom Stylesheets • name_map — Contains name_mapping elements that specify the name of the font, the language, and the font usage in the report (for example, body text). • file_map— Contains entries for the location of the font files for the fonts specified in the name_map. For example, the following lang_font_map.xml file includes name_map and file_map entries that provide basic PDF font support for Japanese (ja), Korean (ko), and Russian (ru). lang_font_map.xml example
-
PDF Fonts for Non-English Platforms lang="ru" lang="ru" lang="ru" lang="ru" platform="mac" platform="mac" platform="mac
-
8 Create Custom Stylesheets The approach you use to identify font names depends on your computer platform. Font names on Windows To identify a TrueType font name on Windows systems: 1 Navigate to the font folder (usually C:\Windows\Fonts). 2 If the font is a simple TrueType (not a collection), in the window, right-click the font and choose Properties to see the name of the file containing that font.
-
PDF Fonts for Non-English Platforms Each name_mapping element has three attributes: • lang specifies the two letter ISO 639-1 code corresponding to the language of the report. • platform specifies the operating system platform: • win — Windows • mac — Mac OS X • glnx— Linux • usage specifies the kind of report element or font: • body • title • monospaced • sans (sanserif) The text of the name_mapping element is a font name, as specified in an XSL-FO stylesheet.
-
8 Create Custom Stylesheets • ~/Library/Fonts • /Library/Fonts • Network/Library/Fonts • System/Library/Fonts • System/Folder/Fonts Linux Font File Locations On Linux platforms, the convention for locating fonts can differ, depending on the Linux distribution. The MATLAB Report Generator follows the Debian® convention of finding the list of font folders in the /etc/fonts/fonts.conf file. If the MATLAB Report Generator does not find the fonts.
-
9 Comparing XML Files • “Compare XML Files” on page 9-2 • “How to Compare XML Files” on page 9-4 • “Explore the XML Comparison Report” on page 9-6 • “How the Matching Algorithm Works” on page 9-10
-
9 Comparing XML Files Compare XML Files You can use MATLAB Report Generator software to compare a pair of XML text files. The XML comparison tool processes the results into a report that you can use to explore the file differences. You can access the XML comparison tool from: • The MATLAB Current Folder browser context menu • The MATLAB command line.
-
Compare XML Files 1 “How to Compare XML Files” on page 9-4 2 “Explore the XML Comparison Report” on page 9-6 9-3
-
9 Comparing XML Files How to Compare XML Files In this section...
-
How to Compare XML Files From the Comparison Tool To compare files using the Comparison Tool, from the MATLAB Toolstrip, in the File section, select the Compare button. In the dialog box select files to compare. If the files you select to compare are XML files and you select an XML comparison, the XML comparison tool performs a Chawathe analysis of the XML files, and generates an report.
-
9 Comparing XML Files Explore the XML Comparison Report In this section... “Navigate the XML Comparison Report” on page 9-6 “Save Comparison Log Files in a Zip File” on page 9-8 “Export Results to the Workspace” on page 9-8 Navigate the XML Comparison Report The XML comparison report shows changes only. The report is a hierarchical view of the differences between two XML text files, and is not a hierarchical view of the original XML data.
-
Explore the XML Comparison Report Type of report item Highlighting Notes Container None Rows with no highlighting indicate a container item that contains other modified or unmatched items. Use the toolbar buttons or the Comparison menu for the following functions: • Refresh — Run Chawathe analysis again to refresh the comparison report. • Swap Sides — Swap sides and rerun comparison. Runs the Chawathe analysis again.
-
9 Comparing XML Files Save Comparison Log Files in a Zip File Temporary XML comparison files accumulate in tempdir/MatlabComparisons/ XMLComparisons/TempDirs/. These temporary files are deleted when you close the related comparison report. You can zip the temporary files (such as log files) created during XML comparisons, for sharing or archiving. While the comparison report is open, enter: xmlcomp.zipTempFiles('c:\work\myexportfolder') The destination folder must exist.
-
Explore the XML Comparison Report Property of xmlcomp.Edits Description LeftFileName File name of left file exported to XML. LeftRoot xmlcomp.Node object that references the root of the left tree. RightFileName File name of right file exported to XML. RightRoot xmlcomp.Node object that references the root of the right tree. TimeSaved Time when results exported to the workspace. Version MathWorks® release-specific version number of xmlcomp.Edits object. Property of xmlcomp.
-
9 Comparing XML Files How the Matching Algorithm Works In this section... “Why Do I See Unexpected Results?” on page 9-10 “How the Chawathe Algorithm Works” on page 9-10 “Why Use a Heuristic Algorithm?” on page 9-12 “Examples of Unexpected Results” on page 9-12 Why Do I See Unexpected Results? The core of the XML file comparison engine is Chawathe’s matching algorithm. This matching algorithm is a heuristic method based on a scoring system.
-
How the Matching Algorithm Works The Chawathe algorithm matches a particular label by extracting a flat sequence of elements from the hierarchical document and attempting to match the elements in the sequences. In the example above, elements of the sequence ( First , Second , Third ) are matched against elements of the sequence ( First , Third , Fourth ) Sequences are matched using a Longest Common Subsequence (LCS) algorithm.
-
9 Comparing XML Files Why Use a Heuristic Algorithm? Chawathe’s algorithm is a heuristic. That is, it cannot guarantee to return the optimal matching between two sequences. It is the use of a threshold mechanism in combination with an LCS algorithm that makes the algorithm a heuristic. A heuristic algorithm is preferable to an optimal matching because the heuristic is much faster.
-
How the Matching Algorithm Works • A elements are scored on the ratio of matching B elements • For both A and B the score is compared with a threshold of 0.5. The left A and the middle A have two out of three B elements in common, resulting in a matching score of 2/3=0.66. The XML comparison tool marks the A elements as matched and the report shows that their contents have been modified.
-
9 Comparing XML Files In this case, the user might expect to see the very first C element on the left marked as deleted, with the second and third C elements matched to the corresponding C element on the right. However, this might not happen, if the first C on the left is matched to the second C on the right, even though these two C elements exist in very different parts of the document hierarchy.
-
How the Matching Algorithm Works Two Sequences of Elements Are Cross-Matched It is difficult to distinguish many similar potential matches and this could produce unexpected results. In the following example, B elements are scored on name, p1, and p2, and the score is compared to a threshold of 0.5. The right document contains one B element more than the left document, and therefore one of the B elements on the right must remain unmatched and the tool will mark one as inserted.
-
-
10 Components — Alphabetical List
-
10 Components — Alphabetical List Array-Based Table Convert rectangular array into table and insert it into report Description This component converts a rectangular cell array into a table and inserts the table into the report. Table Content • Workspace variable name: Specifies the workspace variable name with which to construct the table. • Collapse large cells to a single description: Consolidates large cells into one description. Formatting Options • Table title: Specifies the title of your table.
-
Array-Based Table is truncated so that the number of elements equals the number of columns. If m is less than the number of columns in the table, the vector is padded with 1s so that the number of elements equals the number of columns. If you use this field, it is recommended that you specify a width for each column. Any width not specified defaults to 1. MATLAB displays a warning when defaulting any unspecified column width to 1.
-
10 Components — Alphabetical List Insert Anything into Report? Yes. Table. Class rptgen.
-
Axes Loop Axes Loop Run child components for all axes objects in MATLAB workspace Description The Axes Loop component runs its child components for all axes objects in the MATLAB workspace. For information about working with looping components, see “Logical and Looping Components”. Object Selection • Loop type: • All axes: Loops on all axes objects. • Current axes: Loops on the currently selected axes object.
-
10 Components — Alphabetical List Insert Anything into Report? Yes, inserts a section if you select the Create section for each object in loop option. Class rptgen_hg.
-
Axes Snapshot Axes Snapshot Insert image of selected MATLAB axes objects into the generated report Description Inserts an image of selected MATLAB axes objects into the generated report. Format • Image file format: Specifies the image file format. Select Automatic HG Format to automatically choose the format best suited for the specified report output format. Otherwise, choose an image format that your output viewer can read. Automatic HG Format is the default option.
-
10 Components — Alphabetical List • JPEG medium quality image • JPEG low quality image • PNG 24-bit image • TIFF - compressed • TIFF - uncompressed • Windows metafile • Capture figure from screen: Captures the figure for the generated report directly from the screen. Options include: • Client area only: Captures part of the figure. • Entire figure window: Captures the entire figure window.
-
Axes Snapshot • Custom: Specifies a custom image size. Specify the image size in the Size field and Units list. • Size: Specifies the size of the figure snapshot in the format [w h] (width, height). This field is active only if you choose Custom in the Image size selection list. • Units: Specifies the units for the size of the figure snapshot. This field is active only if you choose Set image size in the Custom selection list. • Invert hardcopy: Sets the InvertHardcopy property of Handle Graphics figures.
-
10 Components — Alphabetical List • Max size: Specifies the maximum size of the snapshot in the format w h (width, height). This field is active only if you choose Zoom from the Scaling list. • Units: Specifies the units for the size of the snapshot. This field is active only if you choose Zoom or Fixed size in the Image size selection list. • Alignment: Only reports in PDF or RTF format support this property.
-
Chapter/Subsection Chapter/Subsection Group portions of report into sections with titles Description This component groups portions of the report into sections. Each section has a title and content. The following rules apply to this component: • Child components appear inside the section created by this component. • Selecting the Get title from first child component check box prevents this component from accepting paragraph-level children.
-
10 Components — Alphabetical List • Word (from template) • HTML (from template) • PDF (from template) 2 In the Chapter/Section properties dialog box, set Title to Custom. 3 Set Style Name to Custom. 4 In the Style Name text box, type a style name. To take effect, the style you specify must be defined in the template that you use to generate the report. For example, if you use a Word template that defines a Heading 2 style, you can enter Heading 2 as the style name.
-
Comment Comment Insert comment into XML source file created by report generation process Description This component inserts a comment into the XML source file created by the reportgeneration process. This comment is not visible in the generated report. This component can have children. Child components insert their output into the XML source file, but this does not appear in the generated report.
-
10 Components — Alphabetical List Class rptgen.
-
Empty Component Empty Component Group components to move, activate, or deactivate them, or create blank space in list Description This component does not insert anything into the generated report. It can have any component as a child. You can use it to group components together so that you can easily move, activate, or deactivate them, or create a blank space in a list.
-
10 Components — Alphabetical List Evaluate MATLAB Expression Evaluate specified MATLAB expression Description This component evaluates a specified MATLAB expression. You can include code and/or command-line output in the report. Properties • Insert MATLAB expression in report: Causes the MATLAB expression that this component evaluates to appear in the report. • Display command window output in report: Includes the command window output that results from the evaluation of the specified MATLAB expression.
-
Evaluate MATLAB Expression To stop report generation when an error occurs in the MATLAB code that you added, change the second and third lines of the following default error handling code, as described below: warningMessageLevel = 2; displayWarningMessage = true; failGenerationWithException = false; failGenerationWithoutException = false; To stop report generation and display an exception, change the default code to: displayWarningMessage = false; failGenerationWithException = true; To stop report genera
-
10 Components — Alphabetical List Figure Loop Apply child components to specified graphics figures Description This component applies each child component to specified figures in the report. For more information about working with this component, see “Logical and Looping Components”. Figure Selection • Include figures • Current figure only: Includes only the current figure in the report. • Visible figures: Loops on all visible figures.
-
Figure Loop • Create link anchor for each object in loop: Creates a hyperlink to the object in the generated report. Insert Anything into Report? Yes, inserts a section if you select the Create section for each object in loop option. Class rptgen_hg.
-
10 Components — Alphabetical List Figure Snapshot Insert snapshot of Handle Graphics figure into report Description This component inserts a snapshot of a Handle Graphics figure into the report. Format • Image file format: Specifies the image file format. Select Automatic HG Format to automatically choose the format best suited for the specified report output format. Otherwise, choose an image format that your output viewer can read. Automatic HG Format is the default option.
-
Figure Snapshot • JPEG medium quality image • JPEG low quality image • PNG 24-bit image • TIFF - compressed • TIFF - uncompressed • Windows metafile • Capture picture from screen: • Client area only: Captures a portion of the figure window. • Entire figure window: Captures the entire figure window. Print Options • Paper orientation: • Landscape • Portrait • Rotated • Use figure orientation: Uses the orientation for the figure, which you set with the orient command.
-
10 Components — Alphabetical List • Custom: Specifies a custom image size. Set the image size in the Size field and Units list. • Size: Specifies the size of the figure snapshot in the form w h (width times height). This field is active only if you choose Custom from the Image size selection list. • Units: Specifies units for the size of the figure snapshot. This field is active only if you choose Custom in the Image size selection list.
-
Figure Snapshot • Right • Left • Center • Title: Specifies a title for the figure: • Custom: Specifies a custom title. • Name: Specifies the figure name as the title. • Caption: Specifies text to appear under the snapshot. Insert Anything into Report? Yes. Image. Class rptgen_hg.
-
10 Components — Alphabetical List For Loop Iteratively execute child components Description This component functions like the MATLAB for loop, except that instead of executing a statement, it executes its child components. It must have at least one child component to execute. Loop Type The loop type can have incremented indices or a vector of indices. For more information on for loops and indices, see for in the MATLAB documentation.
-
For Loop Insert Anything into Report? No. Class rptgen_lo.
-
10 Components — Alphabetical List Graphics Object Loop Run child components for each Handle Graphics object open in MATLAB workspace Description This component runs its child components for each Handle Graphics object that is currently open in the MATLAB workspace. The component inserts a table into the generated report. Select Objects • Exclude GUI objects (uicontrol, uimenu, ...): Excludes graphical interface objects, such as uicontrol and uimenu, from the loop.
-
Graphics Object Loop Class rptgen_hg.
-
10 Components — Alphabetical List Handle Graphics Linking Anchor Designate location to which links point Description This component designates a location to which links point. It should have a looping component as its parent. Properties • Insert text: Specifies text to appear after the linking anchor. • Link from current: Sets the current model, system, block, or signal as the linking anchor: • Automatic: Automatically selects the appropriate figure, axes, or object as a linking anchor.
-
Handle Graphics Linking Anchor See Also Axes Loop, Axes Snapshot, Figure Loop, Figure Snapshot, Graphics Object Loop, Handle Graphics Name, Handle Graphics Parameter, Handle Graphics Property Table, Handle Graphics Summary Table 10-29
-
10 Components — Alphabetical List Handle Graphics Name Insert name of Handle Graphics object into the report Description This component inserts the name of a Handle Graphics object as text into the report. You can use this component to create a section title based on the current figure by making it the first child component of a Chapter/Subsection component, and then selecting the Chapter/Subsection component's Get title from first child component option.
-
Handle Graphics Name See Also Axes Loop, Axes Snapshot, Figure Loop, Figure Snapshot, Graphics Object Loop, Handle Graphics Linking Anchor, Handle Graphics Parameter, Handle Graphics Property Table, Handle Graphics Summary Table 10-31
-
10 Components — Alphabetical List Handle Graphics Parameter Insert property name/property value pair from Handle Graphics figure, axes, or other object Description This component inserts a property name/property value pair from a Handle Graphics figure, axes, or other object. Property Selection • Get property from current: Reports on a specified Handle Graphics object: • Figure: Inserts a figure's property name/property value pair. • Axes: Inserts an axes' property name/property value pair.
-
Handle Graphics Parameter • Auto table/paragraph: Displays as a table or paragraph. • Inline text: Displays in line with the surrounding text. • Paragraph: Displays as a paragraph. • Table: Displays as a table. • Ignore if value is empty: Excludes empty parameters from the generated report. Insert Anything into Report? Yes. Text. Class rptgen_hg.
-
10 Components — Alphabetical List Handle Graphics Property Table Insert table that reports on property name/property value pairs Description This component inserts a table that reports on property name/property value pairs. For more information on using this component, see “Property Table Components”. Select Graphics Object • Object type: Specifies an object type for the generated report: • Figure • Axes • Object • Filter by class: Specifies a class or classes for the table.
-
Handle Graphics Property Table To apply a preset table, select the table and click Apply. • Split property/value cells: Splits property name/property value pairs into separate cells. For the property name and property value to appear in adjacent horizontal cells in the table, select the Split property/value cells check box. In this case, the table is in split mode and there can be only one property name/property value pair in a cell.
-
10 Components — Alphabetical List • Double justified • Show as: Enables you to choose the format for the contents of the table cell. Options include: • Value • Property Value • PROPERTY Value • Property: Value • PROPERTY: Value • Property - Value • PROPERTY - Value • Alignment: Aligns text in the table cells. Options are: • Left • Center • Right • Double-justified • Lower border: Displays the lower border of the table in the generated report.
-
Handle Graphics Summary Table Handle Graphics Summary Table Insert table that summarizes Handle Graphics object properties Description This component inserts a table that summarizes Handle Graphics object properties. Each row in the table represents an object. Each column in the table represents a property. You can specify object properties to include in the report. Properties • Object type: Specifies the object type to display in the generated report.
-
10 Components — Alphabetical List Some entries in the list of available properties (such as Depth) are “virtual” properties which you cannot access using the get_param command. The properties used for property/value filtering in the block and system loop components must be retrievable by the get_param. Therefore, you cannot configure your summary table to report on all blocks of Depth == 2. • Remove empty columns: Removes empty columns from the table in the generated report.
-
Handle Graphics Summary Table • Loop type: • All axes: Loops on all axes objects. • Current axes: Loops on the selected axes object. • Exclude objects which subclass axes: Excludes objects such as legends and color bars. • Loop Menu: • Loop on axes with handle visibility "on": Loops on visible axes objects. • Loop on all axes: Loops on all axes objects. • Search terms: Specifies search terms for the loop. For example, to search for Tag and My Data, enter "Tag", "My Data".
-
10 Components — Alphabetical List See Also Axes Loop, Axes Snapshot, Figure Loop, Figure Snapshot, Graphics Object Loop, Handle Graphics Linking Anchor, Handle Graphics Name, Handle Graphics Parameter, Handle Graphics Property Table 10-40
-
Image Image Insert image from external file into report Description This component inserts an image from an external file into the report. It can have the Chapter/Subsection or Paragraph component as its parent. If the Paragraph component is its parent, you must select the Insert as inline image check box. Class • File name: Specifies the image file name. You can enter this name manually, or use the Browse button (...) to find the image file. The image must be in a format that your viewer can read.
-
10 Components — Alphabetical List • Use image size: Causes the image to appear the same size in the report as on screen (default). • Fixed size: Specifies the number and type of units. • Zoom: Specifies the percentage, maximum size, and units of measure. • Size: Specifies the size of the snapshot in the format w h (width, height). This field is active only if you choose Fixed size from the Scaling list. • Max size: Specifies the maximum size of the snapshot in the format w h (width, height).
-
Image Class rptgen.
-
10 Components — Alphabetical List Import File Import ASCII text file into report Description This component imports an ASCII text file into the report. Properties • File name: Specifies the name of the file to import into the text field. You can enter a name, or use the Browse button (...) to find the file. • Import file as: Specifies formatting for the imported file. Options include: • Plain text (ignore line breaks): Imports the file as plain text without any line breaks (no paragraphs).
-
Import File There is a blank line above the third row. • Paragraphs defined by empty rows: Imports the file as text, in paragraphs with empty rows (rows that include no text). This option produces the following formatting for the example file: This is the first row of text from the imported file. The second row follows a line break in the first row. There is a blank line above the third row. • Text (retain line breaks) (default): Imports the file as plain text with line breaks.
-
10 Components — Alphabetical List • Text (retain line breaks) • Fixed-width text (retain line breaks) • Inserts paragraphs if you select one of the following options: • Paragraphs defined by line breaks • Paragraphs defined by empty rows • Inserts the contents of an XML file if you select the DocBook XML option. • Inserts the contents of the RTF or HTML file if you select the Formatted text (RTF/ HTML) option. • Inserts a link to a file if you import the file into an HTML report. Class rptgen.
-
Insert Variable Insert Variable Insert variable values into report Description This component inserts the value (and, optionally, the name) of each the following variables into the report: • A variable from the MATLAB workspace • A variable from a MAT-file • A global variable • A variable that you specify directly Source • Variable name: Specifies the name of the variable: • %: Inserts the value of a variable from the MATLAB workspace into the report.
-
10 Components — Alphabetical List • Array size limit: Limits the width of the display in the generated report. Units are in pixels. The size limit for a given table is the hypotenuse of the table width and height [sqrt(w^2+h^2)]. The size limit of a given text string is the number of characters squared. If you exceed the size limit, the variable appears in condensed form, such as [64x64 double]. Setting a size limit of 0 displays the variable in full, regardless of its size.
-
Insert Variable See Also Evaluate MATLAB Expression, MATLAB Property Table, MATLAB/Toolbox Version Number, Variable Table 10-49
-
10 Components — Alphabetical List Link Insert linking anchors or pointers into report Description This component inserts linking anchors or pointers into the report. For a PDF report, if you open the report from MATLAB (for example, if you open the report right after generating it), the link does not work. However, if you open a PDF report outside of MATLAB (for example, from Adobe Acrobat), the link works properly. Properties • Link type: Select the type of link to insert into the report.
-
Link • Emphasize link text: Italicizes the link text. Examples Link to an External Web Site 1 Open Report Explorer with the setedit command. 2 In the Properties pane on the right, click Create and edit a new report file. 3 In the Library pane in the middle, under the Formatting category, select the Text component and click the Add component icon. 4 In the Properties pane, enter Open the (add a blank space at the end of the string).
-
10 Components — Alphabetical List 8 Click the link to open the MathWorks Web site. Link to Another Place in a Report 1 At the MATLAB command line, enter setedit magic-square.rpt. 2 In the Outline pane on the left, select the Title Page component. 3 In the Library pane in the middle, under the Formatting category, select the Link component and click the Add component icon. 4 In the Properties pane: • Set Link type to Linking anchor. • In Link identifier, enter explanation.
-
Link • In Link text, enter For a detailed explanation, click here. (with the period). 9 Generate the report.
-
10 Components — Alphabetical List 10 Click the link to move to near the top of the report, to “Chapter 1. Magic Squares Explained.”.
-
Link Link to a Model This example shows how to add a link to a Simulink model. To view the model, you must have the Simulink software installed. 1 Open Report Explorer with the setedit command. 2 In the middle pane, click simulink-default_rptgensl_version.rpt. 3 In the Library pane in the middle, under the Formatting category, select the Paragraph component and click the Add component icon.
-
10 Components — Alphabetical List 7 Click the “Open model” link to open the model. Insert Anything into Report? Yes. Text or anchor. Class rptgen.
-
List List Create bulleted or numbered list from cell array or child components Description This component creates a bulleted or numbered list from a cell array or child components. List Content • Create list from workspace cell array: Creates the list from of the 1-byn or n-by-1 cell array. This option is not available when this component has child components — in this case, the list automatically generates from the child components. • List title: Specifies the title of the list.
-
10 Components — Alphabetical List • Numbered list. • Numbering style: Specifies a numbering style for numbered lists. This setting is supported only in the RTF/DOC report format. Options include: • 1,2,3,4,... • a,b,c,d,... • A,B,C,D,... • i,ii,iii,iv,... • I,II,III,IV,... • List style name: Specifies the style to use with the list. To specify a style, perform these steps.
-
List 1. Example 2. Example 1. Example 2. Example 1. Example 2. Example 3. Example This option is not available if you select Show parent number in nested list (1.1.a). Example 1: Creating a Nested List Consider the following report setup file, which includes a nested list created by putting a List component inside another List component: [-] Report - Unnamed.
-
10 Components — Alphabetical List • red • green • blue Use the following report setup file: [-] Report - Unnamed.rpt [-] Bulleted list from child components [ ] Text - red [ ] Text - green [ ] Text - blue Creating a List Using a Cell Array To generate the same bulleted list as in the previous example, configure a report setup file to call a cell array, colors: [-] Report - Unnamed.
-
Logical Else Logical Else Specify an else condition for a Logical If component Description This component acts as an else when it is the child of the Logical If component. You can specify this component in one of the following ways: • if then else • if then elseif elseif . . . else Properties If component has no children, insert text: Inserts specified text into your report when the Logical Else component has no child components. In this case, this component acts like the Text component.
-
10 Components — Alphabetical List See Also For Loop, Logical Elseif, Logical If, Logical Then, While Loop 10-62
-
Logical Elseif Logical Elseif Specify an elseif condition for a Logical If component Description This component acts as an elseif when it is the child of the Logical If component. You must specify this component as follows: if then elseif elseif . . . else Properties • Test expression: Specifies a MATLAB expression to evaluate. • If component has no children, insert text: Inserts the specified text into the report when the Logical Elseif component has no child components.
-
10 Components — Alphabetical List Logical If Specify logical if condition Description This component acts as a logical if; it can have the Logical Then, Logical Elseif, or Logical Else components as children components. This component executes its child components when the specified workspace expression is true. It displays a specified string when it has no child components. You can specify this component as follows: • if then • if then else • if then elseif elseif . . .
-
Logical If Class rptgen_lo.
-
10 Components — Alphabetical List Logical Then Specify a then condition for a Logical If component Description This component acts as a then when it is the child of the Logical If component. You can specify this component as follows: • if then • if then else • if then elseif elseif . . . else Attributes If component has no children, insert text: Inserts specified text into the report when the Logical Then component has no children. In this case, this component acts like the Text component.
-
Logical Then See Also For Loop, Logical Else, Logical Elseif, Logical If, While Loop 10-67
-
10 Components — Alphabetical List MATLAB Property Table Insert table that includes MATLAB object property name/property value pairs Description This component inserts a table that includes MATLAB object property name/property value pairs. Table Select a preset table, which is already formatted and set up, in the preset table list in the upper-left corner of the attributes page. • Preset table: Choose a type of table: • Default • Blank 4x4 To apply the preset table, select the table and click Apply.
-
MATLAB Property Table • Table Cells: Modifies table properties. The selection in this pane affects the available fields in the Cell Properties pane. Cell Properties Available options in the Cell Properties pane depend what you select for Table Cells. If you select Workspace Properties, only the Contents and Show options appear. If you select any other option, the Lower border and Right border options appear. • Contents: Modifies the contents of the table cell selected in the Table Cells pane.
-
10 Components — Alphabetical List Insert Anything into Report? Yes. Table. Class rptgen.
-
MATLAB/Toolbox Version Number MATLAB/Toolbox Version Number Insert table that shows version and release numbers and release date of MathWorks products Description Using the Table Filter, specify whether this component reports version information for all installed MathWorks products or just those products required for a model.
-
10 Components — Alphabetical List Table Columns • Version number: Includes the product version number (for example, 3.4) for all installed MathWorks products or for only those products required for a model or chart. or • Release number: Includes the MathWorks release number (for example, R2009b) for all installed MathWorks products or for only those products required for a model or chart.
-
Nest Setup File Nest Setup File Allow one report setup file (rpt file) to run inside another Description This component runs another report setup file at the point where the Nest Setup File component is located in the current report setup file. The components of the inserted report setup file are stored in the current report setup file at the same level as the Nest Setup File component. Thus, inserted components have the same parent component as the Nest Setup File component.
-
10 Components — Alphabetical List The Nest Setup File dialog box displays the report description of the nested report, if the nested report has a report description. Example In the following example, the report setup file R2 is nested in R1: [-] Report - R1.rpt [-] Report - R2.rpt [ ] Chapter [ ] 1 [-] B [ ] 2 [ ] Nest Setfile - R2.rpt [-] Chapter [ ] C [ ] 4 [ ] D [ ] 5 The generated report is identical to the one generated by the following report setup file: [-] Report - R1.
-
Paragraph Paragraph Insert paragraph text into report Description This component inserts a paragraph into the report. The paragraph text is taken from a child text component, or from text that you enter in the Paragraph Text field. Title Options • No paragraph title (default): Specifies no title for the paragraph. • Get title from first child: Gets the title of the paragraph from its first child component, which should be a Text component. • Custom title: Specifies a custom title for the paragraph.
-
10 Components — Alphabetical List to generate the report. For more information about template styles, see “Report Conversion Templates”. Paragraph Text Enter paragraph text into this field. If the Paragraph component has child components, the paragraph content is taken from the paragraph text and the child components; otherwise, the Paragraph component inserts text from this field.
-
Paragraph Style Note: If you use the Style Name field to specify a style for the paragraph text, the style formats below override the corresponding formats specified in the style. For example, selecting Bold makes the text bold, even if the specified style specifies regular weight text. • Bold: Makes the text bold. • Italic: Makes the text italic. • Underline: Underlines the text. • Strikethrough: Strikes through the text.
-
10 Components — Alphabetical List See Also Chapter/Subsection, Empty Component, Image, Link, List, Table, Text, Title Page 10-78
-
Stop Report Generation Stop Report Generation Halt report generation Description This component acts like Stop during report generation. You can use this component inside an if/then statement by using Logical and Flow Control components to halt the report-generation process when the specified condition is true. When report generation halts, an XML source file is created, but not converted.
-
10 Components — Alphabetical List Insert Anything into Report? No. Class rptgen.
-
Table Table Insert parent of table Description This component is a parent of a component hierarchy that you specify to insert a table into a report. Adding this component creates a hierarchy that defines a 2x2 table that you modify to define your specific table. Properties • Title: Specifies a title for the table. Enter text or %. If you specify a table title, text in the form Table #: precedes the table title. • Title style name: Specifies the style to use with the table title.
-
10 Components — Alphabetical List • Word (from template) • HTML (from template) • PDF (from template) 2 Set Table style name to Specify. 3 In the Table style name text box, type a style name. To take effect, the style you specify must be a table style in the template that you use to generate the report. For more information about template styles, see “Report Conversion Templates”. • Table width options: Determines the width of the table.
-
Table • Right: Aligns content with the right side of the column • Double justified: Justifies the left and right sides of the entry content, to avoid ragged left and right alignment To override this setting: • For a specific table column, use the Table Column Specification Entry horizontal alignment property. • For a specific table entry, use the Table Entry Horizontal alignment property.
-
10 Components — Alphabetical List See Also Table Body, Table Column Specification, Table Entry, Table Footer, Table Header, Table Row, Array-Based Table, Chapter/Subsection, Empty Component, Image, Link, List, Paragraph, Text, Title Page 10-84
-
Table Body Table Body Insert parent of table body Description This component is a parent of the rows that define the body of a table. This component must be a child of a Table component. Add Table Row components as children to define the content of the table body. Properties • Style Name: Specifies the style to use with the table body. To specify a style, perform these steps.
-
10 Components — Alphabetical List Insert Anything into Report? Yes. Table. Class rptgen.
-
Table Column Specification Table Column Specification Specify table column properties Description Specifies the format of a table column. Add a Table Column Specification component for only those columns that you do not want the default settings for the table. Properties • Column number: Specifies a column number for the column to which this column specification applies. Enter a number or %. Avoid using the same column number for two column specifications in the same table.
-
10 Components — Alphabetical List • Left: Aligns content with the left side of the column. • Center: Aligns content in the middle of the column. • Right: Aligns content with the right side of the column. • Double justified: Justifies the left and right sides the entry content, to avoid ragged left and ragged right alignment. To override this setting for a specific table entry, use the Table Entry Horizontal alignment property for that table entry.
-
Table Entry Table Entry Insert table entry Description Specifies the format of a table entry. This component must be a child of a descendant of a Table Row component. Add Paragraph, Image, List, and other components to define the content of the table entry.
-
10 Components — Alphabetical List • Row separator: Use this property to override the Row separator setting of the Table Row component for the row in which the table entry appears. • True: Draws a horizontal line at the bottom of the row, below the table entry. • False: Does not draw a horizontal line at the bottom of the row, below the table entry. • Background color: Specifies the background color of the table entry.
-
Table Entry Insert Anything into Report? Yes. Table. Class rptgen.
-
10 Components — Alphabetical List Table Footer Insert parent of table footer Description This component is a parent of the Table Row components that define a table footer. Properties • Style Name: Specifies the style to use with the table footer. To specify a style, perform these steps. 1 In the Report Options dialog box, set File format to one of these values: • Word (from template) • HTML (from template) • PDF (from template) 2 Set Style Name to Specify.
-
Table Footer Class rptgen.
-
10 Components — Alphabetical List Table Header Insert parent of table header Description This component is a parent of the Table Row components that define a table header. Properties • Style Name: Specifies the style to use with the table header. To specify a style, perform these steps. 1 In the Report Options dialog box, set File format to one of these values: • Word (from template) • HTML (from template) • PDF (from template) 2 Set Style Name to Specify.
-
Table Header Class rptgen.
-
10 Components — Alphabetical List Table Row Insert parent of table row entries Description This component is a parent of Table Entry components that define a table row. Properties • Entry vertical alignment: Positions the table entry content relative to the top and bottom of the table row in which the table entries appear. Use this property to override the Entry vertical alignment setting of the Table Header, Table Footer, or Table Body component in which the table row appears.
-
Table Row To override the text rotation for a specific table entry, use the Table Entry Text orientation property for that table entry. • Rotated text width: Specifies the width of table entry text that you rotate with the Text orientation property. Specify the text width in inches (in), picas (pi), or points (pt). To avoid truncating the rotated text, set the Rotated text width to a value that allows the display of the longest string in the table row.
-
10 Components — Alphabetical List Text Format and insert text into report Description This component formats and inserts text into the report. It must have the Paragraph component as its parent. Properties • Text to include in report: Specifies text to include in the report. • Style Name: Specifies the style to use with the text. To specify a style, perform these steps.
-
Text Example 1 Enter the following text: I have a % and it has % leaves. The word '%' has % letters. 2 Set ObjName = "plant" and NumLeaves = 3. 3 Generate the report. It looks as follows: I have a plant and it has 3 leaves. The word 'plant' has 5 letters. Style Note: If you use the Style Name field to specify a style for this text component, the style formats below override the corresponding formats specified in the style.
-
10 Components — Alphabetical List • Enter an RGB (truecolor) value as #RRGGBB. For example, #0000ff is a shade of blue. Insert Anything into Report? Yes. Text. Class rptgen.
-
Time/Date Stamp Time/Date Stamp Insert time and date of report generation into report Description This component inserts the time and date of the report generation into your report as text. It must have the Paragraph or Chapter/Subsection component as its parent. Prefix Include text before stamp : Includes text before the time/date stamp. Specify the text in the corresponding field. Time Stamp Properties • Include current time in stamp: Inserts the current time into the time/date stamp.
-
10 Components — Alphabetical List • Date order: Specifies the order in which the day, month, and year appear. Options include: • Day Month Year • Month Day Year • Year Month Day • Date separator: Specifies a separation marker between day, month, and year. Options include: • Blank space ( ): Displays date as Day Month Year • Colon (:): Displays date as Day:Month:Year • Slash (/): Displays date as Day/Month/Year • Period (.): Displays date as Day.Month.
-
Time/Date Stamp Class rptgen.
-
10 Components — Alphabetical List Title Page Insert title page at beginning of report Description This component inserts a title page at the beginning of the report. You can use it in a report setup file as a child of a Chapter/Subsection component or by itself. To use the Title Page component, you need to have a Chapter component in your report.
-
Title Page • No author: Does not specify an author name. • Automatic author: Automatically includes your user name as the author name. The author name appears under the subtitle, in a smaller font than the subtitle. • Include report creation date: Includes the date that the report is created. Choose the date format in the corresponding list. • Include copyright holder and year: Includes copyright holder and year information.
-
10 Components — Alphabetical List • Alignment: Only reports in PDF or RTF format support this property. Options include: • Auto • Right • Left • Center Abstract Tab • Abstract Text: Specifies an optional abstract for the report. • Style Name: Specifies the style to use with the abstract text. To specify a style, perform these steps.
-
Title Page • Italic: Makes the text italic. • Underline: Underlines the text. • Strikethrough: Strikes through the text. • Retain spaces and carriage returns: Formats the text in the generated report as you entered it. • Show text as syntax-highlighted MATLAB code: Shows the text as syntaxhighlighted MATLAB code. • Color: Specifies the color of the text. Legal Notice Tab • Legal Notice Text: Specifies an optional legal notice for the report.
-
10 Components — Alphabetical List • Bold: Makes the text bold. • Italic: Makes the text italic. • Underline: Underlines the text. • Strikethrough: Strikes through the text. • Retain spaces and carriage returns: Formats the text in the generated report as you entered it. • Show text as syntax-highlighted MATLAB code: Shows the text as syntaxhighlighted MATLAB code. • Color: Specifies the color of the text. Insert Anything into Report? Yes. Title page. Class rptgen.
-
Variable Table Variable Table Insert table that displays all the variables in the MATLAB workspace Description This component inserts a table that displays all the variables in the MATLAB workspace. Tip Find all the variables in the MATLAB workspace by typing whos at the command line. Source Workspace Read variables from: • Base workspace: Reads variables from the MATLAB workspace. • MAT-file: Reads variables from a binary file with a .mat extension. Use the % notation.
-
10 Components — Alphabetical List Note: Large variable arrays collapse to [MxN CLASS]. For example, if you have a 300-by-200 double array, it appears in the report as [300x200 DOUBLE]. Example The following is an example of a variable table that includes size, memory bytes, and value information in the table columns. Name Size Bytes Value aCell 1x2 238 { [ 1 2 3 4 ] Speed (kph) } aNumber 1x1 8 1 aString 1x11 22 Speed (kph) aStructure 1x1 302 [struct w/ fields.
-
While Loop While Loop Iteratively execute child components while a specified condition is true Description This component iteratively executes its child components while a specified condition is true. The While Loop component must have at least one child component; the purpose of this component is to run its children several times. If it does not have any children, this component does not add anything to the report. Tip Limit the number of repetitions to prevent infinite loops.
-
10 Components — Alphabetical List Class rptgen_lo.
-
11 Functions – Alphabetical List
-
11 Functions – Alphabetical List compwiz Create custom MATLAB Report Generator components Syntax compwiz compwiz ('–browse') compwiz ('–v1browse') compwiz (rptgen.cfr_list) Description The Create Component dialog box creates a framework for custom report components. For more information, see “Create Custom Components”. • compwiz with no arguments displays the Component Editor in the Report Explorer. • compwiz ('–browse') displays a list of components from which to derive a new component.
-
append append Class: mlreportgen.dom.Container Package: mlreportgen.dom Append DOM object to container Syntax domObjOut = append(containerObj,domObj) Description domObjOut = append(containerObj,domObj) appends the DOM object to the specified container object. Input Arguments containerObj — Container object to append DOM object to mlreportgen.dom.Container object Container object to append DOM object to, specified as an mlreportgen.dom.Container object.
-
11 Functions – Alphabetical List • mlreportgen.dom.HTML • mlreportgen.dom.HTMLFile • mlreportgen.dom.Image • mlreportgen.dom.InternalLink • mlreportgen.dom.LinkTarget • mlreportgen.dom.OrderedList • mlreportgen.dom.Paragraph • mlreportgen.dom.RawText • mlreportgen.dom.Table • mlreportgen.dom.Text • mlreportgen.dom.TemplateHole • mlreportgen.dom.
-
append • mlreportgen.dom.Paragraph • mlreportgen.dom.RawText • mlreportgen.dom.Table • mlreportgen.dom.Text • mlreportgen.dom.TemplateHole • mlreportgen.dom.UnorderedList Examples Append Content to Container Create a container object. import mlreportgen.dom.*; rpt = Document('MyReport','docx'); c = Container(); Append content to the container and append the container to the report. append(c,Paragraph('Hello')); append(c,Table(magic(5))); append(rpt,c); Close and generate the report.
-
11 Functions – Alphabetical List clone Class: mlreportgen.dom.Container Package: mlreportgen.dom Copy container object Syntax clonedContainer = clone(sourceContainer) Description clonedContainer = clone(sourceContainer) copies (clones) the specified container. Input Arguments sourceContainer — Container object to copy mlreportgen.dom.Container object Container object to copy, specified as an mlreportgen.dom.Container object. Output Arguments clonedContainer — Copied container object mlreportgen.dom.
-
clone import mlreportgen.dom.*; rpt = Document('MyReport','docx'); c = Container(); Color all of the text in this container red. c.Style = {Color('red')}; Append content to the container and append the container to the report. append(c,Paragraph('Hello')); append(c,Table(magic(5))); append(rpt,c); Clone the container. clonedC = clone(c); Append the cloned container to the report. append(rpt,clonedC); Close and generate the report. close(rpt); rptview(rpt.
-
11 Functions – Alphabetical List mlreportgen.dom.CustomElement.append Package: mlreportgen.dom Append HTML content to custom element Syntax customElementOut = append(customElementObj,domObj) Description customElementOut = append(customElementObj,domObj) appends an element to a custom element. Examples Append Text to a Custom Element This example shows how to add a custom element that provides a check box in an HTML report. Create and a custom element and append text to it. import mlreportgen.dom.
-
mlreportgen.dom.CustomElement.append append(d,ol); close(d); rptview('test','html'); • “Add Content to a Report” Input Arguments customElementObj — Custom element to append content to mlreportgen.dom.CustomElement object Custom element to append content to, specified as an mlreportgen.dom.CustomElement object. domObj — DOM object to append to custom element DOM object DOM object to append to the custom element. Output Arguments customElementOut — Appended custom element mlreportgen.dom.
-
11 Functions – Alphabetical List addHTML Class: mlreportgen.dom.Document Package: mlreportgen.dom Append HTML string to document Syntax htmlObjOut = addHTML(documentObj,htmlText) Description htmlObjOut = addHTML(documentObj,htmlText) converts a string of HTML text to a group of DOM objects and appends the group to the Document object documentObj. Input Arguments documentObj — Document to append content to mlreportgen.dom.Document object Document object to append content to, specified as an mlreportgen.
-
addHTML HTML object with appended content, returned as an mlreportgen.dom.HTML object. Examples Append HTML Text to Document Create an HTML object from HTML text to use for a Microsoft Word report. import mlreportgen.dom.*; rpt = Document('HTMLToWordReport','docx'); htmlObj = addHTML(rpt,... '
Hello World
'); Generate the Word report. close(rpt); rptview(rpt.OutputPath); • “Append HTML Content to DOM Reports” See Also mlreportgen.dom.HTML | mlreportgen.dom.
-
11 Functions – Alphabetical List addHTMLFile Class: mlreportgen.dom.Document Package: mlreportgen.dom Append HTML file contents to document Syntax documentObjOut = addHTMLFile(documentObj,htmlFilePath) Description documentObjOut = addHTMLFile(documentObj,htmlFilePath) appends HTML file contents to a document. Input Arguments documentObj — Document to append content to mlreportgen.dom.Document object Document object to append content to, specified as an mlreportgen.dom.Document object.
-
addHTMLFile Examples Append HTML File Contents to a Document In a text editor, create a file and enter this text:
My First HTML This is the first paragraph.
This is the second paragraph
Save the file in the MATLAB current folder as html_example.html. Create a Word report. import mlreportgen.dom.*; rpt = Document('HTMLReport','docx'); Append the HTML file content to the document.
-
11 Functions – Alphabetical List More About • “Appending HTML to DOM Reports” Introduced in R2015a 11-14
-
mlreportgen.dom.Document.append mlreportgen.dom.Document.append Package: mlreportgen.dom Append DOM or MATLAB object to document Syntax domObjOut domObjOut domObjOut domObjOut = = = = append(docObj,textContent) append(docObj,listContent) append(docObj,tableContent) append( ___ ,styleName) domObjOut = append(docObj,domObj) Description domObjOut = append(docObj,textContent) appends text or numbers to a document and returns a text element object.
-
11 Functions – Alphabetical List import mlreportgen.dom.*; d = Document('mydoc','html'); ol = OrderedList({'first step' 'second step' 'last step'}); append(d,ol); close(d); rptview('mydoc','html'); Specify a Style for Appended Text Use the Word Title style for the text. import mlreportgen.dom.*; d = Document('mydoc','docx'); append(d,'This Is a Title','Title'); close(d); rptview('mydoc','docx'); Append a Cell Array as a Table import mlreportgen.dom.
-
mlreportgen.dom.Document.append Example: myTextObj = append(myDocument,'This is an introduction') listContent — Items to append to the document as unordered list horizontal one-dimensional matrix | cell array Specify items to be displayed in an unordered list. Each matrix or cell-array element becomes a list item. For a matrix, use each element can be a numeric or Boolean value. For a cell array, each element can be: • A string • A number • A Boolean value • One of these DOM objects: • mlreportgen.dom.
-
11 Functions – Alphabetical List • A string • A number • A Boolean value • One of the following DOM objects: • mlreportgen.dom.Text • mlreportgen.dom.Paragraph • mlreportgen.dom.OrderedList • mlreportgen.dom.UnorderedList • mlreportgen.dom.Table • mlreportgen.dom.Image • mlreportgen.dom.
-
mlreportgen.dom.Document.append • mlreportgen.dom.HTML • mlreportgen.dom.Image • mlreportgen.dom.InternalLink • mlreportgen.dom.LinkTarget • mlreportgen.dom.OrderedList • mlreportgen.dom.Paragraph • mlreportgen.dom.RawText • mlreportgen.dom.Table • mlreportgen.dom.Text • mlreportgen.dom.UnorderedList Output Arguments domObjOut — Appended document element document element object Document element created and appended. One of the following DOM objects: • mlreportgen.dom.CustomElement • mlreportgen.dom.
-
11 Functions – Alphabetical List • mlreportgen.dom.Text • mlreportgen.dom.UnorderedList See Also mlreportgen.dom.
-
mlreportgen.dom.Document.close mlreportgen.dom.Document.close Package: mlreportgen.dom Close document Syntax close(docObj) Description close(docObj) closes a document. Once a document is closed, you can no longer append content to it. Closing the document outputs any remaining content, such as remaining template text. Examples Close a Document Close the myReport document. import mlreportgen.dom.
-
11 Functions – Alphabetical List Document to close, specified as an mlreportgen.dom.Document object. See Also mlreportgen.dom.Document | mlreportgen.dom.Document.
-
mlreportgen.dom.Document.createAutoNumberStream mlreportgen.dom.Document.createAutoNumberStream Package: mlreportgen.dom Create numbering stream Syntax streamOut = createAutoNumberStream(docObj,streamName) streamOut = createAutoNumberStream(docObj,streamName,streamType) streamOut = createAutoNumberStream(docObj,streamName,streamType, initialValue) Description streamOut = createAutoNumberStream(docObj,streamName) creates a numbering stream using Arabic numbers and an initial value of 0.
-
11 Functions – Alphabetical List p = Paragraph('Chapter '); p.Style = {CounterInc('chapter')}; p.WhiteSpace = 'pre'; append(p,AutoNumber('chapter')); append(myReport, p); end close(myReport); rptview(myReport.OutputPath,myReport.Type); • “Automatically Number Document Content” Input Arguments docObj — Document to apply numbering stream to mlreportgen.dom.Document object Document to apply numbering stream to, specified as an mlreportgen.dom.Document object.
-
mlreportgen.dom.Document.createAutoNumberStream Use a number, regardless of the type of stream. The initial value used by the stream depends on the type of stream. For example, if you set initialValue to 0: • Arabic numeral stream — 0 • Alphabetic stream — a or A • Roman numerals stream — i or I Data Types: double Output Arguments streamOut — Numbering stream mlreportgen.dom.AutoNumberStream object A numbering stream, represented by an mlreportgen.dom.AutoNumberStream object.
-
11 Functions – Alphabetical List mlreportgen.dom.Document.createTemplate Package: mlreportgen.dom Create DOM template Syntax createTemplate(path) createTemplate(path,type) Description createTemplate(path) creates a DOM template in the specified location. The file extension indicates whether to create a Microsoft Word template (.dotx) or an HTML template (.htmx). createTemplate(path,type) creates a template of the specified type at the specified path.
-
mlreportgen.dom.Document.createTemplate Input Arguments path — Path for new template string If you use the path argument without the type argument, for a Word template, include the .dotx extension and for an HTML template, include the .htmx extension. If you use both the path and type arguments, and path does not have an extension, the createTemplate method appends the appropriate extension (.dotx or .htmx).
-
11 Functions – Alphabetical List mlreportgen.dom.Document.fill Package: mlreportgen.dom Fill document holes with generated content Syntax fill() Description fill() fills the holes in a document with generated content. Use this method with a class derived from the mlreportgen.dom.Document class. Examples Add a fill Method to Invoke Hole-Specific fill Methods This example shows how to define a report that fills a CustomerName hole in a Word template.
-
mlreportgen.dom.Document.fill end methods function rpt = MyReport(filename,type,template) rpt = rpt@mlreportgen.dom.Document(filename,type,template); end function fillCustomerName(rpt) append(rpt,rpt.CustomerName); end end end Use the report. rpt = MyReport('mydoc','docx','CustomerLetter'); rpt.CustomerName = 'Mr. Smith'; fill(rpt); • “Add Content to a Report” More About Tips In the derived class, define fill methods to insert content for each hole in the template.
-
11 Functions – Alphabetical List mlreportgen.dom.Document.getAutoNumberStream Package: mlreportgen.dom Return numbering stream Syntax autoNumStreamOut = getAutoNumberStream(docObj,streamName) Description autoNumStreamOut = getAutoNumberStream(docObj,streamName) returns the specified numbering stream used by the document. Examples Return a Numbering Stream import mlreportgen.dom.
-
mlreportgen.dom.Document.getAutoNumberStream Input Arguments docObj — Document that uses numbering stream mlreportgen.dom.Document object Document that uses the numbering stream, specified as an mlreportgen.dom.Document object. streamName — Name of numbering stream to return string Name of the numbering stream to return, specified as a string. Output Arguments autoNumStreamOut — Numbering stream used by document mlreportgen.dom.
-
11 Functions – Alphabetical List mlreportgen.dom.Document.getCoreProperties Package: mlreportgen.dom Get document or template core properties Syntax corePropertiesOut = getCoreProperties(path) Description corePropertiesOut = getCoreProperties(path) specifies the core OPC properties for the document or template having the specified path. Examples Return Core Properties of a Document import mlreportgen.dom.
-
mlreportgen.dom.Document.getCoreProperties LastModifiedBy: Revision: Subject: Title: Version: Tag: Id: '' '2' [] '' [] 'dom.CoreProperties:203' '203' Input Arguments path — Path to document or template string Path to the document or template, specified as a string. Output Arguments corePropertiesOut — Core properties of document or template mlreportgen.dom.CoreProperties object Core properties of the document or template, represented by an mlreportgen.dom.CoreProperties object.
-
11 Functions – Alphabetical List mlreportgen.dom.Document.getImageDirectory Package: mlreportgen.dom Get image folder of document Syntax imageDirectory = getImageDirectory(path,type) Description imageDirectory = getImageDirectory(path,type) gets the image folder of a document or template package located at the specified path and of the specified type (Microsoft Word or HTML). This is a static method. Invoke it on the Document class.
-
mlreportgen.dom.Document.getImageDirectory type — Type of document or package 'docx' | 'html' Type document or template. For a Word document or template, specify 'docx'. For an HTML document or template, specify 'html'. Output Arguments imageDirectory — Image folder of document string The path of the image folder for the package. More About • “Report Packages” See Also mlreportgen.dom.Document.getImagePrefix | mlreportgen.dom.Document.getOPCMainPart | mlreportgen.dom.Document.
-
11 Functions – Alphabetical List mlreportgen.dom.Document.getImagePrefix Package: mlreportgen.dom Get generated image name prefix Syntax imagePrefix = getImagePrefix(path,type) Description imagePrefix = getImagePrefix(path,type) gets the image name prefix of a document or template package located at the specified path and of the specified type (Microsoft Word or HTML). The DOM interface uses the prefix when generating internal names of images appended to the document. This is a static method.
-
mlreportgen.dom.Document.getImagePrefix Path of the document or template package type — Type of document or package 'docx' | 'html' Type document or template. For a Word document or template, specify 'docx'. For an HTML document or template, specify 'html'. Output Arguments imagePrefix — Image name prefix string The generated image name prefix. More About • “Report Packages” See Also mlreportgen.dom.Document.getImageDirectory | mlreportgen.dom.Document.getOPCMainPart | mlreportgen.dom.Document.
-
11 Functions – Alphabetical List mlreportgen.dom.Document.getMainPartPath Package: mlreportgen.dom Return path of main part of document output package Syntax pathOut = getMainPartPath(docObj) Description pathOut = getMainPartPath(docObj) returns the full path of the main part of the output package of the specified document. The main part is the file that contains the XML or HTML markup for a document.
-
mlreportgen.dom.Document.getMainPartPath Output Arguments pathOut — Path of main part of document output package string Path of the main part of document output package. More About • “Report Packages” See Also mlreportgen.dom.Document.getOPCMainPart | mlreportgen.dom.Document.setCoreProperties | mlreportgen.dom.
-
11 Functions – Alphabetical List mlreportgen.dom.Document.getOPCMainPart Package: mlreportgen.dom Return main part of document, document part, or template Syntax partOut = getOPCMainPart(path) partOut = getOPCMainPart(path,docType) Description partOut = getOPCMainPart(path) returns the path of the main part (file) of a package for a document, document part, or template, based on the specified path.
-
mlreportgen.dom.Document.getOPCMainPart mlreportgen.dom.Document.getOPCMainPart('MyDoc.htmx','html') ans = /root.html Input Arguments path — Path of document string If you use the path argument without the docType argument, include the .docx or .htmx extension. If you use both the path and docType arguments, getOPCMainPart appends an extension of the appropriate type (.docx or .htmx).
-
11 Functions – Alphabetical List • “Report Packages” See Also mlreportgen.dom.Document.getMainPartPath | mlreportgen.dom.Document.setCoreProperties | mlreportgen.dom.
-
mlreportgen.dom.Document.moveToNextHole mlreportgen.dom.Document.moveToNextHole Package: mlreportgen.dom Move document append point to next template hole Syntax holeID = moveToNextHole(docObj) Description holeID = moveToNextHole(docObj) copies to the output document any text between the current hole and the next hole in the document template. DOM creates an mlreportgen.dom.RawText object for the text. This method makes the next hole the current hole and returns the ID of that hole.
-
11 Functions – Alphabetical List Output Arguments holeID — Template hole ID hole ID The ID of the template hole that the method moves to (the new current hole). Data Types: char More About Tips The first time you invoke the moveToNextHole method, the DOM copies to the output document all of the text up to the first hole in the template. Use Document.append methods to add content to the output document to fill the first hole.
-
mlreportgen.dom.Document.open mlreportgen.dom.Document.open Package: mlreportgen.dom Open document Syntax open(docObj) Description open(docObj) opens a document for appending content. Examples Open a Document import mlreportgen.dom.*; myReport = Document('myDoc','html'); open(myReport); • “Add Content to a Report” Input Arguments docObj — Document to open mlreportgen.dom.Document object Document to open, specified as an mlreportgen.dom.Document object.
-
11 Functions – Alphabetical List More About Tips • After you open a document, you can no longer change its generated document type or the template. • The append method for a document opens a document if the document is not already opened. Therefore, you rarely need to use the open method. See Also mlreportgen.dom.Document | mlreportgen.dom.Document.
-
mlreportgen.dom.Document.package mlreportgen.dom.Document.package Package: mlreportgen.dom Add OPC part files to document package Syntax partOut = package(docObj,opcPart) Description partOut = package(docObj,opcPart) adds a file specified by an OPC part object to the OPC package of a document. Examples Add Files to a Document Package This example shows how to use the package method to add special browser processing code. In this example, the processData.js file operates on the data.json file.
-
11 Functions – Alphabetical List Document OPC package to add files to, specified as an mlreportgen.dom.Document object. opcPart — OPC part that specifies file to add to OPC package mlreportgen.dom.OPCPart object Define an OPCPart object to specify the files to add. Output Arguments partOut — Added OPC part file mlreportgen.dom.OPCPart object Added OPC part file, represented by an mlreportgen.dom.OPCPart object. More About • “Report Packages” See Also mlreportgen.dom.Document.
-
mlreportgen.dom.Document.setCoreProperties mlreportgen.dom.Document.setCoreProperties Package: mlreportgen.dom Set OPC core properties of output document or template Syntax corePropertiesOut = setCoreProperties(path,corePropertiesObj) Description corePropertiesOut = setCoreProperties(path,corePropertiesObj) sets the core OPC property values of the document or template having the specified path.
-
11 Functions – Alphabetical List Path of document, document part, or template, specified as a string. corePropertiesObj — OPC core properties to use mlreportgen.dom.CoreProperties object OPC core properties to use, specified as an mlreportgen.dom.CoreProperties object. Output Arguments corePropertiesOut — OPC core properties mlreportgen.dom.CoreProperties object OPC core properties, represented by an mlreportgen.dom.CoreProperties object. More About • “Report Packages” See Also mlreportgen.dom.
-
mlreportgen.dom.ExternalLink.append mlreportgen.dom.ExternalLink.append Package: mlreportgen.dom Append custom element to external link Syntax externalLinkObjOut = append(externalLinkObj,text) externalLinkObjOut = append(externalLinkObj,text,styleName) externalLinkObjOut = append(externalLinkObj,domObj) Description externalLinkObjOut = append(externalLinkObj,text) appends a Text object constructed from the specified text string to the link.
-
11 Functions – Alphabetical List Text to append, specified as a string. styleName — Name of style to apply to appended text string string The style to use with the appended text. The style defines the appearance of the document element in the output document. Use a style that is defined in the stylesheet of the template of the document you append content to. domObj — DOM object to append mlreportgen.dom.Text object | mlreportgen.dom.Image object | mlreportgen.dom.
-
mlreportgen.dom.FormalTable.appendFooterRow mlreportgen.dom.FormalTable.appendFooterRow Package: mlreportgen.dom Append row to table footer Syntax rowObjOut = appendFooterRow(tableObj,rowObj) Description rowObjOut = appendFooterRow(tableObj,rowObj) appends a row of table entries to the footer of a table. Examples Append a Table Footer Create, format, and append a formal table. import mlreportgen.dom.*; myReport = Document('myDoc','html'); table = FormalTable({'row1 - col1' 'row1 - col2 ';...
-
11 Functions – Alphabetical List footerRow = appendFooterRow(table,rowForFooter); close(myReport); rptview('myDoc','html'); • “Create and Format Tables” Input Arguments tableObj — Table mlreportgen.dom.FormalTable object Table that contains the footer to append a row to. rowObj — Row to append to table footer mlreportgen.dom.TableRow object Row to append to the table footer, specified as an mlreportgen.dom.TableRow object. Output Arguments rowObjOut — Row appended to table footer mlreportgen.dom.
-
mlreportgen.dom.FormalTable.appendHeaderRow mlreportgen.dom.FormalTable.appendHeaderRow Package: mlreportgen.dom Append row to table header Syntax rowObjOut = appendHeaderRow(tableObj,rowObj) Description rowObjOut = appendHeaderRow(tableObj,rowObj) appends a row of table entries to the header of this table. Examples Append a Table Header Create a formal table. import mlreportgen.dom.*; myReport = Document('myDoc','html'); table = FormalTable({'row1 - col1' 'row1 - col2 ';...
-
11 Functions – Alphabetical List headerRow = appendHeaderRow(table,rowForHeader); close(myReport); rptview('myDoc','html'); • “Create and Format Tables” Input Arguments tableObj — Table mlreportgen.dom.FormalTable object Table that contains the header to append a row to. rowObj — Row to append to table header mlreportgen.dom.TableRow object Row to append to the table header, specified as an mlreportgen.dom.TableRow object. Output Arguments rowObjOut — Row appended to table header mlreportgen.dom.
-
mlreportgen.dom.Group.append mlreportgen.dom.Group.append Package: mlreportgen.dom Add DOM object to group Syntax domObjOut = append(groupObj,domObj) Description domObjOut = append(groupObj,domObj) appends a DOM object to a group. Use groups to append a set of document elements together. Examples Append a Paragraph to a Group import mlreportgen.dom.*; myReport = Document('myDoc','html'); x = 0:pi/100:2*pi; y = sin(x); plot1 = plot(x,y); saveas(plot1,'plot1.png') plotimage = Image('plot1.
-
11 Functions – Alphabetical List Input Arguments groupObj — Group object to append DOM object to mlreportgen.dom.Group object Group object to append the DOM object to, specified as an mlreportgen.dom.Group object. domObj — DOM document element object to append DOM object You can append the following DOM objects: • mlreportgen.dom.CustomElement • mlreportgen.dom.DocumentPart • mlreportgen.dom.FormalTable • mlreportgen.dom.Group • mlreportgen.dom.ExternalLink • mlreportgen.dom.HTML • mlreportgen.dom.
-
mlreportgen.dom.Group.append You can append the following DOM objects: • mlreportgen.dom.CustomElement • mlreportgen.dom.DocumentPart • mlreportgen.dom.FormalTable • mlreportgen.dom.Group • mlreportgen.dom.ExternalLink • mlreportgen.dom.HTML • mlreportgen.dom.HTMLFile • mlreportgen.dom.Image • mlreportgen.dom.InternalLink • mlreportgen.dom.LinkTarget • mlreportgen.dom.OrderedList • mlreportgen.dom.Paragraph • mlreportgen.dom.RawText • mlreportgen.dom.Table • mlreportgen.dom.TemplateHole • mlreportgen.dom.
-
11 Functions – Alphabetical List append Class: mlreportgen.dom.HTML Package: mlreportgen.dom Append HTML string to HTML object Syntax htmlObjOut = append(htmlObj,htmlText) htmlObjOut = append(htmlObj,htmlObjToAppend) Description htmlObjOut = append(htmlObj,htmlText) converts HTML elements into DOM objects and appends the objects to htmlObj. htmlObjOut = append(htmlObj,htmlObjToAppend) appends the htmlObjToAppend object to htmlObj. Input Arguments htmlObj — HTML object to append content to mlreportgen.
-
append Output Arguments htmlObjOut — HTML object with appended content an mlreportgen.dom.HTML object HTML object with appended content, returned as an mlreportgen.dom.HTML object. Examples Append HTML text to an HTML Object Create an HTML object from HTML text, to use for a Microsoft Word report. import mlreportgen.dom.*; rpt = Document('HTML2WordReport','docx'); htmlObj = HTML('
Hello World
'); Append content to the HTML object.
-
11 Functions – Alphabetical List clone Class: mlreportgen.dom.HTML Package: mlreportgen.dom Copy HTML object Syntax clonedHTMLObj = clone(sourceHTMLObj) Description clonedHTMLObj = clone(sourceHTMLObj) copies (clones) the specified HTML object, including its children. Input Arguments sourceHTMLObj — HTML object to copy mlreportgen.dom.HTML object HTML object to copy, specified as an mlreportgen.dom.HTML object. Output Arguments clonedHTMLObj — HTML object with appended content an mlreportgen.dom.
-
clone import mlreportgen.dom.*; rpt = Document('ClonedHTMLReport','docx'); htmlObj1 = HTML('
Hello World
'); Append the HTML object to the report. append(rpt,htmlObj1); Copy the HTML object and append the copy to the report. htmlObj2 = clone(htmlObj1); append(rpt,htmlObj2); Generate the report. close(rpt); rptview(rpt.OutputPath); • “Append HTML File Contents to DOM Reports” See Also mlreportgen.dom.HTML | mlreportgen.dom.
-
11 Functions – Alphabetical List append Class: mlreportgen.dom.HTMLFile Package: mlreportgen.dom Append HTML to HTMLFile object Syntax htmlFileObjOut = append(htmlFileObj,htmlText) htmlFileObjOut = append(htmlFileObj,htmlObjToAppend) Description htmlFileObjOut = append(htmlFileObj,htmlText) converts HTML elements into DOM objects and appends the objects to htmlFileObj. htmlFileObjOut = append(htmlFileObj,htmlObjToAppend) appends the htmlObjToAppend object to htmlFileObj.
-
append HTML object to append, specified as an mlreportgen.dom.HTML object. htmlFileObjToAppend — HTMLFile object to append mlreportgen.dom.HTMLFile object HTMLFile object to append, specified as an mlreportgen.dom.HTMLFile object. Output Arguments htmlFileObjOut — HTMLFile object with appended content an mlreportgen.dom.HTMLFile object HTMLFileObj object with appended content, returned as an mlreportgen.dom.HTMLFile object.
-
11 Functions – Alphabetical List See Also mlreportgen.dom.HTML | mlreportgen.dom.
-
mlreportgen.dom.LinkTarget.append mlreportgen.dom.LinkTarget.append Package: mlreportgen.dom Append content to link target Syntax textObj = append(targetObj,text) textObj = append(targetObj,text,styleName) textObj = append(targetObj,textObj) autoNumberObj = append(targetObj,autoNumberObj) Description textObj = append(targetObj,text) converts text to an mlreportgen.dom.Text object, appends the text to the link target, and returns the text object.
-
11 Functions – Alphabetical List append(d,target); append(d,InternalLink('home','Go to Top'); close(d); rptview('mydoc', 'html'); Append an Automatically Generated Number to a Link Target import mlreportgen.dom.* d = Document('mydoc','docx'); number = AutoNumber('paragraph'); target = LinkTarget('para'); append(target,'number'); InternalLink('para','Link to paragraph'); q = Paragraph('This paragraph is not linked to.
-
mlreportgen.dom.LinkTarget.append styleName — Name of style string Name of style, specified as a string. textObj — Text object containing the text to append mlreportgen.dom.Text object Text object containing the text to append, specified as an mlreportgen.dom.Text object. autoNumberObj — Automatically generated number mlreportgen.dom.AutoNumber object Automatically generated number, specified as an mlreportgen.dom.AutoNumber object. Output Arguments textObj — Text object mlreportgen.dom.
-
11 Functions – Alphabetical List mlreportgen.dom.MessageDispatcher.dispatch Package: mlreportgen.dom Dispatch DOM status message Syntax dispatch(dispatcher,message) Description dispatch(dispatcher,message) dispatches a DOM status message. Examples Add and Dispatch a Progress Message This example shows how to add a progress message to display when generating a report. Add a dispatcher and listener to the report. import mlreportgen.dom.*; doctype = 'html'; d = Document('test',doctype); d.
-
mlreportgen.dom.MessageDispatcher.dispatch close(d); rptview('test',doctype); delete (l); Check the progress messages in the MATLAB Command Window. The starting chapter message appears, in addition to the predefined DOM progress messages. • “Display Report Generation Messages” Input Arguments dispatcher — DOM message dispatcher mlreportgen.dom.MessageDispatcher object DOM message dispatcher, specified as an mlreportgen.dom.MessageDispatcher object.
-
11 Functions – Alphabetical List mlreportgen.dom.MessageDispatcher.getTheDispatcher Package: mlreportgen.dom Return DOM message dispatcher Syntax getTheDispatcher Description getTheDispatcher returns the DOM message dispatcher. There is only one DOM message dispatcher per MATLAB session. Examples Add a Dispatcher and Dispatch a Progress Message This example shows how to return the DOM message dispatcher and use it to dispatch a progress message. Add a dispatcher and listener to the report.
-
mlreportgen.dom.MessageDispatcher.getTheDispatcher append(d, p); close(d); rptview('test',doctype); delete (l); Check the progress messages in the MATLAB Command Window. The starting chapter message appears, in addition to the predefined DOM progress messages. • “Display Report Generation Messages” See Also mlreportgen.dom.MessageDispatcher.dispatch | mlreportgen.dom.MessageEventData | mlreportgen.dom.
-
11 Functions – Alphabetical List mlreportgen.dom.OrderedList.append Package: mlreportgen.dom Append content to ordered list Syntax listOut = append(orderedList,listItemObj) listOut = append(orderedList,listItems) listOut = append(orderedList,list) customElementOut = append(orderedList,customElementObj) Description listOut = append(orderedList,listItemObj) appends a list item to an ordered list. listOut = append(orderedList,listItems) appends matrix or a cell array of list items.
-
mlreportgen.dom.OrderedList.append close(myReport); rptview('myDoc','html'); Append an Unordered List import mlreportgen.dom.*; myReport = Document('myDoc','html'); ol = OrderedList({'Item 1' 'Item 2'}); append(myReport,ol); ulist = UnorderedList({'subitem1' 'subitem2'}); append(ol,ul); close(myReport); rptview('myDoc','html'); Append an Ordered Sublist import mlreportgen.dom.
-
11 Functions – Alphabetical List Ordered list to append content to, specified as an mlreportgen.dom.OrderedList object. listItemObj — List item to append mlreportgen.dom.ListItem object List item to append, specified as an mlreportgen.dom.ListItem object. listItems — Items to append matrix | cell array A matrix can include numeric or Boolean values. Cell array containing a combination of the following: • A string • A number • A Boolean value • One of the following DOM objects: • mlreportgen.dom.
-
mlreportgen.dom.OrderedList.append The custom element must be a valid HTML or Word child of a list, depending on whether the output type of the document to which this element is appended is HTML or Word. Output Arguments listOut — Ordered list mlreportgen.dom.OrderedList object Ordered list, represented by an mlreportgen.dom.OrderedList object. customElementOut — Custom element mlreportgen.dom.CustomElement object Custom element, represented by an mlreportgen.dom.CustomElement object.
-
11 Functions – Alphabetical List mlreportgen.dom.Paragraph.append Package: mlreportgen.dom Append content to paragraph Syntax paraObjOut = append(paraObj,text) paraObjOut = append(paraObj,text,styleName) paraObjOut = append(paraObj,domObj) Description paraObjOut = append(paraObj,text) creates a text object containing the specified text string and appends it to a paragraph. paraObjOut = append(paraObj,text,styleName) creates and appends a text object using the specified style.
-
mlreportgen.dom.Paragraph.append rptview('mydoc','html'); Specify a Style for Appended Text import mlreportgen.dom.*; doc = Document('mydoc','docx'); para = Paragraph('Results: ','Title'); para.WhiteSpace = 'pre'; append(doc,para); append(para,'Study 2'); close(doc); rptview('mydoc','docx'); Append an External Link import mlreportgen.dom.*; docLink = Document('mydocLink','html'); mathWorksLink = ExternalLink... ('http://www.mathworks.
-
11 Functions – Alphabetical List styleName — Name of a style to apply to text string Name of the style to define the appearance of the text. Use a style that is in the stylesheet of the document that contains the paragraph. domObj — Document element to append to paragraph DOM object You can append the following types of document element object to a paragraph: • mlreportgen.dom.ExternalLink • mlreportgen.dom.Image • mlreportgen.dom.InternalLink • mlreportgen.dom.LinkTarget • mlreportgen.dom.
-
mlreportgen.dom.Paragraph.clone mlreportgen.dom.Paragraph.clone Package: mlreportgen.dom Copy paragraph object Syntax clonedPara = clone(sourcePara) Description clonedPara = clone(sourcePara) copies (clones) the specified paragraph. The resulting cloned paragraph includes the children of the source paragraph, but not the parent. Examples Copy a Paragraph Object import mlreportgen.dom.*; myReport = Document('myDoc','html'); para1 = Paragraph('This is a paragraph'); para1.
-
11 Functions – Alphabetical List Underline: WhiteSpace: FontFamilyName: FontSize: Strike: HAlign: OuterLeftMargin: FirstLineIndent: StyleName: Style: CustomAttributes: Children: Parent: Tag: Id: • [] [] [] [] [] [] [] [] [] {[1x1 mlreportgen.dom.Bold]} [] [1x1 mlreportgen.dom.Text] [] 'dom.Paragraph:15' '15' “Add Content to a Report” Input Arguments sourcePara — Paragraph object to copy mlreportgen.dom.Paragraph object Paragraph object to copy, specified as an mlreportgen.dom.Paragraph object.
-
mlreportgen.dom.Paragraph.clone • When you clone a paragraph, DOM copies all of the children objects of the source paragraph, but not the parent of the paragraph. • The cloned paragraph includes formats that you set in the source paragraph. The cloned paragraph formats use the same format objects as the source paragraph. If you change the format setting in the shared format object, the source and cloned paragraphs reflect that change.
-
11 Functions – Alphabetical List p.Italic ans = 1 3 For the cloned paragraph, change turn off bold text. The change to the Bold format in the cloned paragraph does not affect the text for the source paragraph. The source paragraph text is still bold. pClone.Bold = false; p.Bold ans = 1 4 In the style object (MyStyle) for the source paragraph, turn off italics. Now the cloned paragraph does not use italics, because it shares the MyStyle setting for the Italics format. MyStyle(2).Value = false pClone.
-
mlreportgen.dom.ProgressMessage.formatAsHTML mlreportgen.dom.ProgressMessage.formatAsHTML Package: mlreportgen.dom Wrap message in HTML tags Syntax htmlMessageOut = formatAsHTML(message) Description htmlMessageOut = formatAsHTML(message) returns the message text formatted with HTML tags. Examples Format a Message as HTML This example uses formatAsHTML with the Web command to display the progress messages. import mlreportgen.dom.*; doctype = 'html'; d = Document('test',doctype); d.
-
11 Functions – Alphabetical List append(d,p); close(d); rptview('test',doctype); delete (l); • “Display Report Generation Messages” Input Arguments message — Progress message mlreportgen.dom.ProgressMessage object Progress message, specified as an mlreportgen.dom.ProgressMessage object. Output Arguments htmlMessageOut — Progress message with HTML tagging mlreportgen.dom.ProgressMessage object Progress message with HTML tagging, specified as an mlreportgen.dom.ProgressMessage object.
-
mlreportgen.dom.ProgressMessage.formatAsText mlreportgen.dom.ProgressMessage.formatAsText Package: mlreportgen.dom Format message as text Syntax textMessageOut = formatAsText(message) Description textMessageOut = formatAsText(message) returns the message text formatted as text. Examples Format a Message with White Spaces This example uses formatAsText with the Web command to display the progress messages. import mlreportgen.dom.*; doctype = 'html'; d = Document('test',doctype); d.
-
11 Functions – Alphabetical List append(d,p); close(d); rptview('test',doctype); delete(l); • “Display Report Generation Messages” Input Arguments message — The DOM progress message mlreportgen.dom.ProgressMessage object The DOM message, specified as an mlreportgen.dom.ProgressMessage object. Output Arguments textMessageOut — DOM progress message formatted as text mlreportgen.dom.ProgressMessage object DOM progress message formatted as text, represented by an mlreportgen.dom.ProgressMessage object.
-
mlreportgen.dom.ProgressMessage.passesFilter mlreportgen.dom.ProgressMessage.passesFilter Package: mlreportgen.dom Determine if message passes filter Syntax tf = passesFilter(message,filter) Description tf = passesFilter(message,filter) determines whether the message passes the filter. Examples Determine Whether a Message Passes a Filter This example shows how to add a progress message to display when generating a report. Add a dispatcher and listener to the report.
-
11 Functions – Alphabetical List p.Tag = 'chapter title'; p.Style = { CounterInc('chapter'),... CounterReset('table'),WhiteSpace('pre') }; append(p,AutoNumber('chapter')); append(d,p); Generate the report and delete the listener. close(d); rptview('test','html'); delete(l); Check the progress messages in the MATLAB Command Window. In addition to the predefined DOM progress messages, the starting chapter message added in this example appears. The output also includes debug messages.
-
mlreportgen.dom.ProgressMessage.passesFilter See Also mlreportgen.dom.MessageFilter | mlreportgen.dom.
-
11 Functions – Alphabetical List mlreportgen.dom.Table.entry Package: mlreportgen.dom Access table entry Syntax tableEntryOut = entry(tableObj,row,column) Description tableEntryOut = entry(tableObj,row,column) returns the table entry for the specified column of the specified row. Examples Color a table entry Color the table entry in row 3, column 4. import mlreportgen.dom.*; myReport = Document('myDoc','html'); t = Table(magic(5)); t.entry(3,4); t.entry(3,4).Children(1).
-
mlreportgen.dom.Table.entry row — Table row containing the entry number Index number of the row (top row is row 1). Data Types: double column — Column containing the entry number Index number of the column (in a left-to-right text flow table, the left-most column is 1). Data Types: double Output Arguments tableEntryOut — Table entry object mlreportgen.dom.TableEntry object See Also mlreportgen.dom.Table.row | mlreportgen.dom.
-
11 Functions – Alphabetical List mlreportgen.dom.Table.row Package: mlreportgen.dom Access table row Syntax tableRowOut = row(tableObj,row) Description tableRowOut = row(tableObj,row) returns the table row at the specified row number. Examples Color a Table Row Color the second row of a table. import mlreportgen.dom.*; myReport = Document('myDoc','html'); t = Table(magic(5)); te = row(t,2); te.
-
mlreportgen.dom.Table.row Table containing the entry, specified as an mlreportgen.dom.Table or mlreportgen.dom.FormalTable object. row — Table row number Index number of the row (top row is row 1). Data Types: double Output Arguments tableRowOut — Table row object mlreportgen.dom.TableRow object Table row object, represented by an mlreportgen.dom.TableRow object. See Also mlreportgen.dom.TableEntry | mlreportgen.dom.
-
11 Functions – Alphabetical List mlreportgen.dom.TableRow.append Package: mlreportgen.dom Append content to table row Syntax entryOut = append(rowObj,entryObj) Description entryOut = append(rowObj,entryObj) appends an entry to a table row. Examples Append a Table Entry to a Row Create a two-column table. import mlreportgen.dom.*; myReport = Document('myDoc','html'); table = Table(2); table.Style = {Border('solid'),RowSep('solid'),ColSep('solid')}; table.
-
mlreportgen.dom.TableRow.append end Append the table and display the report. append(myReport,table); close(myReport); rptview('myDoc','html'); • “Create and Format Tables” Input Arguments rowObj — Row to append the table entry to mlreportgen.dom.TableRow object Row to append the table entry to, specified as an mlreportgen.dom.TableRow object. entryObj — Table entry to append mlreportgen.dom.TableEntry object Table entry to append, specified as an mlreportgen.dom.TableEntry object.
-
11 Functions – Alphabetical List report Generate reports from report setup file Syntax report report (filename,...) report ( ___ ,-oOPATH) report ( ___ ,-fFORMAT) report ( ___ ,-genOption1,...) [report1, report2, ...] = report (rptfile1, rptfile2, ...) Description • report with no arguments opens the Report Explorer. For more information on the Report Explorer, see “Report Explorer” • report (filename,...) generates a report from the specified report setup files.
-
report • -graphical — Shows hierarchy in Report Explorer • -debug — Enables debug mode • -quiet — Sets error echo level to 0 • -sSTYLESHEETNAME — Sets stylesheet name (not required when choosing format) • [report1, report2, ...] = report (rptfile1, rptfile2, ...) returns the names of the generated reports. If the MATLAB Report Generator software cannot generate a given report, its returned name is empty.
-
11 Functions – Alphabetical List More About • “Generate Reports” See Also setedit | rptconvert | rptlist | compwiz 11-100
-
rptconvert rptconvert Convert DocBook XML files into supported document formats Syntax rptconvert() rptname = rptconvert (source) rptname = rptconvert (source, format) rptname = rptconvert (source, format, stylesheet) ...=rptconvert(...,'-view') ...=rptconvert(...,'-quiet') ...=rptconvert(...
-
11 Functions – Alphabetical List format is a unique identifier code for each output format type. If you omit this argument, the XML file is converted to HTML format by default. stylesheet is a unique identifier for a given stylesheet. If you omit this argument, the default stylesheet for the selected format is used. You can also pass the following flags to the input arguments: • ...=rptconvert(...,'-view') displays the converted document. • ...=rptconvert(...,'-quiet') suppresses status messages. • ...
-
rptlist rptlist Retrieve list of all report setup files in MATLAB path Syntax rptlist rptlist ('system_name') list = rptlist Description rptlist with no arguments opens the Report Explorer, which lists available report setup files in the MATLAB path. rptlist ('system_name') opens the Report Explorer with the Simulink system's ReportName property selected. list = rptlist returns a list of report setup files in the MATLAB path.
-
11 Functions – Alphabetical List rptview Display DOM report Syntax rptview(reportPath) rptview(reportPath,'pdf') rptview(reportName,format) Description rptview(reportPath) displays the report reportPath in an appropriate viewer, based on the file extension. You can use the Document.OutputPath property to specify reportPath. rptview(reportPath,'pdf') converts a Word report to PDF and displays the report in a PDF viewer.
-
rptview rptview('mydoc.htmx'); Convert a Word Report and Display It in a PDF Viewer Use the rptview function to convert a Word report to PDF and display it in a PDF viewer. import mlreportgen.dom.*; d = Document('mydoc','docx'); p = Paragraph('Hello World'); append(d,p); close(d); rptview('mydoc.docx','pdf'); Display Report Using the OutputPath Property Display a report using the value of the OutputPath property of the mlreportgen.dom.Document object of the report. import mlreportgen.dom.
-
11 Functions – Alphabetical List close(dWord); rptview('mydoc','docx'); Input Arguments reportPath — Report file path including file extension string Path to a specific report file, including the file extension, specified as a string. The report file name extension determines the viewer in which the report displays. File Extension Viewer .htmx MATLAB Web browser .zip MATLAB Web browser .docx The report displays in Microsoft Word unless you add the 'pdf' argument after reportPath.
-
setedit setedit Start Report Explorer Syntax setedit (filename) Description setedit (filename) opens the Report Explorer and loads the report setup file named filename. If a file with the specified name does not exist, Report Explorer opens an empty report setup file with that name.
-
11 Functions – Alphabetical List unzipTemplate Unzip zipped DOM template Syntax unzipTemplate(zippedTemplatePath) unzipTemplate(zippedTemplatePath,unzippedTemplatePath) Description unzipTemplate(zippedTemplatePath) unzips the DOM template zip file specified by zippedTemplatePath into a subfolder of the folder that contains the zipped template. unzipTemplate(zippedTemplatePath,unzippedTemplatePath) unzips the DOM template into the folder specified by unzippedTemplatePath.
-
unzipTemplate If you do not include a file extension in the path, the function assumes the extension is .htmtx. If you do not use the unzippedTemplatePath argument, the unzipTemplate function unzips the template into a subfolder of the folder that contains the zipped template. The name of the unzipped template folder is the same as the root name of the zipped template. The root name is the zipped template name without its file extension.
-
11 Functions – Alphabetical List zipTemplate Package DOM HTML template in zip file Syntax zipTemplate(unzippedTemplateFolder) zipTemplate(zippedTemplate,unzippedTemplateFolder) zipTemplate(zippedTemplate,unzippedTemplateFolder,mainDocument) zipTemplate(zippedTemplate,unzippedTemplateFolder,mainDocument, partTemplates) Description zipTemplate(unzippedTemplateFolder) zips (compresses and puts in a zip file) the unzipped DOM template in unzippedTemplateFolder.
-
zipTemplate root.html and your document part template library file, if it exists, is in a file called docpart_templates.html. zipTemplate(zippedTemplate,unzippedTemplateFolder,mainDocument, partTemplates) zips the unzipped DOM template into the file specified by zippedTemplate. Use this syntax when the unzipped template includes a document part template library file whose file name is not docpart_templates.html.
-
11 Functions – Alphabetical List Full path for the zipped DOM template, including the file extension .htmtx, specified as a string. mainDocument — Name of main document file string Main document file name, including the file extension, specified as a string. partTemplates — Document part library file name string Document part library file name, including the file extension, specified as a string. More About Tips • If you created the unzipped template by unzipping a template created by using mlreportgen.
-
zipTemplate If the unzipped template stores images in a folder other than one named images in the root folder of the template, include a text file called _imgprefix in the folder that contains images for the unzipped template. In the _imgprefix file, you can include a prefix for the DOM interface to use to generate names images appended to documents. For example, if the _imgprefix file contains the prefix graphic, the generated image names are graphic1.png, graphic2.png, and so on.
-
-
12 Classes – Alphabetical List
-
12 Classes – Alphabetical List mlreportgen.dom.AllowBreakAcrossPages class Package: mlreportgen.dom Allow row to straddle page break Description Specifies whether to allow row to straddle page break. This format applies only to Word documents. Construction breakAcrossPagesObj = AllowBreakAcrossPages() allows a row to flow onto the next page when it cannot fit entirely on the current page.
-
mlreportgen.dom.AllowBreakAcrossPages class Properties Id — ID for document element string A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Tag — Tag for document element string Tag for document element, specified as a string. 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.
-
12 Classes – Alphabetical List mlreportgen.dom.AutoNumber class Package: mlreportgen.dom Automatically generated number Description Automatically generated number for a DOM document element object. Construction autoObj = AutoNumber() creates an automatically generated number without a specified number stream. autoObj = AutoNumber(stream) creates a number based on the specified numbering steam. autoObj = AutoNumber(stream,styleName) creates a number using the specified style.
-
mlreportgen.dom.AutoNumber class Name of number style defined in the template, specified as a string. The style specified by styleName must be defined in the template used to create the document to which the number is appended. Output Arguments autoObj — Automatically created number object mlreportgen.dom.AutoNumber object Automatically created number object, specified as an mlreportgen.dom.AutoNumber object.
-
12 Classes – Alphabetical List • The name of a color. The name must be a CSS color name. See http:// www.crockford.com/wrrrld/color.html. • A hexadecimal RGB (truecolor) value as #RRGGBB. For example, #0000ff is a shade of blue. CustomAttributes — Custom attributes of document element array of mlreportgen.dom.CustomAttribute objects HTML or Microsoft Word must support the custom attributes of this document element. FontFamilyName — Name of font family for text string The name of a font family.
-
mlreportgen.dom.AutoNumber class • pt — points • px — pixel Id — ID for document element string A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Italic — Option to use italics for a number [] (default) | logical value To use italics for a number, set this property to true. If this property is empty and the StyleName property for this document element specifies a style sheet style, the slant of the number is determined by that style.
-
12 Classes – Alphabetical List The style specified by styleName must be defined in the template used to create the document element to which this number is appended. Tag — Tag for document element string Tag for document element, specified as a string. 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.
-
mlreportgen.dom.AutoNumber class Border String Description Supported Output Types single Single line HTML and Word thick Thick line Word wave Wavy line Word waveyDouble Double wavy line Word waveyHeavy Heavy wavy Word words Underline non-space characters only Word If this property is empty and StyleName property of this document element specifies a style sheet style, the type of underline is determined by that style.
-
12 Classes – Alphabetical List Border String Description Supported Output Types pre Preserves white space. Text HTML wraps only on line breaks. Acts like the
tag in HTML. pre-line Sequences of white space collapse into a single white space. Text wraps. pre-wrap Preserves white space.
-
mlreportgen.dom.AutoNumber class doctype = 'html'; d = Document('test',doctype); p = Paragraph('Chapter '); p.Style = {CounterInc('chapter'),CounterReset('table'),WhiteSpace('preserve')}; append(p,AutoNumber('chapter')); append(d,p); p = Paragraph('Table '); append(p,AutoNumber('chapter')); append(p,'.'); append(p,AutoNumber('table')); p.Style = {CounterInc('table'),WhiteSpace('preserve')}; append(d,p); p = Paragraph('Chapter '); p.
-
12 Classes – Alphabetical List mlreportgen.dom.AutoNumberStream class Package: mlreportgen.dom Numbering stream Description A numbering stream generates a sequence of numbers for numbering chapters, tables, figures, and other document objects. To create a numbering stream object, use the mlreportgen.dom.Document.createAutoNumberStream method.
-
mlreportgen.dom.AutoNumberStream class The value of this property should be one less than the number that you want to be generated first. For example, if you want the number of the first item to be numbered by this stream to be 2, set the value of this property to 1. StreamName — Name of numbering stream string Name of numbering stream, specified as a string. Tag — Tag for document element string Tag for document element, specified as a string.
-
12 Classes – Alphabetical List mlreportgen.dom.BackgroundColor class Package: mlreportgen.dom Background color of document element Description Specifies the background color of a document element Construction backgroundColorObj = BackgroundColor() creates a white background. backgroundColorObj = BackgroundColor(colorName) creates a background color object based on the specified CSS color name.
-
mlreportgen.dom.BackgroundColor class Background color for a report object, represented by a mlreportgen.dom.BackgroundColor object Properties HexValue — Hexadecimal color value (read-only) string Hexadecimal number representing an RGB color value. For example, '#8b008b' specifies dark magenta. You can use either uppercase or lowercase letters as part of a hexadecimal value. Id — ID for document element string A session-unique ID is generated as part of document element creation.
-
12 Classes – Alphabetical List Examples Create and Apply a Background Color Create a deep sky blue background color object and apply it to a paragraph. Instead of specifying the CSS color name 'DeepSkyBlue', you could use the hexadecimal value '#00bfff'. import mlreportgen.dom.*; doctype = 'html'; d = Document('test', doctype); blue = 'DeepSkyBlue'; % blue = '#00BFFF'; colorfulStyle = {Bold, Color(blue), BackgroundColor('Yellow')}; p = Paragraph('deep sky blue paragraph with yellow background'); p.
-
mlreportgen.dom.Bold class mlreportgen.dom.Bold class Package: mlreportgen.dom Bold for text object Description Specifies whether to use bold for a text object Construction boldObj = Bold() creates a bold object that specifies to use bold for a text object. boldObj = Bold(value) creates a bold object that specifies to use bold for a text object if value is true. Otherwise, creates a bold object that specifies to use regular weight text.
-
12 Classes – Alphabetical List A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Tag — Tag for document element string Tag for document element, specified as a string. 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.
-
mlreportgen.dom.Bold class rptview('test',doctype); See Also mlreportgen.dom.
-
12 Classes – Alphabetical List mlreportgen.dom.Border class Package: mlreportgen.dom Border properties of object Description Specifies the border properties of an object. Construction borderObj = Border() creates an unspecified border. borderObj = Border(style) creates a border having the specified style. borderObj = Border(style,color) creates a border having the specified style and color. borderObj = Border(style,color,width) creates a border having the specified style, color, and width.
-
mlreportgen.dom.
-
12 Classes – Alphabetical List You can specify: • The name of a color. The name must be a CSS color name. See http:// www.crockford.com/wrrrld/color.html. • A hexadecimal RGB (truecolor) value as #RRGGBB. For example, #0000ff is a shade of blue. width — Width of border string String specifying the width of the border. String must have the format valueUnits where Units is an abbreviation for the units in which the width size is expressed.
-
mlreportgen.dom.Border class • A hexadecimal RGB (truecolor) value as #RRGGBB. For example, #0000ff is a shade of blue. Id — ID for document element string A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Style — Default style of border segments string For details, see the description of the style input argument for the mlreportgen.dom.Border constructor.
-
12 Classes – Alphabetical List • px — pixel BottomColor — Bottom border segment color string Bottom border segment color, specified as a string. BottomStyle — Bottom border segment style string Bottom border segment style, specified as a string. BottomWidth — Bottom border segment width string Bottom border segment width, specified as a string. TopColor — Top border segment color string Top border segment color, specified as a string.
-
mlreportgen.dom.Border class Left border segment width, specified as a string. RightColor — Right border segment color string Right border segment color, specified as a string. RightStyle — Right border segment style string Right border segment style, specified as a string. RightWidth — Right border segment width string Right border segment width, specified as a string. Examples Format Table Borders import mlreportgen.dom.*; doctype = 'html'; d = Document('test', doctype); t = Table(magic(5)); t.
-
12 Classes – Alphabetical List mlreportgen.dom.BorderCollapse class Package: mlreportgen.dom Collapse HTML table borders Description Specifies whether to collapse table borders. This applies only to HTML tables. Construction borderCollapseObj = BorderCollapse() creates an unspecified format. Nothing is inserted in the generated table markup. borderCollapseObj = BorderCollapse(value) creates a border collapse object having the specified value.
-
mlreportgen.dom.BorderCollapse class A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Tag — Tag for document element string Tag for document element, specified as a string. 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.
-
12 Classes – Alphabetical List p = Paragraph('Separate Borders'); append(d,p); table = Table(magicArray); table.Style = {Border('solid'),BorderCollapse('off')}; for r = 1:5 for c = 1:5 table.entry(r,c).Style = {Border('solid')}; end end append(d,table); close(d); rptview(d.OutputPath,doctype); • “Create and Format Tables” See Also mlreportgen.dom.Border | mlreportgen.dom.TableColSpec | mlreportgen.dom.TableEntry | mlreportgen.dom.
-
mlreportgen.dom.CharEntity class mlreportgen.dom.CharEntity class Package: mlreportgen.dom Create character entity reference Description Create a reference to a character entity reference. Construction charEntityObj = CharEntity() creates a reference to a non-breaking space ( ) entity. Appending this reference to a document causes a nonbreaking space to be inserted. charEntityObj = CharEntity(name) creates a reference to the character entity specified by name.
-
12 Classes – Alphabetical List Output Arguments charEntityObj — Reference to a character entity mlreportgen.dom.CharEntity object Reference to a character entity, represented by an mlreportgen.dom.CharEntity object. Properties BackgroundColor — Background color string Specify one of these as a string: • The name of a color. The name must be a CSS color name. See http:// www.crockford.com/wrrrld/color.html. • A hexadecimal RGB (truecolor) value as #RRGGBB. For example, #0000ff is a shade of blue.
-
mlreportgen.dom.CharEntity class Content — Text string contained by this document element string Text string contained by this document element. CustomAttributes — Custom attributes of document element array of mlreportgen.dom.CustomAttribute objects HTML or Microsoft Word must support the custom attributes of this document element. FontFamilyName — Name of font family for text string The name of a font family. To specify substitutions for this font, do not set this property.
-
12 Classes – Alphabetical List • pi — picas • pt — points • px — pixel Id — ID for document element string A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Italic — Option to use italics for number logical value To use italics for a number, set this property to true. If this property is empty and the StyleName property for this document element specifies a style sheet style, the slant of the number is determined by that style.
-
mlreportgen.dom.CharEntity class • double — Use a double line for strikethrough for Word documents Setting the Strike property adds a corresponding mlreportGen.dom.Strike format object to the Style property for this document element. Removing the Strike property setting removes the object. Style — Number formatting array of mlreportgen.dom.DOCXSection objects An array of mlreportgen.dom.DOCXSection objects that specifies the format for the number.
-
12 Classes – Alphabetical List Border String Description Supported Output Types dashDotDotHeavy Line with heavy dashes with two dots between the dashes Word dashDotHeavy Heavy dash-dot line Word dotted Dotted line Word dottedHeavy Thick dotted line Word dotDash Dot-dash line Word dotDotDash Dot-dot-dash line Word dashDotHeavy Heavy dot-dash line Word double Double line Word none Do not use underlining HTML and Word single Single line HTML and Word thick Thick line Word
-
mlreportgen.dom.CharEntity class To specify how to handle white space, use one of the following strings. Border String Description Supported Output Types normal Does not preserve white space and line breaks Word and HTML nowrap Sequences of white space collapse into a single white space. Text never wraps to the next line. HTML preserve Preserves white space. Text Word and HTML wraps only on line breaks. See below for details. Acts like the
tag in HTML. pre Preserves white space.
-
12 Classes – Alphabetical List Method Purpose Use CharEntity.append in a similar way to how you use ExternalLink.append. clone Clone this character entity. Use CharEntity.clone in a similar way to how you use Paragraph.clone. Examples Append a British Pound Sign import mlreportgen.dom.*; doctype = 'html'; d = Document('test',doctype); p = Paragraph(CharEntity('pound')); append(d,p); append(p,'3'); close(d); rptview('test',doctype); Append Two Nonbreaking Spaces import mlreportgen.dom.
-
mlreportgen.dom.
-
12 Classes – Alphabetical List mlreportgen.dom.Color class Package: mlreportgen.dom Color of document element Description Specifies the color of a document element. Construction colorObj = Color() creates a black color object. colorObj = Color(colorName) creates a color object based on the specified CSS color name. colorObj = Color(rgbValue) creates a color object using the hexidecimal RGB color value. Input Arguments colorName — Name of color string Name of a color. The name must be a CSS color name.
-
mlreportgen.dom.Color class Color for document element, represented by an mlreportgen.dom.Color object. Properties HexValue — hexidecimal color value (read-only) string Hexadecimal number representing an RGB color value. For example, '#8b008b' specifies dark magenta. You can use either uppercase or lowercase letters as part of a hexadecimal value. Id — ID for document element string A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID.
-
12 Classes – Alphabetical List import mlreportgen.dom.*; doctype = 'html'; d = Document('test',doctype); colorfulStyle = {Bold,Color('blue')}; p = Paragraph('deep sky blue paragraph'); p.Style = colorfulStyle; append(d,p); close(d); rptview('test',doctype); See Also mlreportgen.dom.
-
mlreportgen.dom.ColSep class mlreportgen.dom.ColSep class Package: mlreportgen.dom Draw lines between table columns Description Draw lines between table columns. Construction colSepObj = ColSep() creates unspecified column separators. colSepObj = ColSep(style) creates a column separator of the specified style. colSepObj = ColSep(style,color) creates a column separator having the specified style and color.
-
12 Classes – Alphabetical List String Applies To DOCX 'dashsmallgap' X 'dotted' X 'dotdash' X 'dotdotdash' X 'double' X 'doublewave' X 'inset' X X 'none' X X 'outset' X X 'single' X 'thick' X 'thickthinlargegap' X 'thickthinmediumgap' X 'thickthinsmallgap' X 'thinthicklargegap' X 'thinthickmediumgap' X 'thinthicksmallgap' X 'thinthickthinlargegap' X 'thinthickthinmediumgap' X 'thinthickthinsmallgap' X 'threedemboss' X 'threedengrave' X 'triple' X 'wave'
-
mlreportgen.dom.ColSep class You can specify: • The name of a color. The name must be a CSS color name. See http:// www.crockford.com/wrrrld/color.html. • A hexadecimal RGB (truecolor) value as #RRGGBB. For example, #0000ff is a shade of blue. width — Width of column separator in the table string String specifying the color of the table column separator. String must have the format valueUnits where Units is an abbreviation for the units in which the width size is expressed.
-
12 Classes – Alphabetical List • A hexadecimal RGB (truecolor) value as #RRGGBB. For example, #0000ff is a shade of blue. Id — ID for document element string A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Style — Format for separator array of format objects Array of format objects (such as Bold objects) that specify the format for the separator.
-
mlreportgen.dom.ColSep class • mm — millimeters • pi — picas • pt — points • px — pixel Data Types: char Examples Specify Table Column Formatting Set the width and color of the first column of a table. import mlreportgen.dom.* doc = Document('myTableColReport','docx'); grps(1) = TableColSpecGroup; grps(1).Span = 1; grps(1).Style = {Color('red'),Width('1in')}; table = Table(magic(5)); table.
-
12 Classes – Alphabetical List mlreportgen.dom.Container class Package: mlreportgen.dom Container of document objects Description Creates a container element. Use the mlreportgen.dom.Container.append method to append document elements to the container. Use an mlreportgen.dom.Container object in an HTML or Microsoft Word report to apply formats to all of the children of the container.
-
mlreportgen.dom.Container class • Use a group object to append the same content in multiple places in a document without cloning the group. Construction containerObj = Container() creates a container with an HTML tag name div. containerObj = Container(HTMLtag) creates a container with the specified HTML tag name (for example, div, section, or article). Input Arguments HTMLtag — HTML container tag name string HTML container tag name, specified as a string.
-
12 Classes – Alphabetical List Children — Children of container cell array of mlreportgen.dom.Element objects This read-only property lists child elements that the container contains. HTMLTag — HTML tag name of container string HTML container tag name, specified as a string. The name must be an HTML element, such as 'div', 'section', or 'article'. Note: Word output ignores the HTML container tag.
-
mlreportgen.dom.Container class Tag for document element, specified as a string. 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. Specify your own tag value, for example, to make it easier to identify where an issue occurred during document generation.
-
12 Classes – Alphabetical List See Also mlreportgen.dom.
-
mlreportgen.dom.CoreProperties class mlreportgen.dom.CoreProperties class Package: mlreportgen.dom OPC core properties of document or template Description OPC core properties of a document or template. Construction corePropsObj = CoreProperties() creates an empty core properties object. Core properties are metadata stored in a document OPC package that describe various properties of the document. Windows Explorer displays some of the core properties when you select a document.
-
12 Classes – Alphabetical List Creator — Creator of document string Creator of a document, specified as a string. Description — Description of document string Description of a document, specified as a string. Id — ID for document element string A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Identifier — Identifier for document string Identifier for a document, specified as a string.
-
mlreportgen.dom.CoreProperties class Subject of a document, specified as a string. Tag — Tag for document element string Tag for document element, specified as a string. 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.
-
12 Classes – Alphabetical List mlreportgen.dom.CounterInc class Package: mlreportgen.dom Number stream counter incrementer Description Creates a numbering stream counter incrementer. Construction counterIncObj = CounterInc() creates an empty counter incrementer. counterIncObj = CounterInc(streamName) creates a counter incrementer for the specified numbering stream.
-
mlreportgen.dom.CounterInc class A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. StreamName — Numbering stream name string Numbering stream name, specified as a string. Tag — Tag for document element string Tag for document element, specified as a string. A session-unique ID is generated as part of document element creation.
-
12 Classes – Alphabetical List See Also mlreportgen.dom.AutoNumber | mlreportgen.dom.AutoNumberStream | mlreportgen.dom.
-
mlreportgen.dom.CounterReset class mlreportgen.dom.CounterReset class Package: mlreportgen.dom Reset numbering stream counter Description Reset a numbering stream counter. Construction counterResetObj = CounterReset() creates an empty counter reset object. counterResetObj = CounterReset(streamName) creates a counter resetter for the specified numbering stream.
-
12 Classes – Alphabetical List A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. StreamName — Numbering stream name string Numbering stream name, specified as a string. Tag — Tag for document element string Tag for document element, specified as a string. A session-unique ID is generated as part of document element creation.
-
mlreportgen.dom.CounterReset class p.Style = {CounterInc('chapter'),CounterReset('table'),... WhiteSpace('preserve')}; append(p,AutoNumber('chapter')); append(d,p); p = Paragraph('Table '); append(p,AutoNumber('chapter')); append(p,'.'); append(p, AutoNumber('table')); p.Style = {CounterInc('table'),WhiteSpace('preserve')}; append(d,p); close(d); rptview('test',doctype); • “Automatically Number Document Content” See Also mlreportgen.dom.AutoNumber | mlreportgen.dom.AutoNumberStream | mlreportgen.dom.
-
12 Classes – Alphabetical List mlreportgen.dom.CustomAttribute class Package: mlreportgen.dom Custom element attribute Description Custom element attribute. Construction customAttributeObj = CustomAttribute() creates an empty custom attribute. customAttributeObj = CustomAttribute(name) creates an attribute having the specified name. customAttributeObj = CustomAttribute(name,value) creates an attribute having the specified name and value.
-
mlreportgen.dom.CustomAttribute class Properties Id — ID for document element string A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Name — Attribute name string Attribute name, specified as a string. Tag — Tag for document element string Tag for document element, specified as a string. A session-unique ID is generated as part of document element creation.
-
12 Classes – Alphabetical List li = ListItem('Owl'); li.CustomAttributes = {CustomAttribute('data-animal-type','bird')}; append(ul,li); li = ListItem('Salmon'); li.CustomAttributes = {CustomAttribute('data-animal-type','fish')}; append(ul,li); li = ListItem('Tarantula'); li.CustomAttributes = {CustomAttribute('data-animal-type','spider')}; append(ul,li); append(d,ul); close(d); rptview('test','html'); See Also mlreportgen.dom.CustomElement | mlreportgen.dom.
-
mlreportgen.dom.CustomElement class mlreportgen.dom.CustomElement class Package: mlreportgen.dom Custom element of document Description Use a custom element to extend the DOM API. You can create a custom HTML or Microsoft Word element that provides functionality not yet included in the DOM API. Construction customElementObj = CustomElement() creates an empty element. customElementObj = CustomElement(name) creates a custom element having the specified name.
-
12 Classes – Alphabetical List HTML or Microsoft Word must support the custom attributes of this document element. Id — ID for document element string A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Name — Element name string Element name, specified as a string. Style — Format specification array of format objects This property is ignored. StyleName — Name of custom element style string This property is ignored.
-
mlreportgen.dom.CustomElement class Method Purpose clone Copy custom element. Use CustomElement.clone similar to how you use Paragraph.clone. Examples Create a Check Box Custom Element This example shows how to add a custom element that provides a check box in an HTML report. Create and a custom element and append text to it. import mlreportgen.dom.*; d = Document('test'); input1 = CustomElement('input'); input1.CustomAttributes = { CustomAttribute('type', 'checkbox'), ...
-
12 Classes – Alphabetical List mlreportgen.dom.CustomText class Package: mlreportgen.dom Plain text appended to custom element Description Plain text string to append to a custom element. Construction customTextObj = CustomText() creates an empty CustomText object. customTextObj = CustomText(text) creates a CustomText object containing the specified text string. Input Arguments text — Text string to append to custom element string Text specified as a string.
-
mlreportgen.dom.CustomText class A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Parent — Parent of document element DOM object This read-only property lists the parent of this document element. Tag — Tag for document element string Tag for document element, specified as a string. A session-unique ID is generated as part of document element creation.
-
12 Classes – Alphabetical List mlreportgen.dom.DebugMessage class Package: mlreportgen.dom Debugging message Description Creates debugging message text originating from the specified source object. Construction debugMsgObj = DebugMessage(text,sourceObject) creates a debugging message with the specified text, originating from the specified source object. Input Arguments text — Message text string The text to display for the message.
-
mlreportgen.dom.DebugMessage class A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Source — Source object message originates from a DOM object Source DOM object from which the message originates. Tag — Tag for document element string Tag for document element, specified as a string. A session-unique ID is generated as part of document element creation.
-
12 Classes – Alphabetical List import mlreportgen.dom.*; d = Document('test','html'); Create a message dispatcher. dispatcher = MessageDispatcher.getTheDispatcher; l = addlistener(dispatcher,'Message', ... @(src, evtdata) disp(evtdata.Message.formatAsText)); Dispatch the message. open(d); dispatch(dispatcher,DebugMessage('starting chapter',d)); Add report content. p = Paragraph('Chapter '); p.Tag = 'chapter title'; p.Style = { CounterInc('chapter'),...
-
mlreportgen.dom.Document class mlreportgen.dom.Document class Package: mlreportgen.dom Report definition document Description Create mlreportgen.dom.Document object that defines: • The type of output (HTML or Microsoft Word) • Where and how to store the output • The template to use To generate a PDF report, create a Word report and use the rptview function with the 'pdf' argument to convert the Word report to PDF. Construction documentObj = Document() creates an HTML document named Untitled.
-
12 Classes – Alphabetical List Full path of output file or folder for this document. If you do not specify a file extension, the extension is based on the document type (for example, .docx for Microsoft Word). When the document is open, you cannot set this property. What you specify for the path depends on the value of the PackageType property.
-
mlreportgen.dom.Document class Output Arguments documentObj — Report definition document mlreportgen.dom.Document object Report definition document, represented by an mlreportgen.dom.Document object. Properties Children — Children of this document cell array of mlreportgen.dom.Element objects This read-only property lists child elements that the document element contains. CurrentHoleId — Hole ID of current hole in document string This read-only property is the hole ID of the current hole in this document.
-
12 Classes – Alphabetical List only, then generating an output file using the same path as an existing output file causes an error. Data Types: logical HTMLHeadExt — Custom content for HTML header string Custom content for HTML header, specified as a string. Id — ID for document element string A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID.
-
mlreportgen.dom.Document class For unzipped packaging, the document output is stored in a folder having the root file name of the OutputPath property. For example, if the OutputPath is s:\docs\MyDoc, the output folder is s:\docs\MyDoc. If you set PackageType to both, generating the report produces zipped and unzipped output. Parent — Parent of document element DOM object This read-only property lists the parent of this document element.
-
12 Classes – Alphabetical List Type — Type of output 'html' (default) | 'docx' | 'html-file' Type of output, specified as 'html', 'docx' or 'html-file'.
-
mlreportgen.dom.Document class Method Purpose getOPCMainPart Get full path of main part of output document. moveToNextHole Move to next template hole. open Open this document. package Append file to OPC package of document. setCoreProperties Set core properties of document element. Examples Create a Word Document import mlreportgen.dom.*; d = Document('mydoc','docx'); p = Paragraph('Hello World'); append(d,p); close(d); rptview('mydoc_1.
-
12 Classes – Alphabetical List close(d); rptview(d.OutputPath); See Also mlreportgen.dom.
-
mlreportgen.dom.DocumentPart class mlreportgen.dom.DocumentPart class Package: mlreportgen.dom Document part Description This class defines a form that can be filled out and appended to a document or another document part of the same output type. Construction documentPartObj = DocumentPart() creates an HTML document part using the default HTML template. documentPart = DocumentPart(type) creates a document part of the specified type (for example, Microsoft Word).
-
12 Classes – Alphabetical List Type of output, specified as 'html', 'docx' or 'html-file'. • 'html'— HTML output • 'docx'— Word output • 'html-file'— HTML output, using a single file that contains the CSS, JavaScript, and images for the report If you specify a template using the templatePath input argument, the value for type must be consistent with that type of template. To generate a PDF report, create a Word report and use the rptview function with the 'pdf' argument to convert the Word report to PDF.
-
mlreportgen.dom.DocumentPart class Properties Children — Children of this document cell array of mlreportgen.dom.Element objects This read-only property lists child elements that the document element contains. CurrentHoleId — Hole ID of current hole in document string This read-only property is the hole ID of the current hole in this document. CurrentHoleType — Type of current hole string This read-only property is the type (inline or block) of the current template hole.
-
12 Classes – Alphabetical List 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. Specify your own tag value, for example, to make it easier to identify where an issue occurred during document generation.
-
mlreportgen.dom.DocumentPart class Method Purpose append Append document element to the document part. close Close this document part. createTemplate Create document part template. fill Fill document hole. getCoreProperties Get core properties of document part. getOPCMainPart Get full path of main part of output document. moveToNextHole Move to next template hole. open Open this document part. setCoreProperties Set core properties of document part. See Also mlreportgen.dom.
-
12 Classes – Alphabetical List mlreportgen.dom.DOCXPageFooter class Package: mlreportgen.dom Page footer definition for Microsoft Word document Description Add a footer to the first page of a section or to odd pages, even pages, or both. Construction docxPageFooterObj = DOCXPageFooter() creates an empty page footer based on the default Word template. docxPageFooterObj = DOCXPageFooter(pageType,templatePath) creates an empty page footer for the specified type of page based on the specified template.
-
mlreportgen.dom.DOCXPageFooter class • first— footer appears only on the first page of a section • even— footer appears on even pages in a section For example, to have a footer appear on the first page and on even pages, define two separate footers, one with pageType set to first and the other with pageType set to even. templatePath — Full path of footer template string To use a template other than the default Word template, specify a Word footer template.
-
12 Classes – Alphabetical List This read-only property for a Word document is a mlreportgen.dom.DOCXSection object that specifies the properties, as well as the headers and footers, of the current document section. In HTML documents, the value of this property is always []. CurrentHoleId — Hole ID of current hole in document string This read-only property is the hole ID of the current hole in this document.
-
mlreportgen.dom.DOCXPageFooter class Tag — Tag for document element string Tag for document element, specified as a string. 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. Specify your own tag value, for example, to make it easier to identify where an issue occurred during document generation.
-
12 Classes – Alphabetical List Method Purpose • Text • UnorderedList close Close footer. fill Fill template hole. moveToNextHole Move to next template hole. open Open footer. See Also mlreportgen.dom.DOCXPageHeader | mlreportgen.dom.
-
mlreportgen.dom.DOCXPageHeader class mlreportgen.dom.DOCXPageHeader class Package: mlreportgen.dom Page header definition for Microsoft Word document Description Add a header to the first page of a section or to odd pages, even pages, or both. Construction docxPageHeaderObj = DOCXPageHeader() creates an empty page header based on the default Word template. headerObj = DOCXPageHeader(pageType,templatePath) creates an empty page header for the specified type of page, based on the specified master template.
-
12 Classes – Alphabetical List For example, to have a header appear on the first page and on even pages, define two separate headers, one with pageType set to first and the other with pageType set to even. templatePath — Full path of header template string To use a template other than the default Word template, specify a Word header template. embeddedTemplateName — Embedded template name string An embedded template is a template that is embedded in a Word template.
-
mlreportgen.dom.DOCXPageHeader class This read-only property is the type (inline or block) of the current template hole. • An inline hole is for document elements that a paragraph element can contain: Text, Image, LinkTarget, ExternalLink, InternalLink, CharEntity, AutoNumber. • A block hole can contain a Paragraph, Table, OrderedList, UnorderedList, DocumentPart, and Group. CurrrentDOCXSection — The current section of Word document mlreportgen.dom.
-
12 Classes – Alphabetical List Tag for document element, specified as a string. 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. Specify your own tag value, for example, to make it easier to identify where an issue occurred during document generation.
-
mlreportgen.dom.DOCXPageHeader class Method Purpose close Close header. fill Fill template hole. moveToNextHole Move to next template hole. open Open header. See Also mlreportgen.dom.DOCXPageFooter | mlreportgen.dom.
-
12 Classes – Alphabetical List mlreportgen.dom.DOCXPageMargins class Package: mlreportgen.dom Page margins for Microsoft Word page layout Description Specifies the size of the page margins of a section of a Microsoft Word document. Construction docxPageMarginsObj = DOCXPageMargins() specifies default page margins, which are one inch for the top, bottom, left, and right margins, and one-half inch for the gutter, header, and footer margins.
-
mlreportgen.dom.DOCXPageMargins class • pi — picas • pt — points • px — pixels Footer — Footer size string Specify the size using the same format used for the Bottom property. Gutter — Gutter size string Specify the size using the same format used for the Bottom property. Header — Header size string Specify the size using the same format used for the Bottom property. Id — ID for document element string A session-unique ID is generated as part of document element creation.
-
12 Classes – Alphabetical List Specify your own tag value, for example, to make it easier to identify where an issue occurred during document generation. Top — Top margin size string Specify the size using the same format used for the Bottom property. Examples Reset Default Margins Reset the margins specified by the default DOM template. import mlreportgen.dom.*; d = Document('myreport','docx'); open(d); s = d.CurrentDOCXSection; s.PageMargins.Left = '.5in'; s.PageMargins.Right = '.
-
mlreportgen.dom.DOCXPageSize class mlreportgen.dom.DOCXPageSize class Package: mlreportgen.dom Size and orientation of pages in Microsoft Word document Description Specifies the height, width, and orientation of pages in a section of a Microsoft Word document. Construction docxPageSizeObj = DOCXPageSize() creates a page size object having default values of 8.5-by-11 inches and portrait orientation. docxPageSizeObj = DOCXPageSize(height,width) creates a portrait page having a specified height and width.
-
12 Classes – Alphabetical List • pi — picas • pt — points • px — pixels width — Width of page '8.5in' (default) | string The string must have the format valueUnits, where Units is an abbreviation for the units in which the width size is expressed.
-
mlreportgen.dom.DOCXPageSize class Properties Height — Height of pages in Word page layout section string String specifying the page height. The string must have the format valueUnits where Units is an abbreviation for the units in which the width size is expressed.
-
12 Classes – Alphabetical List 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. Specify your own tag value, for example, to make it easier to identify where an issue occurred during document generation. Width — Width of page '8.
-
mlreportgen.dom.DOCXPageSize class rptview('myreport','docx'); • “Report Formatting Approaches” See Also mlreportgen.dom.DOCXPageMargins | mlreportgen.dom.
-
12 Classes – Alphabetical List mlreportgen.dom.DOCXRawFormat class Package: mlreportgen.dom XML markup for array of Microsoft Word formats Description XML markup for an array of Microsoft Word formats. Construction docxRawFormatObj = DOCXRawFormat() creates an empty array of raw formats. Output Arguments docxRawFormatObj — XML markup for Word formats mlreportgen.dom.DOCXRawFormat object XML markup for Word formats, represented by an mlreportgen.dom.DOCXRawFormat object.
-
mlreportgen.dom.DOCXRawFormat class For information about XML markup for Word formats, see http://officeopenxml.com/ anatomyofOOXML.php. Tag — Tag for document element string Tag for document element, specified as a string. 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.
-
12 Classes – Alphabetical List mlreportgen.dom.DOCXSection class Package: mlreportgen.dom Page format and layout for Microsoft Word document section Description Use an mlreportgen.dom.DOCXSection object to define the page format, headers, and footers of a Word document section. If this is the first DOCXSection in a document, then it controls the page layout of all the document elements from the beginning of a document to this DOCXSection.
-
mlreportgen.dom.DOCXSection class A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. PageFooters — Page footers for this section array of mlreportgen.dom.DOCXPageFooter objects You can define up to three page footers for a section — one each for: • The first page of the section • Even pages • Odd pages PageHeaders — Page headers for this section array of mlreportgen.dom.
-
12 Classes – Alphabetical List Style — Formats defining section style array of format objects The formats you specify using this property override corresponding formats defined by the stylesheet style specified by the StyleName property. The DOM interface ignores formats that do not apply to this element. Tag — Tag for document element string Tag for document element, specified as a string. A session-unique ID is generated as part of document element creation.
-
mlreportgen.dom.DOCXSection class p = Paragraph('Hello World'); append(d,p); close(d); rptview('mydoc.docx'); See Also mlreportgen.dom.DocumentPart | mlreportgen.dom.DOCXPageFooter | mlreportgen.dom.DOCXPageHeader | mlreportgen.dom.DOCXPageMargins | mlreportgen.dom.DOCXPageSize | mlreportgen.dom.DOCXRawFormat | mlreportgen.dom.
-
12 Classes – Alphabetical List mlreportgen.dom.DOCXSubDoc class Package: mlreportgen.dom Reference to external Microsoft Word document Description Reference to external Microsoft Word document. Construction docxSubDocObj = DOCXSubDoc() creates an empty document reference. docxSubDocObj = DOCXSubDoc(path) creates a reference to a Word document at the specified path.
-
mlreportgen.dom.DOCXSubDoc class Path of Word document targeted by this reference, represented by an mlreportgen.dom.DOCXSubDoc object. Properties Id — ID for document element string A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Tag — Tag for document element string Tag for document element, specified as a string. A session-unique ID is generated as part of document element creation.
-
12 Classes – Alphabetical List Examples Append a Word Document to a Report import mlreportgen.dom.* info = Document('CompanyInfo','docx'); append(info,'XYZ, Inc., makes widgets.'); close(info); infoPath = info.OutputPath; rpt = Document('Report','docx'); open(rpt); append(rpt,Paragraph('About XYZ, Inc.')); append(rpt,DOCXSubDoc(infoPath)); close(rpt); rptview(rpt.OutputPath); See Also mlreportgen.dom.DocumentPart | mlreportgen.dom.
-
mlreportgen.dom.ErrorMessage class mlreportgen.dom.ErrorMessage class Package: mlreportgen.dom Error message Description Specifies error message text originating from a specified source object. Construction errorMsgObj = ErrorMessage(text,sourceObject) creates an error message with the specified text originating from the specified source object. Input Arguments text — Message text string The text to display for the message.
-
12 Classes – Alphabetical List A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Source — Source object from which the message originates a DOM object Source DOM object from which the message originates. Tag — Tag for document element string Tag for document element, specified as a string. A session-unique ID is generated as part of document element creation.
-
mlreportgen.dom.ErrorMessage class d = Document('test','html'); dispatcher = MessageDispatcher.getTheDispatcher; l = addlistener(dispatcher,'Message', ... @(src, evtdata) disp(evtdata.Message.formatAsText)); open(d); dispatch(dispatcher,ErrorMessage('invalid chapter',d)); p = Paragraph('Chapter '); p.Tag = 'chapter title'; p.Style = {CounterInc('chapter'),...
-
12 Classes – Alphabetical List mlreportgen.dom.ExternalLink class Package: mlreportgen.dom Hyperlink to a location outside of document Description Defines a hyperlink to a location outside of the document. Construction externalLinkObj = ExternalLink(target,linkText) creates a hyperlink to the specified target and having the specified link text. This constructor creates a text object (mlreportgen.dom.Text) to hold the link text.
-
mlreportgen.dom.ExternalLink class textObj — Text object containing link text mlreportgen.dom.Text object Text object containing link text, specified by an mlreportgen.dom.Text object. Output Arguments externalLinkObj — External link mlreportgen.dom.ExternalLink object External link, represented by an mlreportgen.dom.ExternalLink object. Properties CustomAttributes — Custom attributes of document element array of mlreportgen.dom.
-
12 Classes – Alphabetical List 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. Specify your own tag value, for example, to make it easier to identify where an issue occurred during document generation.
-
mlreportgen.dom.FirstLineIndent class mlreportgen.dom.FirstLineIndent class Package: mlreportgen.dom Indent first line of paragraph Description Indent first line of a paragraph. Construction firstLineIndentObj = FirstLineIndent() creates an empty first line indentation format object. firstLineIndentObj = FirstLineIndent(width) indents first line of paragraph by the specified amount.
-
12 Classes – Alphabetical List • pt — points • px — pixels style — Type of indentation string String specifying the style of indentation of the first line of the paragraph. • normal (default) — indent relative to the page margin • hanging — indent relative to the subsequent lines Output Arguments firstLineIndentObj — Indentation for first line of paragraph mlreportgen.dom.FirstLineIndent object Indentation for first line of paragraph, represented by an mlreportgen.dom.FirstLineIndent object.
-
mlreportgen.dom.FirstLineIndent class 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. Specify your own tag value, for example, to make it easier to identify where an issue occurred during document generation.
-
12 Classes – Alphabetical List mlreportgen.dom.FlowDirection class Package: mlreportgen.dom Direction of text or table column flow Description Specifies the direction for text to flow across a page or the order of columns. Construction flowDirectionObj = FlowDirection() causes text to flow from left to right and for the first column to be on the left side of a table.
-
mlreportgen.dom.FlowDirection class Properties Id — ID for document element string A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Tag — Tag for document element string Tag for document element, specified as a string. 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.
-
12 Classes – Alphabetical List q = clone(p); q.Style = {FlowDirection('ltr')}; append(d,q); close(d); rptview(d.
-
mlreportgen.dom.FontFamily class mlreportgen.dom.FontFamily class Package: mlreportgen.dom Font family Description Properties of font family to be used to format document text. Construction fontFamilyObj = FontFamily() creates a Times New Roman font family. fontFamilyObj = FontFamily(fontStr) creates the specified font family. Input Arguments fontStr — Font family string Font family, specified as a string. Output Arguments fontFamilyObj — Font family mlreportgen.dom.
-
12 Classes – Alphabetical List ComplexScriptFamilyName — Font family for complex scripts string For Word documents only. String specifying a font family to substitute in a locale that requires a complex script (such as Arabic) to render text. EastAsiaFamilyName — Font family for East Asian locales string For Word documents only. String specifying a font family to substitute in an East Asian locale, such as China, Japan, or Korea.
-
mlreportgen.dom.FontSize class mlreportgen.dom.FontSize class Package: mlreportgen.dom Font size Description Specifies the size of a font. Construction fontSizeObj = FontSize() creates a 12-point font. fontSizeObj = FontSize(sizeStr) creates the specified font size. Input Arguments sizeStr — Font size '12pt' (default) | string String having the format valueUnits, where Units is an abbreviation for the units in which the size is expressed.
-
12 Classes – Alphabetical List Font size, represented by an mlreportgen.dom.FontSize object. Properties Id — ID for document element string A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Tag — Tag for document element string Tag for document element, specified as a string. A session-unique ID is generated as part of document element creation.
-
mlreportgen.dom.
-
12 Classes – Alphabetical List mlreportgen.dom.FormalTable class Package: mlreportgen.dom Formal table Description Defines a formal table, which is a table that has a body and optionally a table header or table footer, or both. The table header, body, and footer are mlreportgen.dom.TableHeader, mlreportgen.dom.TableBody, and mlreportgen.dom.TableFooter objects, respectively. Construction formalTableObj = FormalTable() creates an empty formal table.
-
mlreportgen.dom.FormalTable class Input Arguments ncols — Number of columns in table numeric value Number of columns in a table, specified as a numeric value. Data Types: double body — Table body content two-dimensional numeric array | two-dimensional cell array The cell array may contain: • Character array (strings) • One- or two-dimensional cell array • double • mlreportgen.dom.Text object • mlreportgen.dom.Paragraph object • mlreportgen.dom.Image object • mlreportgen.dom.Table object • mlreportgen.dom.
-
12 Classes – Alphabetical List • Character array (strings) • One- or two-dimensional cell array • double • mlreportgen.dom.Text object • mlreportgen.dom.Paragraph object • mlreportgen.dom.Image object • mlreportgen.dom.Table object • mlreportgen.dom.FormalTable object • mlreportgen.dom.OrderedList object • mlreportgen.dom.UnorderedList object • mlreportgen.dom.ExternalLink object • mlreportgen.dom.InternalLink object • mlreportgen.dom.
-
mlreportgen.dom.FormalTable class Output Arguments formalTableObj — Formal table mlreportgen.dom.FormalTable object Formal table, represented by an mlreportgen.dom.FormalTable object. Properties BackgroundColor — Background color string Specify one of these as a string: • The name of a color. The name must be a CSS color name. See http:// www.crockford.com/wrrrld/color.html. • A hexadecimal RGB (truecolor) value as #RRGGBB. For example, #0000ff is a shade of blue. Body — Table body mlreportgen.dom.
-
12 Classes – Alphabetical List Border String Description Supported Output Types dotdash Line with alternating dots and dashes Word dotdotdash Line with alternating double dots and a dash Word double Double line Word and HTML doublewave Double wavy line Word groove 3-D effect grooved line HTML hidden No line HTML See discussion below this table. inset 3-D effect line Word and HTML none No line Word and HTML See discussion below this table.
-
mlreportgen.dom.
-
12 Classes – Alphabetical List • A hexadecimal RGB (truecolor) value as #RRGGBB. For example, #0000ff is a shade of blue. BorderWidth — Table border width string String specifying the width of the border. The string must have the format valueUnits where Units is an abbreviation for the units in which the width size is expressed.
-
mlreportgen.dom.FormalTable class ColSepWidth — Width of line separating table columns string String having the format valueUnits, where Units is an abbreviation for the units in which the width is expressed. Use one of these abbreviations for the units of a width. • no abbreviation — pixels • cm — centimeters • in — inches • mm — millimeters • pi — picas • pt — points • px — pixels For example, for a three pica wide column separator, set the ColSepWidth property to 3pi.
-
12 Classes – Alphabetical List Footer — Footer for this table mlreportgen.dom.TableFooter object The table constructor creates a table footer object and assigns it to this property when the formal table is constructed. You cannot subsequently set this property. However, you can append content to the table body and set its properties via this property. HAlign — Horizontal alignment of this table string Possible values are: • center • left • right Header — Table header mlreportgen.dom.
-
mlreportgen.dom.FormalTable class • pi — picas • pt — points • px — pixels Parent — Parent of document element DOM object This read-only property lists the parent of this document element. RowSep — Style of lines separating rows string The style of a line separating the rows of a table or table section (header, body, or footer). See the description of the Border property for a description of the possible values. RowSepColor — Color of row separator string You can specify: • Name of a color.
-
12 Classes – Alphabetical List Style — Format for table array of format objects Array of format objects (such as Bold objects) that specify the format for this table. This property overrides corresponding formats defined by the stylesheet style specified by the StyleName property.
-
mlreportgen.dom.FormalTable class • pt — points • px — pixels Tag — Tag for document element string Tag for document element, specified as a string. 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.
-
12 Classes – Alphabetical List Method Purpose clone Copy the table. Use FormalTable.clone the same way you use Paragraph.clone. See Also mlreportgen.dom.ResizeToFitContents | mlreportgen.dom.Table | mlreportgen.dom.TableBody | mlreportgen.dom.TableColSpec | mlreportgen.dom.TableEntry | mlreportgen.dom.TableFooter | mlreportgen.dom.TableHeader | mlreportgen.dom.
-
mlreportgen.dom.Group class mlreportgen.dom.Group class Package: mlreportgen.dom Group of document objects Description Group of document objects that you can append multiple times in a document without you having to clone the group. When you append a group to a document, the DOM interface clones the group. Tip You can use mlreportgen.dom.Group and mlreportgen.dom.Container objects to produce collections of document elements.
-
12 Classes – Alphabetical List Properties Id — ID for document element string A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Children — Children of this document cell array of mlreportgen.dom.Element objects This read-only property lists child elements that the document element contains. Parent — Parent of document element DOM object This read-only property lists the parent of this document element.
-
mlreportgen.dom.
-
12 Classes – Alphabetical List mlreportgen.dom.HAlign class Package: mlreportgen.dom Specify horizontal alignment of document object Description Specifies horizontal alignment of a document object. Construction alignObj = HAlign() creates an alignment object having the value 'left'. alignObj = HAlign(value) creates an alignment object having the specified value. Input Arguments value — Horizontal alignment string String that specifies the horizontal alignment of a document object.
-
mlreportgen.dom.HAlign class A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Tag — Tag for document element string Tag for document element, specified as a string. 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.
-
12 Classes – Alphabetical List mlreportgen.dom.Heading class Package: mlreportgen.dom Heading paragraph Description Create a heading paragraph. Construction headingObj = Heading(level) creates an empty heading at the specified level. headingObj = Heading(level,text) creates the specified level heading containing the specified text. headingObj = Heading(level,text,styleName) creates the specified level heading containing the specified text and using the specified style.
-
mlreportgen.dom.Heading class The style specified by styleName must specify a paragraph style defined in the template used to create the document to which this heading is appended. domObj — DOM object to include in heading DOM object • ExternalLink • Image • InternalLink • LinkTarget • Text Output Arguments headingObj — Heading paragraph mlreportgen.dom.Heading object Heading paragraph, represented by an mlreportgen.dom.Heading object.
-
12 Classes – Alphabetical List Data Types: logical Color — Text color string Specify one of these as a string: • The name of a color. The name must be a CSS color name. See http:// www.crockford.com/wrrrld/color.html. • A hexadecimal RGB (truecolor) value as #RRGGBB. For example, #0000ff is a shade of blue. CustomAttributes — Custom attributes of document element array of mlreportgen.dom.CustomAttribute objects HTML or Microsoft Word must support the custom attributes of this document element.
-
mlreportgen.dom.Heading class To specify substitutions for this font, do not set this property. Instead create and add a mlreportgen.dom.FontFamily object to the Style property of this document element. FontSize — Font size for text string String having the format valueUnits, where Units is an abbreviation for the units in which the font size is expressed. Use one of these abbreviations for the units for the font size.
-
12 Classes – Alphabetical List Data Types: logical OuterLeftMargin — Left margin (indentation) of document element string String specifying the left indentation. The string must have the format valueUnits where Units is an abbreviation for the units in which the width size is expressed.
-
mlreportgen.dom.Heading class Style — Text formatting array of mlreportgen.dom.DOCXSection objects An array of mlreportgen.dom.DOCXSection objects that specifies the format for the text. StyleName — Name of style to apply to text string The style specified by styleName must be defined in the template used to create the document element to which this text is appended. Data Types: char Tag — Tag for document element string Tag for document element, specified as a string.
-
12 Classes – Alphabetical List Border String Description Supported Output Types dotted Dotted line Word dottedHeavy Thick dotted line Word dotDash Dot-dash line Word dotDotDash Dot-dot-dash line Word dashDotHeavy Heavy dot-dash line Word double Double line Word none Do not use underlining HTML and Word single Single line HTML and Word thick Thick line Word wave Wavy line Word waveyDouble Double wavy line Word waveyHeavy Heavy wavy Word words Underline non-space char
-
mlreportgen.dom.Heading class Border String Description Supported Output Types nowrap Sequences of white space collapse into a single white space. Text never wraps to the next line. HTML preserve Preserves white space. Text Word and HTML wraps only on line breaks. See below for details. Acts like the
tag in HTML. pre Preserves white space. Text HTML wraps only on line breaks. Acts like the tag in HTML. pre-line Sequences of white space collapse into a single white space. Text wraps.
-
12 Classes – Alphabetical List Method Purpose clone Copy heading. Use Heading.clone the similar to how you use Paragraph.clone. See Also mlreportgen.dom.
-
mlreportgen.dom.Height class mlreportgen.dom.Height class Package: mlreportgen.dom Height of object Description Specifies the height of an image. Construction heightObj = Height() creates a format object that specifies a height of 1 inch. heightObj = Height(value) creates a height object having the specified height. Input Arguments value — Height of object '1in' (default) | string String having the format valueUnits, where Units is an abbreviation for the units in which the height is expressed.
-
12 Classes – Alphabetical List Height of object, represented by an mlreportgen.dom.Height object. Properties Id — ID for document element string A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Tag — Tag for document element string Tag for document element, specified as a string. A session-unique ID is generated as part of document element creation.
-
mlreportgen.dom.
-
12 Classes – Alphabetical List mlreportgen.dom.HTML class Package: mlreportgen.dom Convert HTML text to container of DOM objects Description Converts a string of HTML text to an HTML object containing DOM objects having the same content and format. Construction htmlObj = HTML() creates an empty HTML object. htmlObj = HTML(htmlText)Converts a string of HTML text to an HTML object containing DOM objects having the same content and format. An HTML object supports these HTML elements and attributes.
-
mlreportgen.dom.
-
12 Classes – Alphabetical List • border-left-color • border-left-style • boder-left-width • border-right • border-right-color • border-rigtht-style • border-right-width • border-style • border-top • border-top-color • border-top-style • border-top-width • color • font-family • font-size • font-style • font-weight • height • line-height • margin • margin-bottom • margin-left • margin-right • margin-top • padding • padding-bottom • padding-left • padding-right • padding-top • text-align 12-160
-
mlreportgen.dom.HTML class • text-decoration • text-indent • vertical-align • white-space • width For information about these formats, see the W3Schools CSS documentation at www.w3schools.com/cssref. Input Arguments htmlText — HTML text string HTML text, specified as a string Example: html = HTML('
Hello World i>
'); Properties Id — ID for HTML object string A session-unique ID is generated as part of HTML object creation.
-
12 Classes – Alphabetical List Parent — Parent of this HTML object a DOM object This read-only property lists the parent of this HTML object. Style — Formatting to apply to this HTML object cell array of format objects Formatting to apply to this HTML object, specified as a cell array of DOM format objects. The children of this HTML object inherit any of these formats that they do not override. StyleName — Style name of this HTML object string Style name of this HTML object, specified as a string.
-
mlreportgen.dom.HTML class rpt = Document('MyRep1','docx'); html = HTML('
Hello World
'); Append content to the HTML object and append the HTML object to the document. append(html,'This is me speaking
'); append(rpt,html); Generate the Word report. close(rpt); rptview(rpt.OutputPath); • “Append HTML Content to DOM Reports” See Also mlreportgen.dom.Document.addHTML | mlreportgen.dom.
-
12 Classes – Alphabetical List mlreportgen.dom.HTMLFile class Package: mlreportgen.dom Convert contents of HTML file to container of DOM objects Description Converts the contents of an HTML file to an HTMLFile object containing DOM objects having the same content and format. Construction htmlFileObj = HTMLFile(htmlFile) converts the HTML file to an HTMLFile object containing DOM objects having the same content and format. An HTMLFile object supports these HTML elements and attributes.
-
mlreportgen.dom.
-
12 Classes – Alphabetical List • border-left-style • boder-left-width • border-right • border-right-color • border-rigtht-style • border-right-width • border-style • border-top • border-top-color • border-top-style • border-top-width • color • font-family • font-size • font-style • font-weight • height • line-height • margin • margin-bottom • margin-left • margin-right • margin-top • padding • padding-bottom • padding-left • padding-right • padding-top • text-align • text-decoration 12-166
-
mlreportgen.dom.HTMLFile class • text-indent • vertical-align • white-space • width For information about these formats, see the W3Schools CSS documentation at www.w3schools.com/cssref. Input Arguments htmlFile — HTML file path string HTML file path, specified as a string. Properties Id — ID for HTMLFile object string A session-unique ID is generated as part of HTMLFile object creation. You can specify an ID to replace the generated ID.
-
12 Classes – Alphabetical List Style — Formatting to apply to HTMLFile object cell array of format objects Formatting to apply to the HTMLFile object, specified as a cell array of DOM format objects. The children of this HTMLFile object inherit any of these formats that they do not override. StyleName — Style name of HTMLFile object string Style name of this HTMLFile object, specified as a string. Use a name of a style specified in the stylesheet of the document to which this HTMLFile object is appended.
-
mlreportgen.dom.HTMLFile class rpt = Document('MyHTMLReport','docx'); Create the first HTMLFile object and append HTML markup and an HTML object to the HTMLFile object. path = 'myHTMLfile1.html'; htmlFile1 = HTMLFile(path); append(htmlFile1,'
This is HTML markup text
'); htmlObj = HTML('This is an HTML object
'); append(htmlFile1,htmlObj); Create a second HTMLFile object. htmlFile2 = HTMLFile('myHTMLFile2.
-
12 Classes – Alphabetical List mlreportgen.dom.Image class Package: mlreportgen.dom Create image to be included in report Description Create an image to be included in a report. Construction imageObj = Image(imagePath) creates an image object containing the image file specified by imagePath. The contents of the specified image file are copied into the output document either when the image object is appended to the document (in document streaming mode) or when the document is closed.
-
mlreportgen.dom.Image class • .png • .tif • .tiff For HTML reports, you can use the same image formats as for a Word report, plus you can use .svg format. Output Arguments imageObj — Image mlreportgen.dom.Image object Image, represented by an mlreportgen.dom.Image object. Properties CustomAttributes — Custom attributes of document element array of mlreportgen.dom.CustomAttribute objects HTML or Microsoft Word must support the custom attributes of this document element.
-
12 Classes – Alphabetical List Image.Style = {Height('4in')}; Id — ID for document element string A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Map — Map of hyperlink areas in image (HTML only) mlreportgen.dom.ImageMap object Map of hyperlink areas in image, specified as an mlreportgen.dom.ImageMap object Path — Path of image file string Path of image file, specified as a string.
-
mlreportgen.dom.Image class Possible values are: • top • bottom • middle Width — Image width string String having the format valueUnits, where Units is an abbreviation for the units in which the height is expressed. The following abbreviations are valid: • no abbreviation — pixels • cm — centimeters • in — inches • mm — millimeters • pi — picas • pt — points • px — pixels Methods Method Purpose append Append a custom element to this image. Use Image.append in a similar way to how you use ExternalLink.
-
12 Classes – Alphabetical List Related Examples • 12-174 “Create and Format Images”
-
mlreportgen.dom.ImageArea class mlreportgen.dom.ImageArea class Package: mlreportgen.dom Define image area as hyperlink Description Define an area in an image to be an HTML hyperlink. When a user clicks an image area, the HTML browser displays the target page, based on the URL or link target you specify. You can provide alternative text for screen reader users. Construction imageAreaObj = ImageArea() creates an empty image area.
-
12 Classes – Alphabetical List Text to display if the image is not visible, specified as a string. x1 — x coordinate of top-left corner of rectangular image area, in pixels unsigned integer Specify relative to the top-left corner of the image. Data Types: uint16 y1 — y coordinate of top-left corner of rectangular image area unsigned integer Specify relative to the top-left corner of the image, in pixels.
-
mlreportgen.dom.ImageArea class The radius, in pixels. Data Types: uint16 polygonCoordinates — Coordinates of polygonal image area array Specify an array of x and y coordinate pairs, with coordinates for each corner of the polygon, in the form [x1, y1, x2, y2, ... xN, yN]. Specify the coordinates to reflect the corners of the polygon, in sequence. Specify each coordinate relative to the top-left corner of the image, in pixels. Output Arguments imageAreaObj — Image area hyperlink mlreportgen.dom.
-
12 Classes – Alphabetical List • 'circle' — circular image area • 'poly' — polygonal image area Coords — Coordinates for image area array (Read-only) The coordinates represent different kinds of points, depending on the shape of the image area. Coordinates are relative to the top-left corner of the image. • For a rectangle, the coordinates represent the top-left corner and the bottom-right corner. • For a circle, the array represents the coordinates at the center of the circle and the radius.
-
mlreportgen.dom.ImageArea class x = 0:pi/100:2*pi; y = sin(x); plot(x,y); annotation('textbox', [0.2,0.4,0.1,0.1],... 'String', 'Help on plot function'); saveas(gcf,'plot_img.png'); plot1 = Image('plot_img.png'); append(d,plot1); area1 = ImageArea(... ['http://www.mathworks.com/help/matlab/ref/' ... 'plot.html?searchHighlight=plot'], ... 'plot function help', 240,450,463,492); map = ImageMap(); plot1.Map = map; append(map,area1); close(d); rptview(d.
-
12 Classes – Alphabetical List mlreportgen.dom.ImageMap class Package: mlreportgen.dom Map of hyperlink areas in image Description Map of image areas, which are areas within an image where a user can click to open content in an HTML browser. Construction map = ImageMap() creates an empty image map. Use the ImageMap.append method to add image areas to the map. Output Arguments map — Map of hyperlink areas in image mlreportgen.dom.
-
mlreportgen.dom.ImageMap class 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. Specify your own tag value, for example, to make it easier to identify where an issue occurred during document generation. Methods Method Purpose append Append an image area to this image map.
-
12 Classes – Alphabetical List plot1.Map = map; append(map,area1); close(d); rptview(d.OutputPath); • “Create and Format Images” See Also mlreportgen.dom.Image | mlreportgen.dom.
-
mlreportgen.dom.InnerMargin class mlreportgen.dom.InnerMargin class Package: mlreportgen.dom Margin between content and bounding box Description Specifies the margin between the content and the bounding box of a document object. A bounding box of an object includes the border of the object (if it has a border), the inner margin, and the object content. Construction marginObj = InnerMargin() creates an unspecified margin between the content of an object and its bounding box.
-
12 Classes – Alphabetical List • cm — centimeters • in — inches • mm — millimeters • pi — picas • pt — points • px — pixel left — Left margin size string String specifying the left margin between the content of an object and its bounding box. See the all input argument description for valid strings. right — Right margin size string String specifying the right margin between the content of an object and its bounding box. See the all input argument description for valid strings.
-
mlreportgen.dom.InnerMargin class Properties Bottom — Size of bottom margin string String specifying the bottom margin. String must have the format valueUnits where Units is an abbreviation for the units in which the width size is expressed. Valid abbreviations are: • No abbreviation — pixels • cm — centimeters • in — inches • mm — millimeters • pi — picas • pt — points • px — pixel Left — Size of left margin string String specifying the left margin between the content of an object and its bounding box.
-
12 Classes – Alphabetical List 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. Specify your own tag value, for example, to make it easier to identify where an issue occurred during document generation.
-
mlreportgen.dom.InternalLink class mlreportgen.dom.InternalLink class Package: mlreportgen.dom Hyperlink to a location in same document Description Hyperlink to a location in the same document that contains the hyperlink. Use this kind of link to provide internal navigation within a document. Construction internalLinkObj = InternalLink(targetName,linkText) creates a hyperlink to the specified link target object and uses the specified link text.
-
12 Classes – Alphabetical List Name of style to use for the link text. textObj — Text object containing link text mlreportgen.dom.Text object Text object containing link text, specified by an mlreportgen.dom.Text object. Output Arguments internalLinkObj — Internal link mlreportgen.dom.InternalLink object Internal link, represented by an mlreportgen.dom.InternalLink object. Properties Children — Children of this document cell array of mlreportgen.dom.
-
mlreportgen.dom.InternalLink class Name of link style defined in the template, specified as a string. The style specified by styleName must be defined in the template used to create the document to which the link is appended. Style — Format specification array of format objects Format objects that specify the format of a document element. Tag — Tag for document element string Tag for document element, specified as a string. A session-unique ID is generated as part of document element creation.
-
12 Classes – Alphabetical List Examples Add Internal Link import mlreportgen.dom.* d = Document('mydoc'); append(d, InternalLink('bio','About the Author')); h = Heading(1,LinkTarget('bio')); append(h,'Author''s Biography'); append(d,h); close(d); rptview('mydoc','html'); • “Create Links” See Also mlreportgen.dom.ExternalLink | mlreportgen.dom.
-
mlreportgen.dom.Italic class mlreportgen.dom.Italic class Package: mlreportgen.dom Italic for text object Description Specifies whether text should be rendered italic. Construction italicObj = Italic() creates a format object that specifies that text should be rendered italic. italicObj = Italic(value) creates a format object that specifies that text should be rendered italic if value is true; otherwise, upright.
-
12 Classes – Alphabetical List A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Tag — Tag for document element string Tag for document element, specified as a string. 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.
-
mlreportgen.dom.Italic class p.Style = {Italic}; append(d,p); t = Text('upright text'); t.
-
12 Classes – Alphabetical List mlreportgen.dom.KeepLinesTogether class Package: mlreportgen.dom Start paragraph on new page if necessary Description Start paragraph on new page if necessary Construction keepLinesTogetherObj = KeepLinesTogether() starts a paragraph on a new page if it cannot fit entirely on current page. keepLinesTogetherObj = KeepLinesTogether(onoff) starts paragraph on a new page only if it cannot fit entirely on current page and onoff is true.
-
mlreportgen.dom.KeepLinesTogether class Start paragraph on new page if necessary, represented by an mlreportgen.dom.KeepLinesTogether object. Properties Id — ID for document element string A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Tag — Tag for document element string Tag for document element, specified as a string. A session-unique ID is generated as part of document element creation.
-
12 Classes – Alphabetical List mlreportgen.dom.KeepWithNext class Package: mlreportgen.dom Keep paragraph on same page as next Description Keep paragraph on same page as paragraph that follows it. This format applies only to Microsoft Word documents. Construction obj = KeepWithNext() keeps a paragraph on the same page as the paragraph that follows it. obj = KeepWithNext(onoff) keeps a paragraph on the same page as the paragraph that follows it if onoff is true.
-
mlreportgen.dom.KeepWithNext class Output Arguments keepWithNextObj — Keep paragraph on same page as next mlreportgen.dom.keepWithNext object Keep paragraph on same page as next, represented by an mlreportgen.dom.keepWithNext object. Properties Id — ID for document element string A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Tag — Tag for document element string Tag for document element, specified as a string.
-
12 Classes – Alphabetical List More About • 12-198 “Report Formatting Approaches”
-
mlreportgen.dom.LineSpacing class mlreportgen.dom.LineSpacing class Package: mlreportgen.dom Spacing between lines of paragraph Description Specifies the spacing between lines of a paragraph. Construction lineSpacingObj = LineSpacing() specifies line spacing equal to the height of one line at the paragraph font size. lineSpacingObj = LineSpacing(multiple) specifies a line spacing as a multiple of the paragraph text line height (for example, 1.5).
-
12 Classes – Alphabetical List • in — inches • mm — millimeters • pi — picas • pt — points spacingType — Line spacing type string Type of line spacing, specified as one of these strings: • 'multiple' — Value is the spacing in terms of number of lines. • 'exact' — Value is the exact size of the line spacing. • 'atleast' — Value is the minimum size of the line spacing (applies only to Microsoft Word) Output Arguments lineSpacingObj — Spacing between lines of paragraph mlreportgen.com.
-
mlreportgen.dom.LineSpacing class Specify your own tag value, for example, to make it easier to identify where an issue occurred during document generation. Type — Option to specify type of line spacing height string | 'exact' | Type of line spacing, specified as one of these strings: • 'multiple' — Value is the spacing in terms of number of lines. • 'exact' — Value is the exact size of the line spacing.
-
12 Classes – Alphabetical List mlreportgen.dom.LinkTarget class Package: mlreportgen.dom Target for internal or external links or image area links Description A target to use for internal and external links and for image area links. You can specify a LinkTarget object when you construct an mlreportgen.dom.InternalLink or mlreportgen.dom.ImageArea object. Construction targetObj = LinkTarget(name) creates a link target with the specified name.
-
mlreportgen.dom.LinkTarget class Link target, represented by an mlreportgen.dom.LinkTarget object. Properties CustomAttributes — Custom attributes of document element array of mlreportgen.dom.CustomAttribute objects HTML or Microsoft Word must support the custom attributes of this document element. Id — ID for document element string A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID.
-
12 Classes – Alphabetical List Methods Method Purpose append Append content to link target. clone Copy link target. Use LinkTarget.clone in a similar way to how you use Paragraph.clone. Examples Link to Top of a Document Define a link target at the top of the report and add an internal link to that target. In an actual report, links to this target would appear further down in the report. import mlreportgen.dom.
-
mlreportgen.dom.ListItem class mlreportgen.dom.ListItem class Package: mlreportgen.dom Create item for ordered or unordered list Description Specifies an item in an ordered (numbered) or unordered (bulleted) list. Construction listItemObj = ListItem() creates an empty list item. listItemObj = ListItem(text) creates a list item using the specified text. The constructor creates a Text object and appends the text object to the list item.
-
12 Classes – Alphabetical List • mlreportgen.dom.Paragraph • mlreportgen.dom.Image • mlreportgen.dom.Table • mlreportgen.dom.FormalTable • mlreportgen.dom.ExternalLink • mlreportgen.dom.InternalLink • mlreportgen.dom.CustomElement styleName — Name of style for list item string Name of style to use for the list item, specified as a string. Output Arguments listItemObj — List item mlreportgen.dom.ListItem object List item, represented by an mlreportgen.dom.ListItem object.
-
mlreportgen.dom.ListItem class Format objects that specify the format of a document element. Parent — Parent of document element DOM object This read-only property lists the parent of this document element. StyleName — This property is ignored string This property is ignored. Tag — Tag for document element string Tag for document element, specified as a string. A session-unique ID is generated as part of document element creation.
-
12 Classes – Alphabetical List Method Purpose clone Clone a list item. Use ListItem.clone the same way you use Paragraph.clone. Examples Create List Items for an Ordered List import mlreportgen.dom.*; doctype = 'html'; d = Document('test',doctype); p = Paragraph('Perform the following steps.'); append(d,p); step1 = ListItem('Do this step first.'); textForItem = Text('Next, do this.
-
mlreportgen.dom.MessageDispatcher class mlreportgen.dom.MessageDispatcher class Package: mlreportgen.dom DOM message dispatcher Description Dispatcher for document generation status messages. Properties Filter — Message filter string (Read-only) The value of this property is a filter that determines the types of messages the dispatcher dispatches. You can control which types of messages are dispatched by setting the properties of the filter.
-
12 Classes – Alphabetical List Methods Method Purpose dispatch Dispatch a document generation status message. getTheDispatcher Get the message dispatcher. Examples Add and Dispatch a Progress Message This example shows how to add a progress message to display when generating a report. Add a dispatcher and listener to the report. import mlreportgen.dom.*; doctype = 'html'; d = Document('test',doctype); d.Tag = 'My report'; dispatcher = MessageDispatcher.
-
mlreportgen.dom.MessageDispatcher class See Also mlreportgen.dom.MessageDispatcher.dispatch | mlreportgen.dom.MessageDispatcher.getTheDispatcher | mlreportgen.dom.MessageEventData | mlreportgen.dom.
-
12 Classes – Alphabetical List mlreportgen.dom.MessageEventData class Package: mlreportgen.dom Holds message triggering message event Description Contains the message that triggered a message event. Construction messageEventDataObj = MessageEventData(msg) creates a message event data object that contains a DOM message (for example, a message of type mlreportgen.dom.ProgressMessage). The DOM message dispatcher attaches an object of this type to a message event when it dispatches a message.
-
mlreportgen.dom.MessageEventData class Properties Id — ID for document element string A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Message — Message object (read-only) message object The value of this read-only property is a DOM message object, such as an mlreportgen.dom.ProgressMessage object, that triggers a message event. Tag — Tag for document element string Tag for document element, specified as a string.
-
12 Classes – Alphabetical List open(d); dispatch(dispatcher, ProgressMessage('starting chapter', d)); p = Paragraph('Chapter '); p.Tag = 'chapter title'; p.Style = { CounterInc('chapter'), CounterReset('table'), WhiteSpace('pre') }; append(p, AutoNumber('chapter')); append(d, p); close(d); rptview('test', doctype); delete (l); • “Display Report Generation Messages” See Also mlreportgen.dom.
-
mlreportgen.dom.MessageFilter class mlreportgen.dom.MessageFilter class Package: mlreportgen.dom Filter to control message dispatcher Description Filter for messages dispatched by the message dispatcher. Properties DebugMessagePass — Pass or block debug messages logical value • true— Pass debug messages. • false— Block debug messages. Data Types: logical ErrorMessagePass — Pass or block error messages logical value • true— Pass error messages. • false— Block error messages.
-
12 Classes – Alphabetical List • true— Pass progress messages. • false— Block progress messages. Data Types: logical GlobalFilter — Pass or block all messages logical value • true— Pass all messages. • false— Block all messages. Data Types: logical SourceFilter — Pass messages only for this DOM object DOM object Pass messages only from the specified DOM object if the messages meet the other filter conditions specified by this MessageFilter object. See Also mlreportgen.dom.MessageDispatcher.
-
mlreportgen.dom.OPCPart class mlreportgen.dom.OPCPart class Package: mlreportgen.dom Document part to include in OPC package Description Document part to include in an OPC package. Construction opcPartObj = OPCPart() creates an empty OPC part. opcPartObj = OPCPart(name,sourcePath) creates a part having the specified name whose source file is located at the specified path. Appending the part to a document using the Document.
-
12 Classes – Alphabetical List Properties ContentType — Content type of part string Specifies the content type, using a file extension. For a list of file content types, see http:// www.en.wikipedia.org/wiki/Open_Packaging_Conventions. If you do not set this property is not set and the part is one of the types listed below, the DOM interface sets the content type when you append the part to a document. 12-218 File Type File Extension Windows bitmap .bmp Cascading style sheet .css Plain text .
-
mlreportgen.dom.OPCPart class Id — ID for document element string A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Name — Path of part string Path of this part relative to the root of the package. For example, to add an image named myimage.jpg to a document images folder, specify the path as '/images/ myimage.jpg'. For information about OPC part names, see http://www.en.wikipedia.org/wiki/ Open_Packaging_Conventions.
-
12 Classes – Alphabetical List File Type File Extension Icon .cur Windows metafile .emf Encapsulated PostScript .eps GIF image .gif HTML .html JPEG image .jpe JPEG image .jpeg JPEG .jpg JavaScript .js JavaScript object Notation .json PNG image .png PSD .psd Rich Text Format .rtf Scalable Vector Graphics .svg TIFF image .tif TIFF image .tiff Truetype font .ttf SourceFilePath — Source file path string Source file path, specified as a string.
-
mlreportgen.dom.OPCPart class Examples Add a File to an OPC Package This code inserts a copy of the data.json file in the data subfolder of the mydoc package. This example assumes that there is a data.json file in the current folder. import reportgen.dom.*; d = Document('mydoc','html'); package(d,OPCPart('/data/data.json','data.json')); close(d); See Also mlreportgen.dom.Document.
-
12 Classes – Alphabetical List mlreportgen.dom.OrderedList class Package: mlreportgen.dom Create ordered list Description Create an ordered (numbered) list. Construction orderedListObj = OrderedList() creates an empty ordered list. orderedListObj = OrderedList(listItems) creates an ordered list from a cell array of strings specifying the list items.
-
mlreportgen.dom.OrderedList class • mlreportgen.dom.CustomElement • Horizontal one-dimensional array (for a sublist) To append an ordered list, use an OrderedList DOM object instead of using the listItems argument. Output Arguments orderedListObj — Ordered list mlreportgen.dom.OrderedList object An ordered list containing the specified list items. Properties CustomAttributes — Custom attributes of document element array of mlreportgen.dom.
-
12 Classes – Alphabetical List 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. Specify your own tag value, for example, to make it easier to identify where an issue occurred during document generation. Methods Method Purpose append Append items to this list. clone Copy the list.
-
mlreportgen.dom.OuterMargin class mlreportgen.dom.OuterMargin class Package: mlreportgen.dom Margin between bounding box and its surroundings Description Specifies the margin between the bounding box of an object and adjacent document objects. A bounding box of an object includes the border of the object (if it has a border), the inner margin, and the object content. Construction marginObj = OuterMargin() creates an unspecified margin between the bounding box of an object and its surroundings.
-
12 Classes – Alphabetical List • cm — centimeters • in — inches • mm — millimeters • pi — picas • pt — points • px — pixels left — Outer left margin size string String specifying the left margin between the bounding box of an object and its surroundings. See the all argument for description of valid strings. right — Outer right margin size string String specifying the right margin between the bounding box of an object and its surroundings. See the all argument for description of valid strings.
-
mlreportgen.dom.OuterMargin class Properties Bottom — Size of bottom margin string String specifying the bottom margin. String must have the format valueUnits where Units is an abbreviation for the units in which the width size is expressed. Valid abbreviations are: • No abbreviation — pixels • cm — centimeters • in — inches • mm — millimeters • pi — picas • pt — points • px — pixels Left — Size of left margin string String specifying the left margin.
-
12 Classes – Alphabetical List Tag — Tag for document element string Tag for document element, specified as a string. 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. Specify your own tag value, for example, to make it easier to identify where an issue occurred during document generation.
-
mlreportgen.dom.
-
12 Classes – Alphabetical List mlreportgen.dom.OutlineLevel class Package: mlreportgen.dom Level of paragraph in outline Description Specifies the level of a paragraph in an automatically generated outline. This class is intended for Microsoft Word reports, because HTML does not support displaying paragraphs in a table of contents. Construction outlineLevelObj = OutlineLevel() sets the outline level of this paragraph to 1.
-
mlreportgen.dom.OutlineLevel class Properties Id — ID for document element string A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Tag — Tag for document element string Tag for document element, specified as a string. 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.
-
12 Classes – Alphabetical List open(d); dp = DocumentPart(d,'ReportTOC'); append(d,dp); Set the OutlineLevel property internally, so that there are four levels in the table of contents. for i = 1:4 % set internally the OutlineLevel property append(d,Heading(i,'My Chapter')); append(d,Paragraph('chapter content....')); end Use OutlineLevel to set the level of the Glossary paragraph to 1, so that the paragraph appears at the top level of the table of contents. Display the report.
-
mlreportgen.dom.PageBreakBefore class mlreportgen.dom.PageBreakBefore class Package: mlreportgen.dom Start paragraph on new page Description Specifies to always start paragraph on new page. This is for Microsoft Word reports. Construction pageBreakBeforeObj = PageBreakBefore() always starts paragraph on a new page. pageBreakBeforeObj = PageBreakBefore(onOff) always starts paragraph on a new page if onOff is true.
-
12 Classes – Alphabetical List Properties Tag — Tag for document element string Tag for document element, specified as a string. 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. Specify your own tag value, for example, to make it easier to identify where an issue occurred during document generation.
-
mlreportgen.dom.Paragraph class mlreportgen.dom.Paragraph class Package: mlreportgen.dom Formatted block of text (paragraph) Description Use a mlreportgen.dom.Paragraph object to define a paragraph. You can append document elements, such as an image, to a paragraph. Construction paragraphObj = Paragraph(text) creates a paragraph containing a mlreportgen.dom.Text object with the text specified by the text string. paragraphObj = Paragraph(text,styleName) creates a paragraph having that specified style.
-
12 Classes – Alphabetical List A DOM object to include in a paragraph. You can specify these DOM objects: • mlreportgen.dom.ExternalLink • mlreportgen.dom.Image • mlreportgen.dom.InternalLink • mlreportgen.dom.Text • mlreportgen.dom.LinkTarget Output Arguments paragraphObj — Paragraph mlreportgen.dom.Paragraph object Paragraph, represented by an mlreportgen.dom.Paragraph object. Properties BackgroundColor — Background color string Specify one of these as a string: • The name of a color.
-
mlreportgen.dom.Paragraph class Specify one of these as a string: • The name of a color. The name must be a CSS color name. See http:// www.crockford.com/wrrrld/color.html. • A hexadecimal RGB (truecolor) value as #RRGGBB. For example, #0000ff is a shade of blue. Children — Children of this paragraph array of mlreportgen.dom.Element objects This read-only property lists children elements, such as an image (mlreportgen.dom.Image) object, that the paragraph contains.
-
12 Classes – Alphabetical List The name of a font family. To specify substitutions for this font, do not set this property. Instead create and add a mlreportgen.dom.FontFamily object to the Style property of this document element. Setting the FontFamilyName property adds a corresponding mlreportGen.dom.FontFamily format object to the Style property for this document element. Removing the FontFamilyName property setting removes the object.
-
mlreportgen.dom.
-
12 Classes – Alphabetical List Setting the OuterLeftMargin property adds a corresponding mlreportGen.dom.OuterMargin format object to the Style property for this document element. Removing the OuterLeftMargin property setting removes the object. The string has the format valueUnits, where Units is an abbreviation for the units in which the indentation is expressed. Use one of these abbreviations for the units for indentation.
-
mlreportgen.dom.Paragraph class • double — Use a double line for strikethrough for Word documents Setting the Strike property adds a corresponding mlreportGen.dom.Strike format object to the Style property for this document element. Removing the Strike property setting removes the object. Style — Paragraph formatting cell array of format objects A cell array of DOM format objects that specifies the formats for this paragraph style.
-
12 Classes – Alphabetical List Border String Description Supported Output Types dashDotDotHeavy Line with heavy dashes with two dots between the dashes Word dashDotHeavy Heavy dash-dot line Word dotted Dotted line Word dottedHeavy Thick dotted line Word dotDash Dot-dash line Word dotDotDash Dot-dot-dash line Word dashDotHeavy Heavy dot-dash line Word double Double line Word none Do not use underlining HTML and Word single Single line HTML and Word thick Thick line Word
-
mlreportgen.dom.Paragraph class To specify how to handle white space, use one of the following strings. Border String Description Supported Output Types normal Does not preserve white space and line breaks Word and HTML nowrap Sequences of white space collapse into a single white space. Text never wraps to the next line. HTML preserve Preserves white space. Text Word and HTML wraps only on line breaks. See below for details. Acts like the
tag in HTML. pre Preserves white space.
-
12 Classes – Alphabetical List Method Purpose clone Copy paragraph. Examples Add Paragraphs Add a paragraph with text and another with an external link. import mlreportgen.dom.* doc = Document('mydoc','html'); p1 = Paragraph('This will be bold text'); p1.Bold = true; link = ExternalLink('http://www.mathworks.com/', 'MathWorks'); p2 = Paragraph(link); p2.BackgroundColor = 'yellow'; append(doc,p1); append(doc,p2); close(doc); rptview('mydoc','html'); • “Add Content to a Report” See Also mlreportgen.
-
mlreportgen.dom.ProgressMessage class mlreportgen.dom.ProgressMessage class Package: mlreportgen.dom Progress message Description Create a progress message with the specified text originating from the specified source object. Construction progressMsgObj = ProgressMessage(text,sourceDOMObject) creates a progress message with the specified text, originating from the specified source object. Input Arguments text — Message text string The text to display for the message.
-
12 Classes – Alphabetical List Properties Id — ID for document element string A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Source — Source DOM object message originates from a DOM object Source DOM object from which the message originates. Tag — Tag for document element string Tag for document element, specified as a string. A session-unique ID is generated as part of document element creation.
-
mlreportgen.dom.ProgressMessage class Examples Create a Progress Message Create the report document. import mlreportgen.dom.*; d = Document('test','html'); Create a message dispatcher. dispatcher = MessageDispatcher.getTheDispatcher; l = addlistener(dispatcher,'Message', ... @(src, evtdata) disp(evtdata.Message.formatAsText)); Dispatch the message. open(d); dispatch(dispatcher,ProgressMessage('starting chapter',d)); Add report content. p = Paragraph('Chapter '); p.Tag = 'chapter title'; p.
-
12 Classes – Alphabetical List mlreportgen.dom.RawText class Package: mlreportgen.dom Word XML or HTML markup to insert in document Description Word XML or HTML markup to insert in a document. Construction text = RawText() creates an empty RawText object. You can append a RawText object only to a Document object. For a Word document, the markup specified by the DOCXText property is included in the document. For an HTML document, the value of the HTMLText property is included.
-
mlreportgen.dom.RawText class Word XML markup or HTML markup, specified as a string. For a Word document, the markup must be valid Word XML markup that can be inserted into the w:body element. To improve the readability of your report document, consider assigning the markup to a variable. Then use the variable as an input argument, as shown in the example below. doctype — Type of markup to use 'html' | 'docx' Type of markup to use, specified as a string.
-
12 Classes – Alphabetical List Parent — Parent of document element DOM object This read-only property lists the parent of this document element. Tag — Tag for document element string Tag for document element, specified as a string. 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.
-
mlreportgen.dom.RepeatAsHeaderRow class mlreportgen.dom.RepeatAsHeaderRow class Package: mlreportgen.dom 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.
-
12 Classes – Alphabetical List Repeat table row, represented by an mlreportgen.dom.RepeatAsHeaderRow object. Properties Id — ID for document element string A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Tag — Tag for document element string Tag for document element, specified as a string. A session-unique ID is generated as part of document element creation.
-
mlreportgen.dom.RepeatAsHeaderRow class 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).
-
12 Classes – Alphabetical List mlreportgen.dom.ResizeToFitContents class Package: mlreportgen.dom Allow table to resize its columns Description Specifies whether a table resizes its columns to fit content. Construction resizeToFitContentsObj = ResizeToFitContents() allows a table to resize its columns to fit their contents. resizeToFitContentsObj = ResizeToFitContents(tf) allows a table to resize its columns to fit their contents, if tf is true.
-
mlreportgen.dom.ResizeToFitContents class Properties Id — ID for document element string A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Tag — Tag for document element string Tag for document element, specified as a string. 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.
-
12 Classes – Alphabetical List table1.entry(1,2).Children(1).Content = 'MathWorks'; table1.Style = {ResizeToFitContents(true),Width('1in'), ... Border('solid'),RowSep('solid'),ColSep('solid')}; table1.TableEntriesStyle = {Width('0.25in')}; append(d,table1); Create a second table, but do not have the columns resize to fit content. append(d,Heading(1,'Table 2')); table2 = Table(ones(4, 4)); table2.entry(1,2).Children(1).Content = 'MathWorks'; table2.Style = {ResizeToFitContents(false),Width('1in'), ...
-
mlreportgen.dom.RowHeight class mlreportgen.dom.RowHeight class Package: mlreportgen.dom Height of table row Description Specifies the height of a table row. Construction rowHeightObj = RowHeight() specifies row height to be 1 inch. rowHeightObj = RowHeight(height) sets a row to the specified height. rowHeightObj = RowHeight(height,heightType) sets a row to be exactly the specified height or at least the specified height. Applies only to Microsoft Word documents.
-
12 Classes – Alphabetical List heightType — Use specified height or height that is at least specified height 'exact' | 'atleast' String that defines a row to be exactly the specified height or to be the specified height or taller. Output Arguments rowHeightObj — Height of table row mlreportgen.dom.RowHeight object Row height, represented by an mlreportgen.dom.RowHeight object. Properties Id — ID for document element string A session-unique ID is generated as part of document element creation.
-
mlreportgen.dom.RowHeight class String having the format valueUnits, where Units is an abbreviation for the units in which the height is expressed. The following abbreviations are valid: • no abbreviation — pixels • cm — centimeters • in — inches • mm — millimeters • pi — picas • pt — points • px — pixels Examples Specify Table Row Heights Create a table with two rows. The first row has a variable height and the second has a fixed maximum height. import mlreportgen.dom.
-
12 Classes – Alphabetical List close(d); rptview('myTableDoc','docx'); • “Create and Format Tables” See Also mlreportgen.dom.
-
mlreportgen.dom.RowSep class mlreportgen.dom.RowSep class Package: mlreportgen.dom Draw lines between table rows Description Draw lines (separators) between table rows. Construction rowSepObj = RowSep() creates unspecified row separators. rowSepObj = RowSep(style) creates a row separator of the specified style. rowSepObj = RowSep(style,color) creates a row separator having the specified style and color.
-
12 Classes – Alphabetical List String Applies To Word HTML 'dotdash' X 'dotdotdash' X 'double' X 'doublewave' X 'inset' X X 'none' X X 'outset' X X 'single' X X X 'solid' 'thick' X 'thickthinlargegap' X 'thickthinmediumgap' X 'thickthinsmallgap' X 'thinthicklargegap' X 'thinthickmediumgap' X 'thinthicksmallgap' X 'thinthickthinlargegap' X 'thinthickthinmediumgap' X 'thinthickthinsmallgap' X 'threedemboss' X 'threedengrave' X 'triple' X 'wave' X color — C
-
mlreportgen.dom.RowSep class width — Width of table row separator string String specifying the color of the table row separator. String must have the format valueUnits where Units is an abbreviation for the units in which the width size is expressed. Valid abbreviations are: • no abbreviation — pixels • cm — centimeters • in — inches • mm — millimeters • pi — picas • pt — points • px — pixels Output Arguments rowSepObj — Draw lines between table rows mlreportgen.dom.
-
12 Classes – Alphabetical List Style — Line style of table row separator string Line style for the row separator. See the description of the style input argument for a list of possible values. Tag — Tag for document element string Tag for document element, specified as a string. 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.
-
mlreportgen.dom.RowSep class import mlreportgen.dom.*; doctype = 'html'; d = Document('test',doctype); t = Table(magic(5)); t.Style = {Border('inset','crimson','6pt'), ... ColSep('double','DarkGreen','3pt'), ... RowSep('double','Gold','3pt'), ... Width('50%')}; t.TableEntriesInnerMargin = '6pt'; t.TableEntriesHAlign = 'center'; t.TableEntriesVAlign = 'middle'; append(d,t); close(d); rptview('test',doctype); • “Create and Format Tables” See Also mlreportgen.dom.Border | mlreportgen.dom.
-
12 Classes – Alphabetical List mlreportgen.dom.ScaleToFit class Package: mlreportgen.dom Scale image to fit page Description Specifies whether to scale an image to fit a page. Construction scaleToFitObj = ScaleToFit() scales an image to fit between the margins of a Microsoft Word page. scaleToFitObj = ScaleToFit(value) scales an image if value is true. Input Arguments value — Scale image to fit page [] (default) | logical value A setting of false (or 0) does not scale the image.
-
mlreportgen.dom.ScaleToFit class A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Tag — Tag for document element string Tag for document element, specified as a string. 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.
-
12 Classes – Alphabetical List mlreportgen.dom.Strike class Package: mlreportgen.dom Strike through text Description Specifies whether to use a strikethrough line for a text object. Strike appears as a single, horizontal line drawn through the text. Construction strikeObj = Strike() draws a single, horizontal line through text. strikeObj = Strike(type) draws a line of the specified type through text. Input Arguments type — Specifies strike type string String specifying the strike type.
-
mlreportgen.dom.Strike class Properties Id — ID for document element string A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Tag — Tag for document element string Tag for document element, specified as a string. 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.
-
12 Classes – Alphabetical List mlreportgen.dom.Table class Package: mlreportgen.dom Create table Description Use an mlreportgen.dom.Table object to define a table. Append rows and table entries to add content to the table. You can define column properties. Construction tableObj = Table(ncols) creates an empty table having the specified number of columns. Use this constructor as the starting point for creating a table from scratch.
-
mlreportgen.dom.Table class • mlreportgen.dom.Paragraph • mlreportgen.dom.Text (CharEntity included) • mlreportgen.dom.Image • mlreportgen.dom.Table • mlreportgen.dom.OrderedList • mlreportgen.dom.UnorderedList styleName — Style for table a style The style specified by styleName must be defined in the template of the document to which this table is appended. Data Types: char Output Arguments tableObj — Table mlreportgen.dom.Table object Table, represented by an mlreportgen.dom.Table object.
-
12 Classes – Alphabetical List Specify one of the following as a string.
-
mlreportgen.dom.
-
12 Classes – Alphabetical List BorderColor — Border color string You can specify: • Name of a color. The name must be a CSS color name. See http://www.crockford.com/ wrrrld/color.html. • A hexadecimal RGB (truecolor) value as #RRGGBB. For example, #0000ff is a shade of blue. BorderWidth — Table border width string String specifying the width of the border. The string must have the format valueUnits where Units is an abbreviation for the units in which the width size is expressed.
-
mlreportgen.dom.Table class You can specify: • Name of a color. The name must be a CSS color name. See http://www.crockford.com/ wrrrld/color.html. • A hexadecimal RGB (truecolor) value as #RRGGBB. For example, #0000ff is a shade of blue. ColSepWidth — Width of line separating table columns string String having the format valueUnits, where Units is an abbreviation for the units in which the width is expressed. Use one of these abbreviations for the units of a width.
-
12 Classes – Alphabetical List FlowDirection — Text flow direction string String specifying the direction for text to flow. • 'ltr' — flow from left to right • 'rtl' — flow from right to left HAlign — Horizontal alignment of this table string Possible values are: • center • left • right Id — ID for document element string A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID.
-
mlreportgen.dom.Table class This read-only property lists the parent of this document element. RowSep — Style of lines separating rows string The style of a line separating the rows of a table or table section (header, body, or footer). See the description of the Border property for a description of the possible values. RowSepColor — Color of lines separating table rows string String specifying one of these values: • The name of a color. See the mlreportGen.dom.
-
12 Classes – Alphabetical List StyleName — Style in document or document part stylesheet string Name of a style specified in the stylesheet of the document or document part to which this table is appended The style that specifies the appearance of this table in the output document, for formats not specified by Style property.
-
mlreportgen.dom.Table class Cell array of format objects that specify the format for table entries. Tag — Tag for document element string Tag for document element, specified as a string. 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.
-
12 Classes – Alphabetical List Method Purpose row Create a table row. Examples Create a Table import mlreportgen.dom.*; d = Document('myreport', 'html'); open(d); t = Table(magic(5)); t.Style = {RowHeight('1in')}; t.Border = 'solid'; t.BorderWidth = 'thin'; t.ColSep = 'solid'; t.ColSepWidth = '1'; t.RowSep = 'solid'; t.RowSepWidth = '1'; • “Create and Format Tables” See Also mlreportgen.dom.FormalTable | mlreportgen.dom.TableBody | mlreportgen.dom.TableEntry | mlreportgen.dom.
-
mlreportgen.dom.TableBody class mlreportgen.dom.TableBody class Package: mlreportgen.dom Body of formal table Description Specifies the body of a formal table Construction tableBodyObj = TableBody() creates an empty table body. Output Arguments tableBodyObj — Formal table body mlreportgen.dom.TableBody object Formal table body, represented by an mlreportgen.dom.TableBody object. Properties Children — Children of this document cell array of mlreportgen.dom.
-
12 Classes – Alphabetical List ColSepColor — Color of line separating columns string You can specify: • Name of a color. The name must be a CSS color name. See http://www.crockford.com/ wrrrld/color.html. • A hexadecimal RGB (truecolor) value as #RRGGBB. For example, #0000ff is a shade of blue. ColSepWidth — Width of line separating table columns string String having the format valueUnits, where Units is an abbreviation for the units in which the width is expressed.
-
mlreportgen.dom.TableBody class RowSepColor — Color of lines separating table rows string String specifying one of these values: • The name of a color. See the mlreportGen.dom.Color class reference page for a list of supported colors. • A hexadecimal RGB (truecolor) value as #RRGGBB. For example, #0000ff is a shade of blue. Parent — Parent of document element DOM object This read-only property lists the parent of this document element.
-
12 Classes – Alphabetical List The inner margin is the margin between table cell content and the cell borders. The string must have the format valueUnits where Units is an abbreviation for the units in which the width size is expressed.
-
mlreportgen.dom.TableBody class See Also mlreportgen.dom.FormalTable | mlreportgen.dom.Table | mlreportgen.dom.TableEntry | mlreportgen.dom.TableFooter | mlreportgen.dom.TableHeader | mlreportgen.dom.TableHeaderEntry | mlreportgen.dom.
-
12 Classes – Alphabetical List mlreportgen.dom.TableColSpec class Package: mlreportgen.dom Formatting for one or more adjacent table columns Description Define the formatting for one or more adjacent table columns. Use a TableColSpec object to override formats specified by a TableColSpecGroup object. Construction colSpecObj = TableColSpec() creates a column specification having a span of 1. Output Arguments colSpecObj — Formatting for one or more adjacent table columns mlreportgen.dom.
-
mlreportgen.dom.TableColSpec class Span — Number of adjacent table columns to which this document element applies number of adjacent table columns If this property is not specified (its value is []), the value is assumed to be 1. Data Types: double Style — Style of adjacent table columns array of format objects Format objects that specify the style of the columns governed by this specification. Tag — Tag for document element string Tag for document element, specified as a string.
-
12 Classes – Alphabetical List mlreportgen.dom.TableColSpecGroup class Package: mlreportgen.dom Define style for group of table columns Description Define the style for a group of table columns. Use a TableColSpec object to override formats specified by a TableColSpecGroup object. Construction colSpecGroupObj = TableColSpecGroup() creates a column specification that spans an entire table. Output Arguments colSpecGroupObj — Table column specification mlreportgen.dom.
-
mlreportgen.dom.TableColSpecGroup class Id — ID for document element string A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Span — Number of adjacent table columns to which this document element applies number of adjacent table columns If this property is not specified (its value is []), the value is assumed to be 1.
-
12 Classes – Alphabetical List table = Table(magic(5)); table.ColSpecGroups = grps; close(doc); rptview(doc.OutputPath); • “Create and Format Tables” See Also mlreportgen.dom.FormalTable | mlreportgen.dom.ResizeToFitContents | mlreportgen.dom.Table | mlreportgen.dom.
-
mlreportgen.dom.TableEntry class mlreportgen.dom.TableEntry class Package: mlreportgen.dom Table entry Description Specifies the content and style of a table entry. Tip To specify formatting for all table entries in a table, use the TableEntriesStyle property of the Table or FormalTable object. For example, you can set border formatting. import mlreportgen.dom.* t = Table(magic(5)); t.
-
12 Classes – Alphabetical List String containing the text for the table entry. textObj — Text object containing the text for the table entry mlreportgen.dom.Text object Text for the table entry, specified as an mlreportgen.dom.Text object. styleName — Style for the table string The style specified by styleName must be defined in the template of the document to which this table is appended.
-
mlreportgen.dom.TableEntry class Specify one of the following as a string.
-
12 Classes – Alphabetical List Border String Description Supported Output Types thickthinmediumgap Dashed line with alternating thick and thin dashes with a medium gap Word thickthinsmallgap Dashed line with alternating thick and thin dashes with a small gap Word thinthicklargegap Dashed line with alternating thin and thick dashes with a medium gap Word thinthickmediumgap Dashed line with alternating thin and thick dashes, with a medium gap Word thinthicksmallgap Dashed line with alternati
-
mlreportgen.dom.TableEntry class • Name of a color. The name must be a CSS color name. See http://www.crockford.com/ wrrrld/color.html. • A hexadecimal RGB (truecolor) value as #RRGGBB. For example, #0000ff is a shade of blue. BorderWidth — Table border width string String specifying the width of the border. The string must have the format valueUnits where Units is an abbreviation for the units in which the width size is expressed.
-
12 Classes – Alphabetical List String specifying the inner margin. String must have the format valueUnits where Units is an abbreviation for the units in which the width size is expressed. Valid abbreviations are: • no abbreviation — pixels • cm — centimeters • in — inches • mm — millimeters • pi — picas • pt — points • px — pixels RowSpan — Number of table rows spanned by table entry double Number of table rows spanned by the table entry, specified as a double.
-
mlreportgen.dom.TableEntry class 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. Specify your own tag value, for example, to make it easier to identify where an issue occurred during document generation.
-
12 Classes – Alphabetical List mlreportgen.dom.TableFooter class Package: mlreportgen.dom Formal table footer Description Specifies the content and format of a formal table footer. Construction tableFooterObj = TableFooter() creates an empty table footer. Output Arguments tableFooterObj — Table footer mlreportgen.dom.TableFooter object Table footer, represented by an mlreportgen.dom.TableFooter object. Properties Children — Children of this document cell array of mlreportgen.dom.
-
mlreportgen.dom.TableFooter class ColSepColor — Color of line separating columns string You can specify: • Name of a color. The name must be a CSS color name. See http://www.crockford.com/ wrrrld/color.html. • A hexadecimal RGB (truecolor) value as #RRGGBB. For example, #0000ff is a shade of blue. ColSepWidth — Width of line separating table columns string String having the format valueUnits, where Units is an abbreviation for the units in which the width is expressed.
-
12 Classes – Alphabetical List The style of a line separating the rows of a table or table section (header, body, or footer). See the description of the Border property for a description of the possible values. RowSepColor — Color of lines separating table rows string String specifying one of these values: • The name of a color. See the mlreportGen.dom.Color class reference page for a list of supported colors. • A hexadecimal RGB (truecolor) value as #RRGGBB. For example, #0000ff is a shade of blue.
-
mlreportgen.dom.TableFooter class Data Types: char TableEntriesHAlign — Horizontal alignment of table entries center (default) | left | right Data Types: char TableEntriesInnerMargin — Inner margin for table entries string The inner margin is the margin between table cell content and the cell borders. The string must have the format valueUnits where Units is an abbreviation for the units in which the width size is expressed.
-
12 Classes – Alphabetical List Tag for document element, specified as a string. 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. Specify your own tag value, for example, to make it easier to identify where an issue occurred during document generation.
-
mlreportgen.dom.TableHeader class mlreportgen.dom.TableHeader class Package: mlreportgen.dom Table header Description Table header for labeling columns. Construction tableHeaderObj = TableHeader() creates an empty table header. Output Arguments tableHeaderObj — Table header mlreportgen.dom.TableHeader object Table header, represented by an mlreportgen.dom.TableHeader object. Properties Children — Children of this document cell array of mlreportgen.dom.
-
12 Classes – Alphabetical List ColSepColor — Color of line separating columns string You can specify: • Name of a color. The name must be a CSS color name. See http://www.crockford.com/ wrrrld/color.html. • A hexadecimal RGB (truecolor) value as #RRGGBB. For example, #0000ff is a shade of blue. ColSepWidth — Width of line separating table columns string String having the format valueUnits, where Units is an abbreviation for the units in which the width is expressed.
-
mlreportgen.dom.TableHeader class RowSepColor — Color of lines separating table rows string String specifying one of these values: • The name of a color. See the mlreportGen.dom.Color class reference page for a list of supported colors. • A hexadecimal RGB (truecolor) value as #RRGGBB. For example, #0000ff is a shade of blue. RowSepWidth — Width of lines separating table rows string The string has the format valueUnits, where Units is an abbreviation for the units in which the width is expressed.
-
12 Classes – Alphabetical List Name of a style specified in the stylesheet of the document or document part to which the table header is appended The style that specifies the appearance of the table header in the output document, for formats not specified by Style property.
-
mlreportgen.dom.TableHeader class Tag — Tag for document element string Tag for document element, specified as a string. 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. Specify your own tag value, for example, to make it easier to identify where an issue occurred during document generation.
-
12 Classes – Alphabetical List mlreportgen.dom.TableHeaderEntry class Package: mlreportgen.dom Entry in table header Description Specifies a table header entry. This class is intended primarily to support HTML table creation. It is rendered in an HTML document as a th (table header cell) element. Use this element to eliminate the need to format a table header entry explicitly. TableHeaderEntry objects rely on the browser to render the header entry appropriately.
-
mlreportgen.dom.
-
12 Classes – Alphabetical List Border String Description Supported Output Types thickthinsmallgap Dashed line with alternating thick and thin dashes with a small gap Word thinthicklargegap Dashed line with alternating thin and thick dashes with a medium gap Word thinthickmediumgap Dashed line with alternating thin and thick dashes, with a medium gap Word thinthicksmallgap Dashed line with alternating thin and thick dashes with a small gap Word thinthickthinlargegap Dashed line with alterna
-
mlreportgen.dom.TableHeaderEntry class BorderWidth — Table border width string String specifying the width of the border. The string must have the format valueUnits where Units is an abbreviation for the units in which the width size is expressed.
-
12 Classes – Alphabetical List • no abbreviation — pixels • cm — centimeters • in — inches • mm — millimeters • pi — picas • pt — points • px — pixels RowSpan — Number of table rows spanned by table entry double Number of table rows spanned by the table entry, specified as a double. Data Types: double Style — Format for table array of format objects Array of format objects (such as Bold objects) that specify the format for this table.
-
mlreportgen.dom.TableHeaderEntry class Specify your own tag value, for example, to make it easier to identify where an issue occurred during document generation. VAlign — Vertical alignment table cell content string Possible values are: • top • bottom • middle Methods Use TableHeaderEntry.append and TableHeaderEntry.clone methods the same way you use Paragraph.append and Paragraph.clone. Method Purpose append Append text, paragraphs, images, tables, and other elements to this entry.
-
12 Classes – Alphabetical List mlreportgen.dom.TableRow class Package: mlreportgen.dom Table row Description Creates a table row. Construction tableRowObj = TableRow() creates an empty table row. Output Arguments tableRowObj — Table row mlreportgen.dom.TableRow object Table row, represented by an mlreportgen.dom.TableRow object. Properties CustomAttributes — Custom attributes for document element array of mlreportgen.doc.
-
mlreportgen.dom.TableRow class String having the format valueUnits, where Units is an abbreviation for the units in which the height is expressed. The following abbreviations are valid: • no abbreviation — pixels • cm — centimeters • in — inches • mm — millimeters • pi — picas • pt — points • px — pixels Alternatively, you can specify the table row height using the TableRow.Style property. For example: TableRow.Style = {RowHeight('.
-
12 Classes – Alphabetical List Specify your own tag value, for example, to make it easier to identify where an issue occurred during document generation. Methods Method Purpose append Append entries to this row. clone Clone this row. See Also mlreportgen.dom.FormalTable | mlreportgen.dom.Table | mlreportgen.dom.TableBody | mlreportgen.dom.TableEntry | mlreportgen.dom.TableFooter | mlreportgen.dom.
-
mlreportgen.dom.Template class mlreportgen.dom.Template class Package: mlreportgen.dom Create document template Description Create a template for a document. Construction templateObj = Template() creates an HTML template named Untitleld.htmtx in the current folder, using the DOM default HTML template. templateObj = Template(templatePath) creates a default HTML template at the specified location. templateObj = Template(templatePath,type) creates a template of the specified type (Microsoft Word or HTML).
-
12 Classes – Alphabetical List • 'docx'— Word output • 'html-file'— HTML output consisting of a single file that contains the text, style sheets, JavaScript®, and images for the report If you specify a template using the templatePath input argument, the template must be consistent with the type argument. You must specify a Word template (.dotx) for docx output, an HTML template package (.htmtx) for HTML output, and a single-file HTML template (.html) for html-file output.
-
mlreportgen.dom.Template class • A block hole can contain a Paragraph, Table, OrderedList, UnorderedList, DocumentPart, and Group. CurrrentDOCXSection — The current section of Word document mlreportgen.dom.DOCXSection object This read-only property for a Word document is a mlreportgen.dom.DOCXSection object that specifies the properties, as well as the headers and footers, of the current document section. In HTML documents, the value of this property is always [].
-
12 Classes – Alphabetical List PackageType — Packaging for files generated from document 'zipped' (default) | 'unzipped' | 'both' Specifies how to package the output files generated from this document. For zipped packaging, the document output is a zip file located at the location specified by the OutputPath property. The zip file has the extension that matches the document type: docx (for Word output) or htmx (for HTML output).
-
mlreportgen.dom.Template class TitleBarText — Title for HTML browser title bar string For HTML documents, this property specifies the text for the title bar of the browser. Word documents ignore this property. Set this property before opening the document for output. Type — Type of output 'html' (default) | 'docx' | 'html-file' Type of output, specified as 'html', 'docx' or 'html-file'.
-
12 Classes – Alphabetical List Method Purpose getImagePrefix Get generated image name prefix for the document. getMainPartPath Get relative path of main part of output document. getOPCMainPart Get full path of main part of output document. moveToNextHole Move to next template hole. open Open this document. package Append file to OPC package of document. setCoreProperties Set core properties of document element. Examples Create a Template and Use it in a Report import mlreportgen.dom.
-
mlreportgen.dom.Template class • “Create an HTML Template” • “Use Style Sheets” See Also mlreportgen.dom.Document.createTemplate | mlreportgen.dom.
-
12 Classes – Alphabetical List mlreportgen.dom.TemplateHole class Package: mlreportgen.dom Hole to append to template Description Hole to append to a document template. You can append a template hole to these kinds of DOM objects: • Paragraph • TableEntry • Group • Template Construction templateHoleObj = TemplateHole() creates a hole with empty properties. templateHoleObj = TemplateHole(id) creates a hole having the specified id.
-
mlreportgen.dom.TemplateHole class determine the purpose of the hole when viewing the template in Microsoft Word (for Word templates) or in a Web browser (for HTML templates). The description is replaced by appended hole content in a report generated from the template. Output Arguments templateHoleObj — Hole to append to template mlreportgen.dom.TemplateHole object Hole to append to template, represented by an mlreportgen.dom.TemplateHole object.
-
12 Classes – Alphabetical List A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Tag — Tag for document element string Tag for document element, specified as a string. 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.
-
mlreportgen.dom.Text class mlreportgen.dom.Text class Package: mlreportgen.dom Text object Description Text string to include in a document element Construction textObj = Text() creates an empty text object. textObj = Text(text) creates a text object containing the specified text string. textObj = Text(text,styleName) creates a text object containing the specified text string using the specified style.
-
12 Classes – Alphabetical List Output Arguments textObj — Text string mlreportgen.dom.Text object Text string, represented by an mlreportgen.dom.Text object. Properties BackgroundColor — Background color string Specify one of these as a string: • The name of a color. The name must be a CSS color name. See http:// www.crockford.com/wrrrld/color.html. • A hexadecimal RGB (truecolor) value as #RRGGBB. For example, #0000ff is a shade of blue.
-
mlreportgen.dom.Text class Content — Text string contained by this document element string Text string contained by this document element. CustomAttributes — Custom attributes of document element array of mlreportgen.dom.CustomAttribute objects HTML or Microsoft Word must support the custom attributes of this document element. FontFamilyName — Name of font family for text string The name of a font family. To specify substitutions for this font, do not set this property.
-
12 Classes – Alphabetical List • pi — picas • pt — points • px — pixels Id — ID for document element string A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Italic — Option to use italics for text [] (default) | logical value To use italics for text, set this property to true.
-
mlreportgen.dom.Text class The style specified by styleName must be defined in the template used to create the document element to which this text is appended. Tag — Tag for document element string Tag for document element, specified as a string. 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.
-
12 Classes – Alphabetical List Border String Description Supported Output Types single Single line HTML and Word thick Thick line Word wave Wavy line Word waveyDouble Double wavy line Word waveyHeavy Heavy wavy Word words Underline non-space characters only Word If this property is empty and StyleName property of this document element specifies a style sheet style, the type of underline is determined by that style.
-
mlreportgen.dom.Text class Border String Description Supported Output Types pre Preserves white space. Text HTML wraps only on line breaks. Acts like the
tag in HTML. pre-line Sequences of white space collapse into a single white space. Text wraps. pre-wrap Preserves white space.
-
12 Classes – Alphabetical List More About • 12-334 “Report Formatting Approaches”
-
mlreportgen.dom.Underline class mlreportgen.dom.Underline class Package: mlreportgen.dom Draw line under text Description Draw line under text Construction underline = Underline() draws a single line under text. underline = Underline(type) draws a line of the specified type under the text. underline = Underline(type,color) draws a line of the specified type and color under the text. The color parameter must be a mlreportgen.dom.Color object.
-
12 Classes – Alphabetical List String Description Applies To DOCX 'dashed' Dashed underline X 'dashedHeavy' Thick, dashed underline X 'dashLong' Long, dashed underline X 'dashLongHeavy' Thick, long, dashed underline X 'dotDash' Dot dash underline X 'dotDotDash' Dash dot dot underline X 'dashDotDotHeavy' Thick dash dot dot underline X 'dashDotHeavy' Thick dash dot underline X 'none' No underline X 'wave' Wavy underline X 'wavyDouble' Two wavy underlines X 'wavyHeavy' Th
-
mlreportgen.dom.Underline class Data Types: char Color — Color of underline mlreportgen.dom.Color object Color of the underline, specified by an mlreportgen.dom.Color object. Id — ID for document element string A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Tag — Tag for document element string Tag for document element, specified as a string. A session-unique ID is generated as part of document element creation.
-
12 Classes – Alphabetical List mlreportgen.dom.UnorderedList class Package: mlreportgen.dom Unordered (bulleted) list Description Specifies an unordered (bulleted) list. Construction unorderedListObj = UnorderedList() creates an empty unordered list. unorderedListObj = UnorderedList(items) creates an unordered list from a cell array of strings specifying the list items.
-
mlreportgen.dom.UnorderedList class • mlreportgen.dom.Table • mlreportgen.dom.Image • mlreportgen.dom.CustomElement • Horizontal one-dimensional array (for a sublist) To append an ordered list, use an OrderedList DOM object instead of using the listItems argument. Output Arguments unorderedListObj — Content to include in each item in the unordered list mlreportgen.dom.UnorderedList object An mlreportgen.dom.UnorderedList object representing an unordered list of the specified list items.
-
12 Classes – Alphabetical List Tag — Tag for document element string Tag for document element, specified as a string. 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. Specify your own tag value, for example, to make it easier to identify where an issue occurred during document generation.
-
mlreportgen.dom.UnorderedList class See Also mlreportgen.dom.ListItem | mlreportgen.dom.
-
12 Classes – Alphabetical List mlreportgen.dom.VAlign class Package: mlreportgen.dom Vertical alignment of document object Description Specifies vertical alignment of objects. Construction vAlignObj = VAlign() creates an alignment object having the value 'top'. vAlignObj = VAlign(value) creates an alignment object having the specified value. Input Arguments value — Specify vertical alignment 'top' (default) | 'bottom' | 'middle' String that specifies the vertical alignment of a document element.
-
mlreportgen.dom.VAlign class A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Tag — Tag for document element string Tag for document element, specified as a string. 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.
-
12 Classes – Alphabetical List mlreportgen.dom.VerticalAlign class Package: mlreportgen.dom Vertical alignment of text Description Specifies vertical alignment of text. Construction verticalAlignObj = VerticalAlign() creates a superscript alignment. verticalAlignObj = VerticalAlign(align) creates an alignment of the specified type.
-
mlreportgen.dom.VerticalAlign class A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Tag — Tag for document element string Tag for document element, specified as a string. 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.
-
12 Classes – Alphabetical List More About • 12-346 “Report Formatting Approaches”
-
mlreportgen.dom.WarningMessage class mlreportgen.dom.WarningMessage class Package: mlreportgen.dom Warning message Description Create a warning message with the specified text originating from the specified source object. Construction warningMsgObj = WarningMessage(text,source) creates a warning message with the specified text originating from the specified source object. Input Arguments text — Message text string The text to display for the message.
-
12 Classes – Alphabetical List Properties Id — ID for document element string A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Source — Source DOM object from which message originates a DOM object Source DOM object from which the message originates. Tag — Tag for document element string Tag for document element, specified as a string. A session-unique ID is generated as part of document element creation.
-
mlreportgen.dom.WarningMessage class Examples Create a Warning Message import mlreportgen.dom.*; d = Document('test','html'); dispatcher = MessageDispatcher.getTheDispatcher; l = addlistener(dispatcher,'Message', ... @(src, evtdata) disp(evtdata.Message.formatAsText)); open(d); dispatch(dispatcher,WarningMessage('invalid chapter',d)); p = Paragraph('Chapter '); p.Tag = 'chapter title'; p.Style = {CounterInc('chapter'),...
-
12 Classes – Alphabetical List mlreportgen.dom.WhiteSpace class Package: mlreportgen.dom White space type Description Preserves white space and line breaks in text. Construction ws = WhiteSpace() collapses white space. ws = WhiteSpace(option) applies the specified white space option to white space in a Text object. Input Arguments option — White space type string String specifying the white space type. String Description 'preserve' Preserves white space and line breaks.
-
mlreportgen.dom.WhiteSpace class String Description 'pre' White space is preserved by the browser. Text wraps only on line breaks. Acts like the
tag in HTML. 'pre-line' Sequences of white spaces collapses into a single white space. Text wraps when necessary and on line breaks. 'pre-wrap' White space is preserved by the browser. Text wraps when necessary and on line breaks. Output Arguments ws — White space type mlreportgen.dom.WhiteSpace object White space type, represented by an mlreportgen.
-
12 Classes – Alphabetical List String specifying the white space type. String Description 'preserve' Preserves white space and line breaks. This is the only option that works in Microsoft Word and in the MATLAB browser. 'normal' Sequences of white spaces collapse into a single white space. Text wraps when necessary. This is default. 'nowrap' Sequences of white spaces collapse into a single white space. Text does not wrap to the next line.
-
mlreportgen.dom.WhiteSpace class close(d); rptview('test',doctype); See Also mlreportgen.dom.
-
12 Classes – Alphabetical List mlreportgen.dom.WidowOrphanControl class Package: mlreportgen.dom Widow and orphan handling Description Specifies whether to prevent widows and orphans. This format applies only to Microsoft Word documents. Construction widowOrphanControlObj = WidowOrphanControl() prevents a page break after the first line of a paragraph (orphan) or before the last line of a paragraph (widow). widowOrphanControlObj = WidowOrphanControl(tf) prevents orphans and widows if tf is true.
-
mlreportgen.dom.WidowOrphanControl class Properties Id — ID for document element string A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Tag — Tag for document element string Tag for document element, specified as a string. 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.
-
12 Classes – Alphabetical List mlreportgen.dom.Width class Package: mlreportgen.dom Object width Description Specifies the width of an object, such as an image or a table cell. Construction widthObj = Width() creates a format object that specifies a width of 1 inch. widthObj = Width(value) creates a width object having the specified width. Input Arguments value — Width of object string Width of object, such as an image or a table cell, specified as a string.
-
mlreportgen.dom.Width class Output Arguments widthObj — Object width mlreportgen.dom.Width object Object width, represented by an mlreportgen.dom.Width object. Properties Id — ID for document element string A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID. Tag — Tag for document element string Tag for document element, specified as a string. A session-unique ID is generated as part of document element creation.
-
12 Classes – Alphabetical List • pt — points • px — pixels • % — percent Examples Set Width and Other Formats for a Table import mlreportgen.dom.*; doctype = 'html'; d = Document('test',doctype); t = Table(magic(5)); t.Style = {Border('inset','crimson','6pt'),... Width('50%')}; t.TableEntriesInnerMargin = '6pt'; t.TableEntriesHAlign = 'center'; t.TableEntriesVAlign = 'middle'; append(d,t); close(d); rptview('test',doctype); See Also mlreportgen.dom.Height | mlreportgen.dom.Image | mlreportgen.dom.
-
13 Create a Report Program • “Create a Report Program” on page 13-3 • “Document Object Model” on page 13-4 • “Construct a DOM Object” on page 13-6 • “Import the DOM API Package” on page 13-7 • “Get and Set DOM Object Properties” on page 13-8 • “Create a Document Object to Hold Content” on page 13-9 • “Add Content to a Report” on page 13-11 • “Clone a DOM Object” on page 13-13 • “Add Content as a Group” on page 13-14 • “Stream a Report” on page 13-16 • “Report Packages” on page 13-17 • “Close a Report” on pa
-
13 Create a Report Program • “Create and Format Text” on page 13-41 • “Create and Format Paragraphs” on page 13-46 • “Create and Format Lists” on page 13-52 • “Create and Format Tables” on page 13-58 • “Create Links” on page 13-73 • “Create and Format Images” on page 13-76 • “Create a Table of Contents” on page 13-78 • “Create Image Maps” on page 13-85 • “Automatically Number Document Content” on page 13-87 • “Appending HTML to DOM Reports” on page 13-91 • “Append HTML Content to DOM Reports” on page 13-9
-
Create a Report Program Create a Report Program The MATLAB Report Generator includes a set of functions, called the DOM (Document Object Model) API, that allows you to generate Word, HTML, and PDF reports programmatically. For example, the following MATLAB script uses the API to generate and display an HTML report displaying today’s date. import mlreportgen.dom.*; report = Document('today'); append(report, ['Today is ', date, '.']); close(report); rptview(report.
-
13 Create a Report Program Document Object Model The DOM API creates a representation of a report document in your system's memory. Such a representation is often referred to as a Document Object Model (DOM). Hence, the DOM API's name. The DOM API's document object model consists of a hierarchical set of data structures, known as objects, that represent the document and its contents. At the top of the hierarchy is an object representing the document itself.
-
Document Object Model • “Import the DOM API Package” on page 13-7 13-5
-
13 Create a Report Program Construct a DOM Object The DOM API includes a special set of MATLAB functions, called constructors, for creating DOM objects of various types, or classes. The name of an object constructor is the name of the MATLAB class from which the DOM creates an object. For example, the name of the constructor for a DOM paragraph object is mlreportgen.dom.Paragraph. Some constructors do not require any arguments.
-
Import the DOM API Package Import the DOM API Package All DOM class names, and hence constructor names, include the prefix mlreportgen.dom. To avoid the need to include the prefix in your code, insert the following statement at the beginning of any script or function that uses the DOM API. import mlreportgen.dom.*; The documentation frequently refers to DOM API objects and functions without the mlreportgen.dom prefix, assuming that you have already imported the DOM API package.
-
13 Create a Report Program Get and Set DOM Object Properties To get or set the property of a document object, use dot notation, which involves appending a period to the name of a variable that references the object, followed by the property name. For example, the following line saves the current font family of a paragraph referenced by p and sets it to a new font family. saveFont = p.FontFamily; p.
-
Create a Document Object to Hold Content Create a Document Object to Hold Content Every report program must create an mlreportgen.dom.Document object to hold report content. Use the mlreportgen.dom.Document constructor to create a Document object. If you use the constructor with no arguments, the DOM API creates an HTML document named Untitled.htmx in the current folder. You can specify the file system path of the report as the first argument of the constructor.
-
13 Create a Report Program • “Construct a DOM Object” on page 13-6 More About 13-10 • “Form-Based Reporting” on page 13-28 • “Document Object Model” on page 13-4
-
Add Content to a Report Add Content to a Report The DOM append function allows you to add content to documents, paragraphs, tables, and other DOM objects that serve as containers for report content. The append function takes two arguments. The first argument is the object to which the content is to be appended. The second is the content to be appended. In this example, the text Hello World is appended to the document.
-
13 Create a Report Program append(d,Table(tableArray)); See Also Functions mlreportgen.dom.Paragraph.
-
Clone a DOM Object Clone a DOM Object If you attempt to append an object more than once to the same object or to append an object to multiple objects, the append function throws an error. If you need to append an object multiple times, use the clone function to create copies of the object. d = Document('MyDoc'); text = append(d,'Hello World'); text.Color = 'magenta'; text = clone(text); text.Color = 'cyan'; append(d,text); See Also Functions mlreportgen.dom.Paragraph.
-
13 Create a Report Program Add Content as a Group You can use a group to include the same content in different parts of a report. The DOM API clones the members of a group before appending them to another object. This example shows the key code to include. After describing the steps involved in using a group, this example includes code for a complete report that uses a group. 1 Define the DOM objects that you want to include repeatedly in a report.
-
Add Content as a Group p2.Bold = true; append(doc,p1); append(doc,p2); append(doc,disclaimer); close(doc); rptview('groupReport','html'); See Also Functions mlreportgen.dom.Paragraph.append Classes mlreportgen.dom.
-
13 Create a Report Program Stream a Report The DOM API supports two modes of appending content to a document: • In-memory — Creates the document entirely in memory. In-memory is the default mode. • Streaming — Streaming mode writes objects to disk as they are appended to a document. Streaming mode allows you to create large reports on systems with modest memory. To enable streaming mode, set the StreamOutput property of the Document object for the report to true. d = Document('MyDoc'); d.
-
Report Packages Report Packages A Microsoft Word document packages all of its contents, text, images, style sheets, and so on, in a single compressed file having a docx extension. For HTML documents, the DOM API defines an analogous packaging scheme, with an htmtx compressed file extension. By default, the DOM API generates HTML reports as htmx files.
-
13 Create a Report Program Close a Report The last step in creating a report with the DOM API is to close the report. Closing a report writes out any content that remains in memory and closes the report file. Use the close function. d = Document('MyDoc'); append(d,'Hello World'); close(d); See Also Functions mlreportgen.dom.Document.
-
Display a Report Display a Report The DOM API rptview function allows you to display a generated report in a viewer appropriate to its document type: the Microsoft Word editor for Word documents, an HTML browser for HTML reports, and Adobe Acrobat for PDF reports. The rptview function takes two arguments: • The path of the report • The output type: 'html', 'docx', or 'pdf' If you omit the second argument (the output type), rptview uses the output type from the report’s extension.
-
13 Create a Report Program Report Formatting Approaches The DOM API supports three approaches to formatting document objects in reports: • Style sheets — Assign to a document object (such as a paragraph, table, or list) a style from a Microsoft Word or HTML template, using the StyleName property of a document object. A style is a collection of formats. • Format objects — Use format objects, such as a FontFamily object, with the Style property of a document object.
-
Use Style Sheets Use Style Sheets A style is a collection of formats that together define the appearance of a document object, such as a paragraph, table, or list. Microsoft Word allows you to define styles and then assign them to paragraphs, tables, and other documents by name. The assigned style then determines how Word renders the document object on the screen or printed page. Word stores the styles in a document as an object called a style sheet. HTML browsers support a similar capability.
-
13 Create a Report Program Related Examples • “Create a Microsoft Word Template” on page 13-111 • “Modify Styles in a Microsoft Word Template” on page 13-117 • “Create an HTML Template” on page 13-122 • “Modify Styles in an HTML Template” on page 13-127 More About 13-22 • “Report Formatting Approaches” on page 13-20 • “Format Inheritance” on page 13-25
-
Use Format Objects Use Format Objects A format object is a MATLAB program entity that defines the properties and functions of a specific type of document format, such as a font family or font size. The DOM API provides a set of constructors for creating format objects corresponding to most of the formatting options available in HTML and Word documents. Most DOM document objects include a Style property that you can set to a cell array of format objects.
-
13 Create a Report Program Use Format Properties Most DOM objects have a set of properties corresponding to the format options most commonly used for an object of that class. You can use dot notation with format properties to specify formats for an object. For example, the following code sets the font and color of text in a paragraph, using the Color, FontFamily, and FontSize format properties of a Paragraph object. p = Paragraph('Danger!'); p.Color = 'red'; p.FontFamily = 'Arial'; p.
-
Format Inheritance Format Inheritance The DOM API allows you to use both template-based styles and format object-based styles (or equivalent format properties) to specify the appearance of an object. If you set both the StyleName and the Style property of an object, the formats in the Style property override corresponding formats specified by the template-based style of the StyleName property. Consider, for example, the following script.
-
13 Create a Report Program Create Object Containers You can use an mlreportgen.dom.Container object to create an HTML container object, such as a div, section, or article, not otherwise supported by the DOM API and to simulate HTML format inheritance in Word output. In HTML output, a Container object generates an HTML element of the type specified by its HTMLTag property and containing HTML elements corresponding to its DOM contents.
-
Create Object Containers Related Examples • “Use Style Sheets” on page 13-21 • “Use Format Objects” on page 13-23 More About • “Report Formatting Approaches” on page 13-20 13-27
-
13 Create a Report Program Form-Based Reporting The DOM API supports a form-based approach to report generation. You can use Microsoft Word or an HTML editor to create a template that defines the fixed content of the form, interspersed with holes (blanks), that your DOM report program fills with generated content.
-
Fill the Blanks in a Report Form Fill the Blanks in a Report Form Navigate Holes in the Form When you create a form template, you associate an ID with each hole in the template. This allows you to navigate the holes in a form, using the DOM moveToNextHole function. The first time you execute this function, the DOM API copies to the output document all of the text up to the first hole in the template.
-
13 Create a Report Program Related Examples • “Use Subforms in a Report” on page 13-31 • “Create a Microsoft Word Template” on page 13-111 • “Add Holes in a Microsoft Word Template” on page 13-112 • “Create an HTML Template” on page 13-122 • “Add Holes in an HTML Template” on page 13-124 More About • 13-30 “Form-Based Reporting” on page 13-28
-
Use Subforms in a Report Use Subforms in a Report A document part is a form that you can add to a document or to another document part. Document parts simplify generation of sections of a report that have the same form, such as sections that report on the results of a series of tests or the performance of a series of financial portfolios. Use a similar approach as you do for main document forms. 1 Create a template that defines the form of the document part. 2 For each section: a Create an mlreportgen.
-
13 Create a Report Program More About • 13-32 “Form-Based Reporting” on page 13-28
-
Create Document Part Template Libraries Create Document Part Template Libraries In this section... “Create a Document Part Template Library in a Microsoft Word Template File” on page 13-33 “Create a Document Part Template Library in an HTML Template File” on page 13-35 A document part template library is a set of document part templates stored by name in another template.
-
13 Create a Report Program 13-34 3 On the Word ribbon, select the Insert tab. 4 Select the content that you have created for the document part template. 5 On the Insert ribbon, click the Explore Quick Parts button. Select Save Selection to the Quick Part Gallery to save a copy of the selected prototype in the Quick Part Gallery of the template file. The Create New Building Block dialog box appears.
-
Create Document Part Template Libraries Otherwise, select mlreportgen from the Category list. 8 In the Description field, enter a template description and click OK. 9 Delete the content that served as the prototype for the document part template. 10 Save the template file. Modify a Document Part Template in a Quick Part Gallery You can modify a document part template located in a Quick Part Gallery. 1 Open the Word template that contains the document part template.
-
13 Create a Report Program API. You can modify these templates and add your own templates by editing this file, using the markup conventions. You can also create a template part library file in an HTML template that you create from scratch. In this case, you must ensure that the file observes the HTML markup conventions that the DOM API uses to indicate the name and content of a document part template in a document part library.
-
Create Document Part Template Libraries • “Create a Microsoft Word Template” on page 13-111 • “Add Holes in a Microsoft Word Template” on page 13-112 • “Create an HTML Template” on page 13-122 • “Add Holes in an HTML Template” on page 13-124 More About • “Form-Based Reporting” on page 13-28 13-37
-
13 Create a Report Program Object-Oriented Report Creation Note: This section assumes that you are familiar with object-oriented programming in MATLAB. For information on object-oriented programming in MATLAB, see “ObjectOriented Programming” in the MATLAB documentation. The DOM API supports an object-oriented approach to creating report programs. With this approach, you subclass the DOM Document and DocumentPart classes to create document and document part classes tailored to your report application.
-
Simplify Filling in Forms Simplify Filling in Forms The object-oriented approach allows you to exploit the DOM fill method to simplify form-based reporting. The fill method is intended to be used with instances of classes derived from mlreportgen.dom.Document or mlreportgen.dom.DocumentPart class.
-
13 Create a Report Program Related Examples • “Use Subforms in a Report” on page 13-31 • “Fill the Blanks in a Report Form” on page 13-29 • “Create a Microsoft Word Template” on page 13-111 • “Add Holes in a Microsoft Word Template” on page 13-112 • “Create an HTML Template” on page 13-122 • “Add Holes in an HTML Template” on page 13-124 More About • 13-40 “Form-Based Reporting” on page 13-28
-
Create and Format Text Create and Format Text In this section... “Create Text” on page 13-41 “Create Special Characters” on page 13-41 “Append HTML or XML Markup” on page 13-42 “Format Text” on page 13-42 Create Text You can create text by appending a string to a document, paragraph, table entry, or list item. The DOM append function converts the string to a Text object, appends it, and returns the Text object. Use the Text object to format the text.
-
13 Create a Report Program p = Paragraph(CharEntity('pound')); append(d,p); append(p,'3'); close(d); rptview('test','html'); Append HTML or XML Markup To append HTML markup to an HTML document or Microsoft Word XML markup to a Word document, use an mlreportgen.dom.RawText object. This is useful for creating HTML or Word elements that the DOM API does not support directly, such as the HTML div element. This example shows how to create a RawText object to append HTML markup. import mlreportgen.dom.
-
Create and Format Text fontFamily = FontFamily('Arial'); fontFamily.BackupFamilyNames = {'Helvetica'}; t.Style = {fontFamily}; t.Bold = true; close(d); rptview('test','html'); Use these format objects and format properties to format text.
-
13 Create a Report Program 1 Open the Word template used with the report. 2 Open the Styles pane. 3 Click the Manage Styles button . 4 Click New Style. 5 In the Create New Style from Formatting dialog box, set Style type to Character or Linked (paragraph and character). For more information about working with Word styles, see “Modify Styles in a Microsoft Word Template” on page 13-117.
-
Create and Format Text if passed status = 'Passed'; statusStyle = 'Pass'; else status = 'Failed'; statusStyle = 'Fail'; end t2 = Text(status,statusStyle); statusPara = Paragraph(t1); append(statusPara,t2); append(rpt, statusPara); close(rpt); rptview(rpt.OutputPath); Override Template Formats You can use programmatic formats to override the formats defined in a template-based style. For example, suppose you define a style named AlertLevel in your template and set the color to be green by default.
-
13 Create a Report Program Create and Format Paragraphs In this section... “Create a Paragraph” on page 13-46 “Create a Heading” on page 13-46 “Format a Paragraph” on page 13-47 Create a Paragraph You can create a paragraph by using an mlreportgen.dom.Paragraph constructor with a text string. For example: p = Paragraph('Text for a paragraph'); You can also specify these DOM objects in a Paragraph object constructor. • mlreportgen.dom.Text • mlreportgen.dom.ExternalLink • mlreportgen.dom.
-
Create and Format Paragraphs Format a Paragraph You can format a paragraph programmatically, using DOM format objects or format properties. You can also use Word and HTML template styles. For information about these formatting techniques and format inheritance, see “Report Formatting Approaches” on page 13-20. Note: You can use the same format objects and properties for Heading objects as you do for Paragraph objects.
-
13 Create a Report Program 13-48 Formatting Format Object Format Property East Asian font FontFamily n/a Font size FontSize FontSize Foreground color Color Color Background color BackgroundColor BackgroundColor Bold Bold Bold Italic Italic Italic Subscript or superscript VerticalAlign n/a Strike through Strike Strike Underline type (single, double, etc.
-
Create and Format Paragraphs Formatting Format Object Format Property Keep paragraph on same page KeepLinesTogether n/a Eliminate widows and orphans WidowOrphanControl n/a Table of contents level of paragraph OutlineLevel OutlineLevel Format a Paragraph Using Microsoft Word Style Sheets You can format using an existing style in a Word template or using a template style that you modify or add. To define a paragraph style in a Word template, start by using these steps.
-
13 Create a Report Program } For more information about using HTML styles with DOM objects, see “Modify Styles in an HTML Template” on page 13-127. Apply a Style to a Paragraph Object Apply a template style to a Paragraph object either as the second argument in a Paragraph object constructor or by setting the StyleName property to a template style. For example, suppose you have defined styles named BodyPara and TableTitle in the template for your report.
-
Create and Format Paragraphs append(rpt, p); close(rpt); rptview(rpt.OutputPath); See Also Classes mlreportgen.dom.Bold | mlreportgen.dom.FontFamily | mlreportgen.dom.FontSize | mlreportgen.dom.Italic | mlreportgen.dom.KeepLinesTogether | mlreportgen.dom.KeepWithNext | mlreportgen.dom.LineSpacing | mlreportgen.dom.PageBreakBefore | mlreportgen.dom.Paragraph | mlreportgen.dom.Strike | mlreportgen.dom.Text | mlreportgen.dom.
-
13 Create a Report Program Create and Format Lists In this section... “Create an Unordered List” on page 13-52 “Create an Ordered List” on page 13-53 “Create a Multilevel List” on page 13-55 “Format Lists” on page 13-56 You can add two kinds of lists to a report: • Unordered (bulleted) • Ordered (numbered) • Multilevel (lists that contain ordered or unordered lists in any combination) Create an Unordered List You can create an unordered list from a numeric or cell array or from scratch.
-
Create and Format Lists close(d); rptview('myListReport','html'); You can also create an unordered list from an array by including the array in an UnorderedList object constructor. import mlreportgen.dom.*; d = Document('unorderedListReport','html'); ul = UnorderedList({Text('item1'),'item 2',3}); append(d,ul); close(d); rptview('unorderedListReport','html'); Create an Unordered List from Scratch You can create an unordered list from scratch by creating mlreportgen.dom.
-
13 Create a Report Program • Creating an ordered list from a cell array allows you to include items of different types in the list. • Creating a list from scratch is useful for including multiple objects in a list item. Create an Ordered List from an Array You can create an unordered list from a numeric array or cell array by including the array in an mlreportgen.dom.OrderedList object constructor. In the cell array, you can include strings, numbers, and some DOM objects, such as a Text object.
-
Create and Format Lists Create a Multilevel List A multilevel list is an ordered or unordered list whose list items contain ordered or unordered lists. You can create lists that have as many as nine levels. You can create multilevel lists either from cell arrays or from scratch. Creating a multilevel list from scratch is useful for creating list items that contain multiple paragraphs, paragraphs and tables, and other combinations of document elements.
-
13 Create a Report Program d = Document('orderedListReport','html'); ol = OrderedList({'Start MATLAB', ... 'Create a rank 3 or 4 magic square:'}); optionList = UnorderedList; li = ListItem('>> magic(3)'); table = append(li,Table(magic(3))); table.Width = '1in'; append(optionList, li); li = ListItem('>> magic(4)'); table = append(li,Table(magic(4))); table.
-
Create and Format Lists Create a Word List Style To define a list style in a Word template, select List as the style type in the Create New Style from Formatting dialog box (see “Add Styles to a Word Template” on page 13-118). Create an HTML List Style To define a list style in an HTML template cascading style sheet (CSS), use the ul element for unordered list styles and the ol element for ordered list styles. You can use the parent element selector (>) to define multilevel list styles.
-
13 Create a Report Program Create and Format Tables In this section...
-
Create and Format Tables Create a Table from a Two-Dimensional Array You can create a table by appending a two-dimensional numeric array or a cell array containing built-in MATLAB data (strings and numbers) and DOM objects (Text, Table, Image, etc.) to a document. The append function converts the array to a Table object, appends it to the document, and returns the Table object, which you can then format. You can also create a Table object directly by including a two-dimensional array in its constructor.
-
13 Create a Report Program table = Table(a); text = table.entry(i(i1),i1).Children(1); text.Color = 'red'; append(doc,table); close(doc); rptview(doc.OutputPath); Create a Table from Scratch You can create a table from scratch by creating TableEntry objects, appending them to TableRow objects, and appending the TableRow objects to a Table object. This approach is useful when you need to create table entries that span multiple columns or rows that have a different number of entries.
-
Create and Format Tables close(doc); rptview(doc.OutputPath); Format a Table You can format a table programmatically, using DOM format objects or format properties. You can also use Word and HTML template styles. For information about these formatting techniques and format inheritance, see “Report Formatting Approaches” on page 13-20. Format a Table Programmatically You can use format objects to format tables or use Table format properties to specify commonly used table formats.
-
13 Create a Report Program Formatting Format Object Format Property Color of border Border BorderColor Thickness of border Border BorderWidth Create left, right, top, or bottom table border Border n/a Collapse table and table entry borders (HTML) BorderCollapse BorderCollapse Create column separator ColSep ColSep Column separator color ColSep ColSepColor Column separator thickness ColSep ColSepWidth Create row separator RowSep RowSep Row separator color RowSep RowSepColor Row
-
Create and Format Tables Formatting Table Object Property Align entries horizontally (left, right, center) TableEntriesValign Create space (padding) between entry boundary and content TableEntriesInnerMargin Apply a set of format objects to all table entries TableEntriesStyle Keep a Table and Its Title on the Same Page Use the KeepLinesTogether and KeepWithNext paragraph formats to keep a table title and the table together on the same page.
-
13 Create a Report Program append(rpt, ca); close(rpt); rptview(rpt.OutputPath); Format a Table Using Microsoft Word Style Sheets You can format tables using an existing Word styles in a template or a template style that you modify or add. To define a table style in a Word template, start by using these steps. 1 Open the Word template used with the report. 2 Open the Styles pane. 3 Click the Manage Styles button . 4 Click New Style.
-
Create and Format Tables font-family: Arial, Helvetica, sans-serif; font-size: 11pt; text-align: center; } Apply a Table Style to a Table Once you have defined a table style in a template, you can apply it to a Table object in your report program either as the second argument in the Table object constructor or by setting it to the StyleName property of the Table object. For example, suppose you have defined styles named BodyPara, TableTitle, and RuledTable in the template for your report.
-
13 Create a Report Program Create a Formal Table To create a formal table, use the same basic approaches as with an informal table, except that you must use an mlreportgen.domlFormalTable constructor to construct a formal table. The constructor optionally accepts a two-dimensional numeric array or a cell array of MATLAB data for the body, header, and footer sections.
-
Create and Format Tables as a whole. Not all formal table formats apply to formal table sections. For example, you cannot indent a header, body, or footer section independently of the containing table. In other words, the OuterLeftMargin property does not apply to formal table sections. Apply Table Styles to a Formal Table and Its Sections Use the same procedure for defining formal table styles in Word and HTML templates as you use for defining informal table styles.
-
13 Create a Report Program row = TableRow(); append(row,TableEntry('data11')); append(row,TableEntry('data12')); append(table,row); append(rpt,table); close(rpt); rptview(rpt.OutputPath); Format a Table Row Use these format objects and format properties to format a table row.
-
Create and Format Tables table = Table(magic(rank)); table.Border = 'single'; table.BorderWidth = '1px'; grps(1) = TableColSpecGroup; grps(1).Span = rank; grps(1).Style = {Width('0.2in'),Color('green')}; specs(1) = TableColSpec; specs(1).Span = 1; specs(1).Style = {Width('0.5in'),Bold,Color('red')}; grps(1).ColSpecs = specs; table.
-
13 Create a Report Program • Image • Table • OrderedList • UnorderedList • CustomElement Format Table Entries Programmatically You can use format objects or TableEntry format properties to format a table entry programmatically.
-
Create and Format Tables t.TableEntriesStyle(Border('solid','black','1 px')); Properties you set for a TableEntry object take precedence over TableEntriesStyle format objects. Format Table Entries Using Style Sheets For HTML reports, you can use styles defined in an HTML template style sheet to format table entries. When defining a table entry style, use a td element selector. For example: td.
-
13 Create a Report Program More About • 13-72 “Report Formatting Approaches” on page 13-20
-
Create Links Create Links In this section... “Links” on page 13-73 “Create a Link Target” on page 13-73 “Create an External Link” on page 13-74 “Create an Internal Link” on page 13-74 “Add Text or Images to Links” on page 13-74 Links You can add these kinds of links to a report: • External — Link to a location outside of the report, such as an HTML page or a PDF file. Use an mlreportgen.dom.ExternalLink object. • Internal — Link to locations in the report. Use an mlreportgen.dom.InternalLink object.
-
13 Create a Report Program Create an External Link Use an mlreportgen.dom.ExternalLink object to create an external link, specifying the link target and the link text. import mlreportgen.dom.* d = Document('mydoc'); append(d,ExternalLink('http://www.mathworks.com/','MathWorks')); close(d); rptview('mydoc','html'); Create an Internal Link To set up links to a location in a report, append an mlreportgen.dom.InternalLink object to the document or document element. Use an mlreportgen.dom.
-
Create Links Related Examples • “Create Image Maps” on page 13-85 • “Add Content to a Report” on page 13-11 More About • “Report Formatting Approaches” on page 13-20 13-75
-
13 Create a Report Program Create and Format Images In this section... “Create an Image” on page 13-76 “Resize an Image” on page 13-77 “Image Storage” on page 13-77 “Links from an Image” on page 13-77 Create an Image To create an image to a report, create an mlreportgen.dom.Image object. You can append it to one of these document element objects: • Document • Group • Paragraph • ListItem • TableEntry For example, you can create a MATLAB figure, save it as an image, and add the image to a report.
-
Create and Format Images close(d); rptview(d.OutputPath); For a list of supported image formats, see mlreportgen.dom.Image. Resize an Image To resize an image object, you can: • Set the Image.Height and Image.Width properties. • Use an mlreportgen.dom.Height or mlreportgen.dom.Width object in an Image.Style property definition. For Microsoft Word reports, you can use an mlreportgen.dom.ScaleToFit object to scale an image so that it fits within the page margins.
-
13 Create a Report Program Create a Table of Contents In this section... “Create a Microsoft Word Table of Contents” on page 13-78 “Create an HTML Table of Contents” on page 13-80 “Set Outline Levels of Section Heads” on page 13-82 Create a Microsoft Word Table of Contents The DOM API relies on an automatic table-of-contents (TOC) generation feature of Word to generate a table of contents in a DOM Word report.
-
Create a Table of Contents 5 Select a TOC format option to generate a table of contents. For example, select the Built-In format option. The TOC appears. 6 Save the template. Update the TOC in a Word Report After you generate a Word report with the DOM API, open the report in Word and update the document. Updating a document refers to the process of updating the parts of a Word document that Word itself generates, such as a TOC, page numbers, and so on, to reflect changes in the document content.
-
13 Create a Report Program However, if you open a newly generated report yourself in Word, without first using rptview, perform these steps to get the TOC to appear. 1 In the Word template, select the TOC reference. 2 Open the Reference pane and click the Update Table button. 3 In the Update Table of Contents dialog box, select Update entire table and click OK. 4 Save the report.
-
Create a Table of Contents Create an HTML TOC Placeholder An HTML TOC placeholder element is an HTML div element with an id attribute set to toc.
You can create a TOC placeholder in any of the following ways.
-
13 Create a Report Program toc = CustomElement('div'); toc.CustomAttributes = {CustomAttribute('id', 'toc')}; append(toc, CustomText()); % Workaround for browser bug append(d, toc); append(d, Heading(1, 'Chapter 1')); append(d, Heading(2, 'Section 1')); close(d); rptview(d.OutputPath); Insert a Placeholder Programmatically Using a Document Part The document part template library of the DOM default template contains a document part for creating a TOC placeholder.
-
Create a Table of Contents Use Template-Defined Styles to Set Outline Levels You can use styles defined in the report’s template to set the outline level of a paragraph. For example, by default Word documents include a set of styles, Heading 1, Heading 2, and so on, that define outline levels for paragraphs you want to appear in a TOC. Your program can use these built-in styles to specify that paragraphs that serve as section heads appear in the TOC.
-
13 Create a Report Program object alone or in combination with template-based styles or format object-based styles. This example assumes that the template MyTemplate includes a TOC reference. import mlreportgen.dom.*; d = Document('MyReport','docx','MyTemplate'); h1 = {FontFamily('Arial'),FontSize('16pt')}; h2 = {FontFamily('Arial'),FontSize('14pt')}; h = append(d, Heading(1,'Chapter 1')); h.style = h1; h = append(d, Heading(2,'Section 1')); p.style = h2; close(d); rptview(d.
-
Create Image Maps Create Image Maps You can specify areas of an image to be links. Clicking the link area in an image in an HTML browser opens the target. You can map different areas in an image to different link targets. 1 Create an mlreportgen.dom.ImageArea object for each image area that is to serve as a link. You can specify text to display if the image is not visible. You can specify an image area to have one of these shapes: • Rectangle • Circle • Polygon For details, see mlreportgen.dom.ImageArea.
-
13 Create a Report Program close(d); rptview(d.OutputPath); See Also Classes mlreportgen.dom.Image | mlreportgen.dom.ImageArea | mlreportgen.dom.
-
Automatically Number Document Content Automatically Number Document Content In this section... “Automatically Number Content Programmatically” on page 13-87 “Automatically Number Content Using Part Templates” on page 13-89 You can automatically number document content, such as chapter, section, table, and figure headings. Append automatic numbering objects to the document where you want numbers to appear.
-
13 Create a Report Program 2 Append the AutoNumber to a Text, Paragraph, or Heading object that contains the text that precedes the automatic number. append(chapHead,chapterNumber); 3 Append an mlreportgen.dom.CounterInc format object to the Style property of the content object that you want to automatically number. Appending a CounterInc object increments the stream associated with the automatic number when the paragraph or heading is output. The updated value replaces the AutoNumber object. chapHead.
-
Automatically Number Document Content chapHead.Style = {CounterInc('chapter'), ... CounterReset('table'), ... WhiteSpace('preserve')}; append(d,chapHead); for i = 0:1; tableHead = Paragraph('Table '); append(tableHead,AutoNumber('chapter')) append(tableHead,'.'); append(tableHead, AutoNumber('table')); append(tableHead, ... sprintf('. Rank %i Magic Square',rank+i)); tableHead.Style = {CounterInc('table'), ... Bold, ... FontSize('11pt'), ...
-
13 Create a Report Program import mlreportgen.dom.* d = Document('MyReport','docx','MyReportTemplate'); for rank = 3:5 chapterPart = DocumentPart(d,'Chapter'); while ~strcmp(chapterPart.CurrentHoleId,'#end#') switch chapterPart.CurrentHoleId case 'ChapterTitle' append(chapterPart, ... sprintf('Rank %i Magic Square',rank)); case 'ChapterContent' table = append(chapterPart,magic(rank)); table.Width = '2in'; end moveToNextHole(chapterPart); end append(d, chapterPart); end close(d); rptview(d.
-
Appending HTML to DOM Reports Appending HTML to DOM Reports In this section... “Why Append HTML to a DOM Report?” on page 13-91 “Workflow for Appending HTML” on page 13-91 Why Append HTML to a DOM Report? You can append HTML markup or the entire contents of an HTML file to a programmatic report written with the document object model (DOM) API. Append HTML to: • Convert an existing HTML report to a Microsoft Word or PDF report.
-
13 Create a Report Program The HTML content that you append must be XML parsable. For a summary of those requirements and for a list of supported HTML elements and HTML CSS formats, see “HTML Code Requirements for DOM Reports” on page 13-101. See Also mlreportgen.dom.Document.addHTML | mlreportgen.dom.Document.addHTMLFile | mlreportgen.dom.HTML | mlreportgen.dom.
-
Append HTML Content to DOM Reports Append HTML Content to DOM Reports In this section... “Use an addHTML Method” on page 13-93 “Append an HTML Object” on page 13-94 “Address Errors” on page 13-94 You can append strings of HTML content to a DOM document or document part using either of these approaches: • Use the addHTML method with a Document or DocumentPart object. • Create and append an HTML object. If the HTML content that you append does not meet DOM requirements, the DOM API generates error messages.
-
13 Create a Report Program Append an HTML Object You can create an mlreportgen.dom.HTML object and append it to a DOM report. To append the content of an HTML object more than once in a report, use the clone method with the HTML object. Then append the cloned copy to the report. For example, you can create an HTML object from HTML markup to use for a Word report. import mlreportgen.dom.
-
Append HTML File Contents to DOM Reports Append HTML File Contents to DOM Reports In this section... “Use an addHTMLFile Method” on page 13-95 “Append an HTMLFile Object” on page 13-95 “Address Errors” on page 13-96 You can append HTML files to a DOM document or document part using either of these approaches: • Use the addHTMLFile method with a Document or DocumentPart object. • Create and append an HTMLFile object.
-
13 Create a Report Program For example, you can convert the contents of two HTML files to a DOM report in Word format. This example assumes that there are HTML files called myHTMLfile1.html and myHTMLfile2.htmlin the MATLAB current folder. import mlreportgen.dom.*; rpt = Document('MyHTMLReport','docx'); path = 'myHTMLfile1.html'; htmlFile1 = HTMLFile(path); htmlFile2 = HTMLFile('myHTMLFile2.html'); append(htmlFile1,htmlFile2) append(rpt,htmlFile1); close(rpt); rptview(rpt.
-
Use an HTML Cleanup Program Use an HTML Cleanup Program You can use an HTML cleanup program such as HTML Tidy to fix many issues and to identify issues you need to address manually. For a description of requirements for HTML content that you can append, see “HTML Code Requirements for DOM Reports” on page 13-101 . Use HTML Tidy to Fix HTML Code You can use the HTML Tidy program to fix HTML content so that it meets the requirements for appending to a DOM report.
-
13 Create a Report Program
Carlos Martinez | 38 | Lawyer |