Clear Filters
Clear Filters

Undefined function or variable 'TOC' in DOM API

1 view (last 30 days)
Amruta
Amruta on 2 Sep 2016
Edited: Adam on 2 Sep 2016
when i run following code.. i got error "Undefined function or variable 'TOC'
import mlreportgen.dom.*;
d = Document('mydoc','docx');
open(d);
title = append(d, Paragraph('My TOC Document'));
title.Bold = true;
title.FontSize = '28pt';
toc = append(d,TOC(2,' '));
toc.Style = {PageBreakBefore(true)};
h1 = append(d,Heading1('Chapter 1'));
h1.Style = {PageBreakBefore(true)};
p1 = append(d,Paragraph('Hello World'));
h2 = append(d,Heading2('Section 1.1'));
h2.Style = {PageBreakBefore(true)};
p2 = append(d,Paragraph('Another page'));
h3 = append(d,Heading3('My Subsection 1.1.a'));
p3 = append(d, Paragraph('My Level 3 Heading Text'));
close(d);
rptview(d.OutputPath);
what should i do to use TOC class in DOM API?**

Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!