BeforePrint script not working correctly.
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
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
This discussion has been closed.
Comments
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.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
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
gave me enough clues to figure it out.