rptview
显示报告或演示文稿
语法
说明
rptview( 在适当的查看器中显示输入 domObj)mlreportgen.dom.Document 对象指定的报告。
在 Linux® 或 Macintosh 平台上打开 Microsoft® Word 文档会调用 soffice 命令。要在 Linux 计算机上使用 soffice 命令,必须安装 Apache® OpenOffice® 或 LibreOffice®。在 Macintosh 上,您必须在 /Applications 文件夹中安装 Apache OpenOffice。
注意
mlreportgen.report.Report 类有一个名为 rptview 的方法。当您使用 mlreportgen.report.Report 对象作为参量值调用 rptview 时,该方法被调用。对于所有其他类型的参量值,将调用 rptview 函数。请参阅提示。
rptview( 根据文件扩展名在适当的查看器中显示 reportPath)reportPath 指定的报告。
rptview( 根据 reportName,format)reportName 中指定的格式,在适当的查看器中显示 format 指定的报告。
rptview( 在 Microsoft PowerPoint® 中显示输入 pptObj)mlreportgen.ppt.Presentation 对象指定的呈现方式。
要在 Linux 或 Macintosh 平台上打开演示文稿,rptview 会调用 soffice 命令。在 Linux 上,必须安装 Apache OpenOffice 或 LibreOffice。在 Macintosh 上,Apache OpenOffice 必须安装在 /Applications 文件夹中。
示例
输入参数
限制
rptview不支持在 MATLAB Online 中查看 PowerPoint (.ppt) 或 Word (.docx) 报告。MATLAB Web App 不支持
rptview。
提示
注意
如果 mlreportgen.dom.Document 对象的 OpenStatus 属性是 "open" 并且您调用 rptview 来查看报告,则 OpenStatus 将被设置为 "closed"。显示报告需要执行 DOM API 的 close 命令,该命令将报告的内存 DOM 表示转换为 Type 属性指定类型的文件。如果 Document.OpenStatus 尚未准备好设置为 "closed" ,则 rptview 会为您发出所需的关闭命令。
使用 mlreportgen.report.Report 对象作为参量值调用 rptview,将调用 mlreportgen.report.Report 对象的 rptview 方法。rptview 方法使用报告对象的 Document 属性值作为参量值来调用 rptview 函数。
使用 mlreportgen.report.Report 对象以外的参量值调用 rptview 会调用 rptview 函数。
例如,在下面的代码中,第一个 rptview 调用调用 rptview 方法。第二个 rptview 调用调用 rptview 函数。
import mlreportgen.report.* rpt = Report("myReport","pdf"); add(rpt, "Hello World"); close(rpt); % Invokes rptview method rptview(rpt); % Invokes rptview function rptview("myReport.pdf");
版本历史记录
在 R2014b 中推出