Home RAP
New Blog Posts: Merging Reports - Part 1 and Part 2

How to speed up slow rap code.

edited August 2003 in RAP
Using ReportBuilder Enterprise 6.02

My report is running very slow compared to the underlying sql. There
are about 100 calculated fields on the report. They are basically
totals for a date range for about 75 different hospitals. There is a
summary page at the end. An example of one of the calc fields (onCalc)
is found below. I was looking for a RAP tuning solution. It basically
pegs (100%) the computer it is running on when the date range returns
about 100 records to the query. Thank you


if (((Hearingb['Screening Type'] = 'I') and (Hearingb['Test Given'] =
'Y')) or
((Hearingb['Screening Type'] = 'M') and (Hearingb['Test Given'] =
'Y')) or
((Hearingb['Screening Type'] = 'N') and (Hearingb['Test Given'] =
'Y'))) or

(((Hearingb['Screening Type P'] = 'I') and (Hearingb['Test Given
P'] = 'Y')) or
((Hearingb['Screening Type P'] = 'M') and (Hearingb['Test Given
P'] = 'Y')) or
((Hearingb['Screening Type P'] = 'N') and (Hearingb['Test Given
P'] = 'Y'))) or

(((Hearingb['Screening Type Q'] = 'I') and (Hearingb['Test Given
Q'] = 'Y')) or
((Hearingb['Screening Type Q'] = 'M') and (Hearingb['Test Given
Q'] = 'Y')) or
((Hearingb['Screening Type Q'] = 'N') and (Hearingb['Test Given
Q'] = 'Y'))) then

Value := Value + 1;


Louis Beck
QS Technologies Inc

Comments

  • edited August 2003
    One thing that you can change is to use local variables in the routine in
    order to not make calls on the pipeline to get the current value and perform
    a variant conversion everytime. Would it be possible to perform more
    preprocessing of the data on the database side, ie. calc fields on the SQL
    so that you don't have to do as many calculations in RAP. There isn't much
    to tune in RAP, it runs as fast as it can go. One other thing that happens
    which may slow things down a little is that the report is saved to template
    before you begin printing so that your RAP event handlers don't change the
    layout when you are working in the report designer and return to the design
    tab after previewing

    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited August 2003
    Thank you. My followup question would be whether 7.x would increase the
    speed versus 6.x? Also the templates concept is one I will research,
    but I understand the local variables versus the database variable.

  • edited August 2003
    Also make sure that the Report.PassSetting is set to psOnePass.

    RB 7 wouldn't necessarily be faster if you are performing intensive
    calculations. A test would be to install RB 7.02 trial edition an see what
    the speed difference is.

    One other thing you could try doing is to initialize the printer driver when
    the application is loading. Call ppReport1.Printer.Initialize. That may be
    slowing the report down when it first has to generate as it uses the chosen
    printer of the Report.PrinterSetup to determine the pagination.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.