How can I use MATLAB Report Generator to produce PDF Report rather than HTML Report?

6 次查看(过去 30 天)
I am running MATLAB R2016a on a Mac (OS X El Capitan). I am just getting started with MATLAB Report Generator. I have completed the tutorial in chapter 2 (Magic Squares) of the MATLAB® Report Generator™ User's Guide, and successfully generated the HTML report. (I am attaching a zip file that contains the magic_squares.rpt file.)
I then went back and changed the File Format of the report from Web (HTML) to Acrobat (PDF), then clicked the Report tool to generate the same report in PDF format (without making any other changes).
This time, the report failed with the messages below. Is there some reason I can generate an HTML report but not a PDF report? How can I fix this?
Converting report
FATAL: "fo:block" is not a valid child of "fo:root"! (See position -1:-1) org.apache.fop.fo.ValidationException: "fo:block" is not a valid child of "fo:root"! (See position -1:-1) Document conversion failed. Java exception occurred: ; SystemID: file:/Applications/MATLAB_R2016a.app/sys/namespace/docbook/v4/xsl/fo/mcode.xsl; Line#: 41; Column#: -1 javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: "fo:block" is not a valid child of "fo:root"! (See position -1:-1) ...

采纳的回答

Paul Kinnucan
Paul Kinnucan 2016-5-12
The problem is with the Eval component at the beginning of the report. You have configured the Eval component to insert the expression to be evaluated and its output before the title page of the report:
This is invalid as the warning sign on the component dialog box indicates. HTML is forgiving of this error but PDF is not. The solution is to uncheck the check boxes that trigger this behavior:
  1 个评论
Herb Weiner
Herb Weiner 2016-5-12
Paul, thank you for the answer. The tutorial in the MATLAB® Report Generator™ User's Guide (page 88) was unclear on this detail; it stated: "To exclude the MATLAB code details and its output in this report, clear the Insert MATLAB expression in report and Display command window output in report check boxes." I interpreted this as an option rather than a required step.

请先登录,再进行评论。

更多回答(0 个)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by