Reports for WinForms
目次を描画する

RenderTocオブジェクトを作成して、RenderToc.AddItemメソッドを実行します。

実行例


サンプルコード(VB)
コードのコピー
' 目次を作成します。
Dim toc As New RenderToc()
toc.AddItem(texts(0).Text, texts(0), 1)
toc.AddItem(texts(1).Text, texts(1), 2)
toc.AddItem(texts(2).Text, texts(2), 2)
toc.BreakAfter = BreakEnum.Page
doc.Body.Children.Insert(0, toc)
サンプルコード(C#)
コードのコピー
// 目次を作成します。
RenderToc toc = new RenderToc();
toc.AddItem(texts[0].Text, texts[0], 1);
toc.AddItem(texts[1].Text, texts[1], 2);
toc.AddItem(texts[2].Text, texts[2], 2);
toc.BreakAfter = BreakEnum.Page;
doc.Body.Children.Insert(0, toc);
関連トピック