How To Fix The Endless Printing Loop Bug In Nevrona Rave
This is what I call the Rave Endless Loop bug. In Rave Reports version 6.5.0 (VCL10) that comes bundled with Delphi 2006, there is a nortorious bug that plagues many Rave report developers. If you have a non-empty dataset, and the data rows for this dataset fit exactly into a page (that is to say there are zero widow rows), then upon PrintPreview, Rave will get stuck in an infinite loop generating pages.
This problem has been previously reported in this newsgroup under the following headings:
- "error: generating infinite pages"; Hugo Hiram 20/9/2006 8:44PM
- "Rave loop bug. Please help"; Tomas Lazar 11/07/2006 7:35PM
- "Loop on full page of data?"; Tony Chistiansen 23/12/2004 3:41PM
- reply to (3) by another complainant; Oliver Piche
- "Endless lopp print bug"; Richso 9/11/2004 4:44PM
In each of these postings, there was no response from Nevrona, and no solution was reported.
Possibly, the problem has also been reported on an allied newsgroup (nevrona.public.rave.reports.general), to wit: 6. "Continuously generating report"; Jobard 20/11/2005 Although it is not clear to me if (6) is the Rave Endless loop bug or another problem. This posting did get a reply from Nevrona, but it was more in relation to multiple regions ("There is a problem when using multiple regions that go over a page-break.") than the problem of zero widows.
This is more of a work-around than a true solution. I first posted this work-around on the Nevrona newsgroup (Group=nevrona.public.rave.developer.delphi.rave; Subject="Are you suffering from the Rave Endless Loop bug?: Work-around announced."; Date=13/11/2006 7:06 PM)
So here is my solution. It is more of a work-around than a good long-term solution, and I hope that Nevrona will give this issue some serious attention in the near future.
- Given your particular report layout, count the maximum number of rows per page. Let us say that this is 40.
- Set up a counter to count the rows within the page (as opposed to rows within the whole report). You could do this either by event script or by a CalcTotal component.
- Define an OnBeforePrint scripted event handler for the main data band.
- In this event handler set the FinishNewPage property of the main data band to be True when the row-per-page count is one or two below the max (in our example, this would be 38). And set it to False in all other cases. The effect of this is to give every page a non-zero number of widows (in this case 1..38), thus avoiding the condition that gives rise to the Rave Endless loop problem.
- → Index out of range (-1) when I click on any item in the TListBox
- → How can I display only specified database results based on TListbox items?
- → SQL How to sum from another table and insert in another table
- → Can a Windows dll retrieve its own filename?
- → TObjectList<T>.IndexOf giving incorrect result
- → Add field to FDMemTable in Delphi
- → What impact (if any) does Delphi 2009's switch to Unicode(/UTF16) have on executable size and memory footprint?
- → How to solve Delphi's [Pascal Fatal Error] F2084 Internal Error: LA33?
- → Do I have to use Disable/EnableControls when using Locate in a TClientDataSet?
- → What is the best way to make a Delphi Application completely full screen?
- → Is it possible to get a delphi project to create a lib file as the output of the project?
- → How to get currently logged in username?
- → How to fix the endless printing loop bug in Nevrona Rave