How to speed up slow rap code.
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
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
This discussion has been closed.
Comments
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
http://www.digital-metaphors.com
info@digital-metaphors.com
speed versus 6.x? Also the templates concept is one I will research,
but I understand the local variables versus the database variable.
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
http://www.digital-metaphors.com
info@digital-metaphors.com