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

BeforePrint script not working correctly.

edited June 2003 in General
Hello,

I'm having some trouble with the beforeprint script. It does not seem to be
executing. I did some research and found the tech tip below that seems to
be relevant to what I am doing but I still can't figure it out.

-------------------------------------------------
Tech Tip: How to use the OnLoadEnd public event
-------------------------------------------------

I am running ReportBuilder Server through a webtier and am storing my
reports in rtm files. In many of my reports I want to make a
groupfooterband both visible and invisible depending on the data record. I
created a ppGroupFooterBand2BeforePrint script to check the data. The
report works great until I move it into an explorer environment and load the
rtm files from a trsReportTemplateVolume component. I've tried numerous
ways to get the Tech Tip above to work and have not succeeded. I'm sure
it's something I'm overlooking.

Thanks in advance,

Bill Gifford

Comments

  • edited June 2003
    Bill,

    Can you reproduce this error using our ReportBuilder Server demos? Be sure
    that you are connecting your event handlers correctly when loading templates
    if you have any external event handlers. Use the OnLoadEnd event. Please
    send a small example demonstrating the problem to
    support@digital-metaphors.com for us to research.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2003
    I don't believe there is an error with Reportbuilder.
    I don't think I'm doing things correctly. In your response you
    mention to connect my event hanlders correctly when loading
    templates by using the OnLoadEnd event. I don't understand
    how to do this.

    I added the following code to my system

    private
    procedure LoadEndEvent(Sender: Tobject);

    procedure TdmAllReports.DataModuleCreate(Sender: TObject);
    begin
    ppReport1.Template.OnLoadEnd := LoadEndEvent;
    end;

    procedure TdmAllReports.LoadEndEvent(Sender: TObject);
    begin
    // I would imagine that this is where I connect my event handlers
    // but I have no idea of how to do it.
    ppReport1.GroupFooterBand[0].????
    end;

    // the following code is run during each pass over the groupfooterband
    // I am attempting to set the groupfooterband to invisible
    // or the region to invisible. Setting the property doesn't work though
    // since I haven't set the event handlers correctly.
    procedure TdmAllReports.visibleyesnoCalc(Sender: TObject;
    var Value: Variant);
    begin
    if somevalue = true then begin
    ppReport1.GroupFooterBand[0].Visible := false;
    ppReport1.Region1.Visible := false;
    end
    else begin
    // force both if and else to false until we make sure the hide is
    working
    ppReport1.GroupFooterBand[0].Visible := false;
    ppReport1.Region1.Visible := 'false';
    end;
    end;


    Thanks for your help.

    Bill Gifford

  • edited June 2003
    I think I figured it out. Thank you for the help. Your response
    gave me enough clues to figure it out.


This discussion has been closed.