Shift up over unused components
Hi,
This is my first post here so please be gentle.
I have a report where I want to have the format like so:
label1 dbMemo1
label2 dbMemo2
label3 dbMemo3
if dbMemo1 is empty at run-time I want to make label1 and dbMemo1invisible
and then shift the other components 'up one' to the positions label1 and
dbMemo1 occupy.
Is there an easy way to do this (ideally using RAP) or do have to
individually set each component's co-ordinates and dimensions? I'm using
RBuilder Enterpise 7.04 if that makes a difference to any answer.
Regards,
John Nolan
This is my first post here so please be gentle.
I have a report where I want to have the format like so:
label1 dbMemo1
label2 dbMemo2
label3 dbMemo3
if dbMemo1 is empty at run-time I want to make label1 and dbMemo1invisible
and then shift the other components 'up one' to the positions label1 and
dbMemo1 occupy.
Is there an easy way to do this (ideally using RAP) or do have to
individually set each component's co-ordinates and dimensions? I'm using
RBuilder Enterpise 7.04 if that makes a difference to any answer.
Regards,
John Nolan
This discussion has been closed.
Comments
At Design-time...
Try placing each Label/Memo pair inside a separate TppRegion component.
Then set each TppRegion to stretch and the bottom two regions to
ShiftRelativeTo the region directly above. Note that you can remove the
border of a region by setting its Pen.Style to psClear.
In RAP (Runtime)...
Inside the DetailBand.BeforePrint event, check the value of each memo
object. If one is empty, set the corresponding region's Visibility to
False. This should give you the effect you are after.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Ideally I only want to use RAP for this so I am setting the Pen.Stye at Run
time. As there will be more than 3 regions I want to (in RAP) set all the
regions to psClear and yet the code that I would use in Delphi does not work
in RAP.
procedure DetailBeforePrint
var i : integer;
begin
for i := 0 to Detail.objectcount do
begin
if (Detail.objects[i] is TppRegion) then {ERROR: doesn't like is
TppRegion}
TppRegion(Detail.objects [i]).pen.style := psClear;
end;
end;
Is there any alternative to this?
Thanks ,
John Nolan
Unfortunately sets are not supported in RAP. This is something that will
need to be done at design-time or at run-time using a RAP passthru function.
For a detailed example of creating a RAP passthru function, see the
ReportBuilder Developer's Guide located in the \RBuilder\Developer's
Guide\... directory.
Thanks for the feedback, we will consider adding support for the Pen.Style
in RAP for a future release.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com