Dear Sir or Madam,
I have code which produces a report. While producing a report it calculates the number of rows in a table and if it exceeds some precalculated maximum it tries to split it. In order to do it the code adds the table to the document recalculates layout and looks for the first row to be on other page than the last row. The code is following:
LayoutCollector layoutCollector = new LayoutCollector(mOutputDocument);
NodeCollection awRows = contentWrapCell.GetChildNodes(NodeType.Row, true);
string endSplitRowId = null;
string startNewSplitRowId = null;
for (int i = 1; i < awRows.Count; i++)
{
if (layoutCollector.GetEndPageIndex(awRows[i]) != layoutCollector.GetEndPageIndex(awRows[0]))
I have two issues though.
1. Last time while producing a 250+ pages report layoutCollector.GetEndPageIndex threw Out of memory exception (I saved the document before the exception so probably you’ll be able to reproduce it on your side). I have i7 16 Gb laptop so I don’t think the problem is with my hardware.
2. I am aware that LayoutCollector runs slow as it performs a lot of math calculations. So when I have a number of long tables my report generation time could be 20-30 minutes (vs 2-3-4 minutes without splitting tables). I wonder if there is a way to somehow cache the layout collector latest calculation and resume it from the last node added to the document tree.
Regards,
Alex