Discussion:
Hiding complete page
(too old to reply)
Anders Balslev
2007-05-19 11:14:18 UTC
Permalink
I'm using BDS2006 and RaveReport 6.5.0 (BE)

Can anyone give a small hint regarding hiding af page?

I have a report - Report1
In this report I have defined 3 pages, each of them contains a text "Page x
of y"

When I execute this it works fine.

But dependant of the application, I want to disable / enable page 2

I have tried to execute following code on the OnBefore page event:
if (....) then
Self.visible :=False;

and
if (....) then
Self.Hide;

and in my Delphi code, I execute following:

var
MyPage : TRavePage
Begin
Project1.Open
MyPage :=Project1.ProjMan.FindRaveComponent('MyReport.Page2',nil)
if (...) then
MyPage.Hide
Project1.execute;
Project1.Close
end;

All the result is:
I still get 3 pages, but page 2 is blank !! (instead of not to be printed)

What I want is:
If Page 2 is to be printed, all pages must have page x of y
If page 2 is *not* to be printed, all the printed pages (and no blank pages)
should have page x of y (and the total pages y should of course not include
the page that is not to be printed

Any hint?

Best regards

Anders
Trevor Keegan
2007-05-20 13:11:15 UTC
Permalink
Hello Anders,

You best bet here is to split the report into 3 different reports and then
call them as needed using the the tips described in
http://www.nevrona.com/Default.aspx?tabid=119.

Regards
Trevor Keegan
Mark McPartland
2007-06-06 14:15:09 UTC
Permalink
Anders,

you can do this using event code and parameters follows.
On Page1.BeforePRint use:

if raveproject.getparam('SkipPage2') = 'True' then
Self.gotopage := Page3;
end if;


In your delphi set the parameter as required
If ... then Rvproject.SetParam('SkipPage2','True') else
Rvproject.SetParam('SkipPage2','False');

You may also be able to change the GotoPage property of page 1 directly from
delphi, but I just decided to use a paramater in Rave.

cheers

Mark
Post by Anders Balslev
I'm using BDS2006 and RaveReport 6.5.0 (BE)
Can anyone give a small hint regarding hiding af page?
I have a report - Report1
In this report I have defined 3 pages, each of them contains a text "Page
x of y"
When I execute this it works fine.
But dependant of the application, I want to disable / enable page 2
if (....) then
Self.visible :=False;
and
if (....) then
Self.Hide;
var
MyPage : TRavePage
Begin
Project1.Open
MyPage :=Project1.ProjMan.FindRaveComponent('MyReport.Page2',nil)
if (...) then
MyPage.Hide
Project1.execute;
Project1.Close
end;
I still get 3 pages, but page 2 is blank !! (instead of not to be printed)
If Page 2 is to be printed, all pages must have page x of y
If page 2 is *not* to be printed, all the printed pages (and no blank
pages) should have page x of y (and the total pages y should of course not
include the page that is not to be printed
Any hint?
Best regards
Anders
Loading...