Thursday, March 24, 2011

How to fix the endless printing loop bug in Nevrona Rave

Nevrona Designs' Rave Reports is a Report Engine for use by Embarcadero's Delphi IDE.

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:

  1. "error: generating infinite pages"; Hugo Hiram 20/9/2006 8:44PM
  2. "Rave loop bug. Please help"; Tomas Lazar 11/07/2006 7:35PM
  3. "Loop on full page of data?"; Tony Chistiansen 23/12/2004 3:41PM
  4. reply to (3) by another complainant; Oliver Piche
  5. "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.

From stackoverflow
  • 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.

    1. Given your particular report layout, count the maximum number of rows per page. Let us say that this is 40.
    2. 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.
    3. Define an OnBeforePrint scripted event handler for the main data band.
    4. 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.
    mm2010 : Looks like I must stick to Quick Reports.
  • Thanks so much for this Sean - unfortunately this wouldn't work for me but I came up with another solution... You see I have a memo at the top of the region that might expand or contract depending on how many notes the user has left in the database. This means that the number of rows that can fit on a page varies. However. there is another solution - you use the MaxHeightLeft property of a databand. All you do is measure the height of your databand, multiply it by 2, and put this in your MaxHeightLeft property. This will force 1 or 2 records onto the next page if it fills up that much.

  • thank's a lot, this thread helps me out from my problem with endless printing loop in Nevrona Rave...., I set MinHeightLeft to 0,500, this setting is work but i'm not sure that it will work for anothers result set of my query report.

  • Master, The solution is MinHeightLeft to 0,500 , i use property wastefit area in true and generated the loop in the second print, but when changed the property MinHeightLeft to 0,500 the error disapear.

    Thanks !

    Atte Fabiola Herrera. Fabi_ucv@hotmail.com

0 comments:

Post a Comment