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

6 visualizzazioni (ultimi 30 giorni)
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) ...

Risposta accettata

Paul Kinnucan
Paul Kinnucan il 12 Mag 2016
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 Commento
Herb Weiner
Herb Weiner il 12 Mag 2016
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.

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by