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

Access Violation and Hangs in Report Builder 7.0

edited October 2002 in General
I just upgraded to RB 7.0 (using Delphi 6.0)
and now i get sometimes an Access Violation when opening a preview form and
printing from them
the Access Violation is in the ShowModal code of delphi (where Sending a
message)

when printing to Acrobat Writer, Report builder hangs (no reaction)

The preview in both works fine.
But the printing is very bad in the new Report Builder 7.0 (and i dont know
why)

In the demo all works fine.
If i can't get it work, i go back to Report Builder 6 !

Hope someone can help me to find the bug !

Comments

  • edited October 2002
    We have not experienced this behavior. Could you send us an example that
    shows this problem? Please send a simple demo to
    support@digital-metaphors.ocm and we'll be happy to take a look at it.


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited October 2002
    The problem is that the application is really big.

    The call for showing the preview is :

    frReportBuilder.ppReport1.DeviceType := 'Screen';
    frReportBuilder.ppReport1.Print;

    and some where inside the Print i get the error !
    (ppReport1 is a standard TppReport)



  • edited October 2002
    Can you create an example for us to run? We are unable to reproduce the
    problem here. We need to be able to reproduce the problem in order to fix
    it, so we are asking you to send an example.

    If you pull this form and report out of the application and supply it data
    from an arbitrary JITPipeline, in which you feed it a few contrived records,
    do you still get the behavior? If so, could you send this to us?

    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited October 2002
    I don't think i can extract the Report Builder part of my application !

    Why did it work with the older RB6 fine and now with the RB7 i get all those
    exceptions ?

    Can you give me some hints where to search for the bug ?

    I open the Preview window -> OK
    I click the Print Button -> OK
    I select the Acrobat PDF Writer -> OK
    I select the File -> OK
    Acrobat opens with the just generated File -> OK
    -> the window hangs (The Modal Preview window is disabled and i can't press
    anything ...)
    -> or Access Violation
    procedure TCustomForm.CloseModal;
    var
    CloseAction: TCloseAction;
    begin
    try
    CloseAction := caNone;
    if CloseQuery then <= here the AV occours
    begin
    CloseAction := caHide;
    DoClose(CloseAction);
    end;
    case CloseAction of
    caNone: ModalResult := 0;
    caFree: Release;
    end;
    except
    ModalResult := 0;
    Application.HandleException(Self);
    end;
    end;

  • edited October 2002
    I just tried to set ModalCancelDialog to FALSE, and now i don't get any AV
    anymore
    I will try it some more imes, but i think the error has to do with this
    formular !


  • edited October 2002
    But Report Builder hangs some times.

    If i click first time to print all works fine.
    If i click a second time to click, Report Builder hangs !
    Have i to reset some data between these two calls ?


  • edited October 2002
    What is happening in your report's event handlers?

    If you are changing the dataset at all, try calling Report.Reset before the
    report begins generating.


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited October 2002
    No, it doesn't help !

    I have changed following in daIBExpress :

    var
    uIBDatabase: TIBDatabase; <= putting the vars in
    public section, for changing it inside my own units !
    uIBTransaction: TIBTransaction;

    implementation

    const
    // cDefaultDatabase = 'DefaultIBXDatabase';
    cDefaultDatabase = 'dbFassl'; <= Changeing this

    ...
    function TdaIBXSession.GetDefaultDatabase(const aDatabaseName: String):
    TComponent;
    var
    lIBDatabase: TIBDatabase;
    begin

    lIBDatabase := GetDefaultIBXDatabase;

    {set DatabaseName property, if needed}
    if (lIBDatabase.DatabaseName <> aDatabaseName) then
    begin

    <= don't use this, because i set the Database and Transaction manually
    if lIBDatabase.Connected then
    lIBDatabase.Connected := False;

    lIBDatabase.DatabaseName := aDatabaseName;
    }
    end;

    Result := lIBDatabase;

    end; {function, GetDefaultDatabase}



    in my own Form create :

    uIBDatabase := MC_FC.DB;
    tblItem.DataBase := MC_FC.DB;
    tblFolder.DataBase := MC_FC.DB;

    ppReport1.Template.DataBaseSettings.Name := Settings;
    ppReport1.Template.Load;
    ppReport1.DeviceType := 'Screen';

    ppViewer.Reset;
    ppRerport1.Reset;
    ppViewer.Report := ppReport1;
    ppReport1.PrintToDevices;
    inherited;


    OnPrintClick
    ppViewer.Reset;
    ppReport1.Reset;
    ppReport1.ModalCancelDialog := FALSE;
    ppViewer.Print;


    First Click on print works without problem, second print hangs !


  • edited October 2002
    Hi
    I just found out the detailed position, where Report Builder hangs :

    in unit ppPrnDev (Line 987)

    procedure TppPrinterDevice.DrawText(aDrawText: TppDrawText);
    {calc line height}
    GetTextMetrics(FCanvas.Handle, lTextMetric);

    I am getting very frustrating with this ....

  • edited October 2002
    One additional thing :
    The hang (printing a second time) only occours when printing to Acrobat
    Writer !

  • edited October 2002
    Can you send an example that shows the problem to
    support@digital-metaphors.com


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited October 2002
    The problem is, that the appliction is to big, and extracting parts of it
    want work at all.

    The demos of RB works without problems.

    And the only things i can say is that with RB6.03 all works fine, and we
    have about 20 different Reports, and all make the same problems.



  • edited October 2002
    If you create the simplest possible report and put it in your application,
    then does the problem persist? Do you think it could be related to your
    event handler code of the reports? Are calculations being reset when you run
    a report for the second time? There has to be something somewhere in your
    code that is causing this. We just need to isolate what and where this piece
    of code is. Are you using the latest printer driver?

    I understand your time is valuabe; and creating a demo for us might be worth
    it to you if you can deliver your product using RB 6.03. Our tests and QA
    do not show this error. We can continue researching the issue. If you come
    across any isolations/solutions let us know what you find.


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.