Dot indexing error when adding chapter to report, no further help given

5 views (last 30 days)
Hi all,
I am using the Report Generator toolbox and trying to add a chapter to the report object, but I get an error that I have no idea how to fix.
Here is a simplified version my code:
rpt = mlreportgen.report.Report(reportPath,formatStr);
ch = Chapter;
ch.Title = 'txt';
sec1 = Section('txt');
txt1 = 'txt';
add(sec1,txt1);
figures = thisFunctionMakesPlots(plotRelatedInputs);
figCaptions = {'cap','tion'};
for idxFig = 1:numel(figures)
fig = Figure(figures(idxFig));
fig.Snapshot.Caption = figCaptions{idxFig};
fig.Snapshot.Height = '5in';
add(sec1,fig);
end
add(ch,sec1);
sec2 = Section('txt');
txt2 = 'txt';
add(sec2,txt2);
[figures, figCaptions] = anotherFunctionThatMakesPlots(plotRelatedInputs);
for idxFig = 1:numel(figures)
fig = Figure(figures(idxFig));
fig.Snapshot.Caption = ['Text appended to ' figCaptions{idxFig}];
fig.Snapshot.Height = '5in';
add(sec2,fig);
end
add(ch,sec2);
add(rpt,ch);
The error message below is given after trying to run the last line.
Dot indexing is not supported for variables of this type.
Error in mlreportgen.report.Figure/createSnapshotFigure
Error in mlreportgen.report.Figure/getSnapshotImageImpl
Error in mlreportgen.report.Figure/getContent
Error in mlreportgen.report.ReportForm/fillHole
Error in mlreportgen.report.ReporterBase/processHole
Error in mlreportgen.report.ReportForm/fillForm
Error in mlreportgen.report.ReporterBase/getDocumentPart
Error in mlreportgen.report.ReporterBase/getImpl
Error in mlreportgen.report.internal.LockedForm.add
Error in mlreportgen.report.internal.LockedForm.add
Error in mlreportgen.report.ReportForm/fillHole
Error in mlreportgen.report.Section/processHole
Error in mlreportgen.report.ReportForm/fillForm
Error in mlreportgen.report.ReporterBase/getDocumentPart
Error in mlreportgen.report.ReporterBase/getImpl
Error in mlreportgen.report.Section/getImpl
Error in mlreportgen.report.internal.LockedForm.add
Error in mlreportgen.report.internal.LockedForm.add
Error in mlreportgen.report.ReportForm/fillHole
Error in mlreportgen.report.Section/processHole
Error in mlreportgen.report.Chapter/processHole
Error in mlreportgen.report.ReportForm/fillForm
Error in mlreportgen.report.ReporterBase/getDocumentPart
Error in mlreportgen.report.ReporterBase/getImpl
Error in mlreportgen.report.Section/getImpl
Error in mlreportgen.report.internal.LockedForm.add
Error in mlreportgen.report.ReportBase/add
It is quite useless, as I am not able to click into any of the levels to try and understand the problem better, so I have no idea how to fix this. Please help! Thanks in advance.
  3 Comments
K W
K W on 17 Jun 2019
Great tip with the 'if caught error' line!
It stopped with the following message:
Caught-error breakpoint was hit in graphics\private\setGraphicsProperty at line 0. The error was:
Error using matlab.graphics.axis.Axes/set
There is no XColorMode_I property on the Axes class.
It did not break into the debugger at any lower level with the green debug arrow, it still only shows the white debug arrow at
add(rpt,ch);
.
What does this Axes error mean, and how could I fix it?
Guillaume
Guillaume on 17 Jun 2019
The root cause of the error is that some function tries to access the XColorMode_I property of an axis, but there is no such property. The question is whether it's a matlab function or one of yours that's responsible.
What is the call stack when the error is caught? Use dbstack to find out.
Note that there are plenty of ****_I hidden axis properties such as XColor_I for internal use by matlab but indeed, at least on R2019a, there is no XcolorMode_I.

Sign in to comment.

Answers (0)

Categories

Find more on Function Creation in Help Center and File Exchange

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!