Main Content

rptview

Class: mlreportgen.report.Report
Namespace: mlreportgen.report

Open generated report file in viewer

Syntax

rptview(report)

Description

rptview(report) opens the generated report file in a viewer. The viewer used for displaying the report depends on the report type. For example, a report of type HTML opens in the default HTML browser.

To open a Microsoft® Word document on a Linux® or Macintosh platform, rptview calls the soffice command. On Linux, Apache® OpenOffice® or LibreOffice® must be installed. On Macintosh, Apache OpenOffice must be installed in the /Applications folder.

Input Arguments

expand all

Report, specified as a report object. To create the report input, use mlreportgen.report.Report.

Limitations

  • rptview does not support viewing Word (.docx) reports in MATLAB Online.

Tips

Calling rptview with an argument value other than an mlreportgen.report.Report object invokes the rptview function.

For example, in the following code, the first rptview call invokes the rptview method. The second rptview call invokes the rptview function.

import mlreportgen.report.*
rpt = Report('myReport','pdf');
append(rpt, 'Hello World');
close(rpt);
% Invokes rptview method
rptview(rpt);
% Invokes rptview function  
rptview('myReport.pdf');

Version History

Introduced in R2017b