rptview
Display report or presentation
Syntax
Description
rptview(
displays the report
specified by the input domObj
)mlreportgen.dom.Document
object in an
appropriate viewer.
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.
Note
The mlreportgen.report.Report
class has a method named rptview
. When you call rptview
with
an mlreportgen.report.Report
object as the argument
value, the method is invoked. For all other types of argument values,
the rptview
function is invoked. See Tips.
rptview(
displays the
report specified by reportPath
)reportPath
in an appropriate viewer,
based on the file extension.
rptview(
displays the report specified by reportName
,format
)reportName
in an appropriate
viewer, based on the format specified in format
.
rptview(
displays the
presentation specified by the input pptObj
)mlreportgen.ppt.Presentation
object in Microsoft
PowerPoint®.
To open a presentation 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.
Examples
Input Arguments
Limitations
rptview
does not support viewing PowerPoint (.ppt) or Word (.docx) reports in MATLAB Online.rptview
is not supported in a MATLAB web app.
Tips
Note
If a mlreportgen.dom.Document
object's OpenStatus
property is "open"
and you call rptview
to view the
report, OpenStatus
will be set to "closed"
.
Displaying a report requires executing the DOM API"s close
command, which
converts the report"s in-memory DOM representation to a file of the type specified by the
Type property.
rptview
issues the required close command for you if
Document.OpenStatus
is not ready set to "closed"
.
Calling rptview
with an mlreportgen.report.Report
object as the argument value, invokes the rptview
method of the mlreportgen.report.Report
object. The rptview
method calls
the rptview
function with the value of the
Document
property of the report object as the argument
value.
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'); add(rpt, 'Hello World'); close(rpt); % Invokes rptview method rptview(rpt); % Invokes rptview function rptview('myReport.pdf');
Version History
Introduced in R2014b