User`s guide

mlreportgen.dom.Document.fill
11-29
end
methods
function rpt = MyReport(filename,type,template)
rpt = rpt@mlreportgen.dom.Document(filename,type,template);
end
function fillCustomerName(rpt)
append(rpt,rpt.CustomerName);
end
end
end
Use the report.
rpt = MyReport('mydoc','docx','CustomerLetter');
rpt.CustomerName = 'Mr. Smith';
fill(rpt);
“Add Content to a Report”
More About
Tips
In the derived class, define fill methods to insert content for each hole in the template.
Use this signature:
fillHOLE_ID(docObj);
HOLE_ID is the ID of a hole defined by the template that the document uses, and docObj
is an instance of the derived class. When invoked on a derived Document object, the fill
method moves from the first hole in the document to the last, invoking the corresponding
fillHOLE_ID method at each hole. This approach eliminates the need for additional
code to loop through the holes in a template.
See Also
mlreportgen.dom.Document | mlreportgen.dom.Document.moveToNextHole