Problem with DBGrid1 selection and frxReport1.Print.
Hello.
I'm a bit confused...
I have a typical procedure where:
Everything is fine untill I have more than one selection (for example 2-3 rows or whole grid).
In debug mode this loop runs once ok (SelectedRows.Count value is for example 3) and after going for another run it sets the Count value to 0 each time thus giving me Access Violation error.
It only happens on frxReport1.Print (same thing with frxReport1.Export(frxPDFExport1)).
If I remove anything related to printing or exporting loop runs fine till the end.
Funny thing is that I have old application in Delphi 2006 which runs fine and now this happened in Delphi 2010. Both are using FR 4.0.
Help
I'm a bit confused...
I have a typical procedure where:
for nJ := 0 to DBGrid1.SelectedRows.Count-1 Do Begin
      DBGrid1.DataSource.DataSet.GotoBookmark(pointer(DBGrid1.SelectedRows.Items[nJ]));
*Do some stuff to get data for a report*
      frxReport1.LoadFromFile('report.fr3');
      frxReport1.PrepareReport();
      frxReport1.PrintOptions.Printer := ComboBox1.Text;
      frxReport1.Print;
end;
Everything is fine untill I have more than one selection (for example 2-3 rows or whole grid).
In debug mode this loop runs once ok (SelectedRows.Count value is for example 3) and after going for another run it sets the Count value to 0 each time thus giving me Access Violation error.
It only happens on frxReport1.Print (same thing with frxReport1.Export(frxPDFExport1)).
If I remove anything related to printing or exporting loop runs fine till the end.
Funny thing is that I have old application in Delphi 2006 which runs fine and now this happened in Delphi 2010. Both are using FR 4.0.
Help
Comments
Never had such problem with fastreports before as I'm using same procedures:(
When I //frxReport1.Print; from the loop/code everything works smooth.