1

Closed

Index was out of range. Must be non-negative and less than the size of the collection.

description

Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

in "public void Print()"
..........
            if (_pageTrees.Count > 0)
            {
                CurrentPageNumber++;
                e.PageVisual = _pageTrees[pageIndex]; <--- (Index was out of range. ...)
            }
..........

It happens consistently when I try to print second time. Is there reset or dispose method in the Report class?
Closed Jan 9, 2012 at 3:45 AM by Psychlist1972
Fixed in Release 1.0.0-alpha.3

comments

jacrol wrote Dec 31, 2011 at 7:25 AM

Hello,

I have been through the same issue and I found out there is a bug in code.

Here is the solution:

The PrintDocument Silverlight Class must be instanciated EACH time you call the Print() method on the Report object...
So in the Report Class code,
Replace
private PrintDocument _printDocument = new PrintDocument();
by
private PrintDocument _printDocument ;

Then in the Report Print() method (first line)
Add
_printDocument = new PrintDocument();

Hope this helps

Psychlist1972 wrote Jan 5, 2012 at 9:24 PM

Thanks for the heads up on this. This will be fixed in the version I release soon.