list index out of bounds (-1 )

HoaHoa
edited December 2010 in FastReport 4.0
I had the code snip below which was working well in 3.x and 4.09. However after I upgrade to 4.10, it stop working, and cause a crash with error message of [ List Index out of bound (-1) ].


TfrxReportPage *frxPage = new TfrxReportPage ( frxReportX );


if ( frxPage ) {
frxReport2->PrepareReport( true );
frxPreview2->LoadFromFile( filename1 );

frxReportX->PrepareReport( true );
ok = frxReportX->PreviewPages->LoadFromFile( filename2 );

frxReportX->PreviewPages->AddFrom( frxReport2 );
/**************************
CRASH AND DISPLAY
List index out of bounds(-1)
*************************/

frxReportX->PrepareReport( false );
//frxPreview3->Show();
int npgcount = frxReportX->PreviewPages->Count;
frxReportX->PreviewPages->SaveToFile ("c:\\temp\\combined.fp3");
frxPreview2->LoadFromFile( "c:\\temp\\combined.fp3" );
}
delete frxReportX;
}
frxPreview2->Show();

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.