We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

TOC with IWTable

Hi,
 
I am testing to generate a doc with TOC(table of content). It is all good with some headings and paragraghs. But when I added table (IWTABLE) to the section, the call of UpdateTableOfContents throwed "index out of range" exception. Please help.
 
Thanks,
Kan

1 Reply

RM Ramkumar M Syncfusion Team July 17, 2012 04:55 AM UTC

Hi Kan,

Thank you for your interest in Syncfusion products.

The mentioned exception happens only if the inserted table (IWTable) doesn’t have any rows and columns .As a workaround you have to initialize rows and columns by ResetCells(int rows,int columns) function of IWTable.

Code snippets:

//Inserting table of contents       

IWTable table = section.AddTable();

//set rows and columns

table.ResetCells(2, 2);

 For your reference we have prepared a sample to illustrate this workaround. Please find the sample from attachment and let us know if it helps you.

Please let us know if you have any other questions

Regards

Ramkumar.


Sample_16e171a.zip

Loader.
Live Chat Icon For mobile
Up arrow icon