Documentation

This is machine translation

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

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

rptview

Display DOM report

Syntax

rptview(report)
rptview(reportPath)
rptview(reportName,format)
rptview(docxfile,'pdf')

Description

example

rptview(report) displays the report document object in an appropriate viewer. report is an instance of the mlreportgen.dom.Document class.

example

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.

example

rptview(reportName,format) displays the report reportPath in an appropriate viewer, based on the format specified in format. Valid file formats are 'docx', 'html', 'html-file', 'pdf'.

example

rptview(docxfile,'pdf') converts a .docx Word report to PDF and displays the report in a PDF viewer.

Examples

collapse all

Display an HTML report. Include the file extension when you specify the report name in the rptview function.

import mlreportgen.dom.*;
d = Document('mydoc');

p = Paragraph('Hello World');
append(d,p);

close(d);
rptview('mydoc');

Display a PDF report.

import mlreportgen.dom.*;
rpt = Document('mydoc','pdf');

append(rpt, 'Hello World');

close(rpt);
rptview(rpt);

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 a report using the value of the OutputPath property of the mlreportgen.dom.Document object of the report.

import mlreportgen.dom.*;
d = Document('mydoc','docx');

p = Paragraph('Hello World');
append(d,p);

close(d);
rptview(d.OutputPath);

Create two reports with the same name, but with different formats and content. Specify the format to display the appropriate report.

import mlreportgen.dom.*;
d = Document('mydoc','html');

p = Paragraph('Hello World');
append(d,p);
close(d);

dWord = Document('mydoc','docx');
p = Paragraph('Hello again, World');
append(dWord,p);
close(dWord);

rptview('mydoc','docx');

Input Arguments

collapse all

Report document object name , specified as the mlreportgen.dom.Document object used to generate the report to view.

Path to a specific report file, including the file extension, specified as a string or character vector.

The report file name extension determines the viewer in which the report displays.

File ExtensionViewer

.htmx

MATLAB® Web browser

.zip

MATLAB Web browser

.docx

Microsoft® Word

.pdf

PDF viewer

The full path of a report, without the file extension, specified as a string or character vector. Alternatively, you can use the value of the OutputPath property of the mlreportgen.dom.Document object that you create for the report.

Report output format, specified as one of these values:

  • 'html'

  • 'html-file'

  • 'docx'

  • 'pdf'

Word .docx file to convert to PDF, specified as a Word file having a .docx extension.

Introduced in R2014b

Was this topic helpful?