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

AV caused by custom button

edited April 2007 in General
On previewer we've added a TSpeedButton to StandardToolbar in the
CreateToolbarControls procedure that launches a TppDesigner. Exiting that
Designer (returning focus to the previously launched Preview) causes an AV
with "Read of address $0000018a". The AV is coming from
TppDataPipeline.DoOnTraversal.



We're using ReportBuilder 9.02 with Delphi 6.

Comments

  • edited April 2007
    Hi Martin,

    This is not a known issue.

    1. Try upgrading your version of ReportBuilder to RB 9.03 and see if the
    problem is solved. Contact info@digital-metaphors.com for upgrade
    instructions with your serial number.

    2. If the above does not help, consider upgrading to the latest version of
    ReportBuilder, RB 10.06. This version contains new, more advanced toolbar
    technology that has an updated look and feel.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited April 2007
    Upgraded to 9.03. AV has gone, but it's still failing. Now the original
    Preview gets locked into a never ending calc cycle at the point I used to
    get the AV, sometimes even preventing the closing of the Preview.



    Here's the relevant code snippet. Any clues as to what's going wrong?



    {------------------------------------------------------------------------------}

    procedure TMyRBPreviewPlugin.CreateToolbarControls;

    begin



    inherited CreateToolbarControls;



    if Parent.Name <> 'tshPreview' then

    {create Design button}

    With TSpeedButton.Create( StandardToolbar ) do

    begin



    Parent := StandardToolbar;

    Flat := False;

    NumGlyphs := 2;

    Left := PrintButton.Left + 5 + PrintButton.Width;

    Top := 2;

    Caption := 'Design';

    Visible := True;

    Width := 50;

    OnClick := btnDesignClick;



    end;

    end;



    {------------------------------------------------------------------------------}

    procedure TMyRBPreviewPlugin.btnDesignClick(Sender: TObject);

    var

    MyDesigner: TppDesigner;

    begin



    MyDesigner := TppDesigner.Create( nil );

    try

    MyDesigner.OnCreateComponent := ppDesignerCreateComponent;

    MyDesigner.Report := Viewer.Report as TppReport;

    InitialiseDesigner( MyDesigner); // Sets data settings, helpfile,
    ShowComponents ect

    MyDesigner.ShowModal;

    finally

    MyDesigner.Free;

    end;



    end;
  • edited April 2007
    Where does the AV occur in your code? In my quick testing with code similar
    to your code below, I was able to successfully create a designer from a
    button click inside the preview window. One thing you might try is setting
    the owner of the TppDesigner to the form. This can cause destroy issues if
    the owner is nil.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.