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

Slow Load of .rtm report on 1st Printing

edited July 2001 in General
Hello Digital Metaphors:

We are using Delphi5/RB 6 enterprise on a Windows 2000 computer.

The first time we run a rtm report stored in a file, we experience a 6
to 10 second delay in generating the report.

From reading other news postings, this appears to be due to the timing
of loading of the printer drivers.

Our users would like us to come up with a solution. I tried Jon's
suggestion of changing a ppReport property in the on-show event without
success.

1) What can I do to trigger the printer driver load so I can control
when this delay occurs ???
Do I need to have a rtm report loaded prior to changing some property ???
Can I run some method ???
Can I create a decendent class of ppReport and surface a method ???

2) Would Digital Metaphors be able to put in a method or property to let
us the developer control when that driver is loaded ???


Please let me know what options we have to resolve this situation. Thank
you.


Neil Huhta


P.S. Our users love our internet reports library - we have set this up to
allow different users to share reports which have been created for other
users. We simply place .rtm reports and ( .scr screens a streamed dmf file)
in a small exe which self installs into our app from the internet.

Comments

  • edited July 2001

    I would try executing some code such as
    myReport.PrinterSetup.PaperNames.Count. Make sure the Delphi optimizer
    does not take the out - You can test this by tracing in the debugger.

    Basically any code that required printer driver specific info should
    work.



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited July 2001
    Nard:

    The solution you proposed does not work in my application. I tried in in
    the on-show event, I placed it in a button on the form where the report is
    printed, I placed your code just before the line ppReport1.Print. Nothing
    works.

    The delay is caused only the first time I call ppReport1.Print in the
    .rtm format. My compiled reports do not slow down either. They may still be
    in the 5.5x format ( or maybe even 3.52 ).

    My app did explode upon upgrade to RB 6.0 I got the "Cant find procedure
    entry point..." errors. I made that go away by deleting all project files
    except the dpr and then recompilation worked great.

    I put in a break point to see if the code was being executed, the step
    by step execustion showed that line executed. Any help would be appreciated.


    Neil Huhta



    Enclosed is my code in the on-show event of the form



    procedure TfmReports.FormShow(Sender: TObject);
    var I:Integer;
    begin
    ReptProc.ReportsOpen;

    MakeInputFields;

    ppReport1.Template.FileName:='C:\Program
    Files\Borland\Work5\PReports\RptStand\BillOut\StdBill.rtm';
    ppReport1.Template.LoadFromFile;
    with ppReport1 do begin

    Reset;
    I:=PrinterSetup.PaperNames.Count;
    I:=I+1;
    ColumnWidth := ColumnWidth + 0.0;
    end;




    Application.OnActivate:=AppActivate;

    // DBGrid1.SetFocus;
    end;
  • edited July 2001

    1. For the next maintenance release, we can add a public
    Printer.Initialize method so you can just code
    Report.Printer.Initialize;

    2. For now try this

    var
    lPoint: TPoint;
    begin
    lPoint := ppReport1.Printer.PixelsPerInch;
    lPoint.X := lPoint.X+1;
    end;





    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited August 2001
    Problem found - How did I miss that. WHen upgrading, I forgot to re-compile
    my own custom component add-ons. THat caused the slow down. Once I
    re-compiled my components to version 6.01 everything was great. As a matter
    of fact, the .rtm format actually prints quicker that my old methoid. Wow.


    Neil Huhta
This discussion has been closed.