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.

Opening a Microsoft® Word document on a Linux® or Macintosh platform calls the soffice command. To use the soffice command on a Linux machine, you must install Apache® OpenOffice® or LibreOffice®. On Macintosh, you must install Apache OpenOffice 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.

  • rptview is not supported in a MATLAB® web app.

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