1) I was adding a list of Checkbox control & a list of Radio controls to a Table and each control in separate row, but the .draw method didn't seem to like that. As soon as I took the list of Checkbox rows (or) radio button rows is out, my code started working.
I then tried to add my Checkbox to an cell group and then added the cell group to the Table cell. That actually seemed to be work, but throwing same error.
2) Occasionally , the Table that I am building will need to spill onto an overflow page. So I'm using the Table.GetOverflowRows() method.
Is there any limit to add number of rows to table element ?
Please help us and we are using licenced latest Dynamics PDF core suite for .net
Getting a "Index was outside the bounds of the array." error when trying to execute the Draw method.
Re: Getting a "Index was outside the bounds of the array." error when trying to execute the Draw method.
Support · Nov 8, 2021Hi,
We tested this on our end and are unable to recreate the error.
Here is a code sample used for testing (it adds checkboxes to a table and handles overflow content).
Document document = new Document();
//Create TableA...................
Table2 tableA = new Table2(0, 0, 200, 600);
// Add columns to the table
tableA.Columns.Add(100);
tableA.Columns.Add(100);
// Add rows to the table and add cells to the rows
for (int i = 1; i < 50; i++)
{
Row2 row2 = tableA.Rows.Add();
CheckBox checkBox = new CheckBox("chk"+i, 0, 0, 15, 15);
checkBox.ExportValue = "chk" + i;
Cell2 cellR2C1 = row2.Cells.Add("Test"+i);
Cell2 cellR2C2 = row2.Cells.Add(checkBox);
}
do
{
Page page = new Page();
document.Pages.Add(page);
page.Elements.Add(tableA);
tableA = tableA.GetOverflowRows();
} while (tableA != null);
// Save the PDF
string pdfFilePath = @"C:\Temp\MyTable.pdf";
document.Draw(pdfFilePath);
If you continue facing an issue, please send over the following information to [^a|mailto:support@dynamicpdf.com|opennewwindow|support@dynamicpdf.com^] so we can look into it further.
1. Simple code sample which uses static data to recreate the error. You can modify the above code sample accordingly to recreate the error and send it over it us.
2. Exact version and build number of the DynamicPDF Core Suite DLL file used in your application. You can find this information by right clicking on the DLL file>>Properties>>Details tab>>Product version. Take a screenshot of Details tab and send it over to us.
3. Full error message along with stack trace.
Please include a link for this forum post in your email to support team.
Thanks,
ceTe Software Support Team