Copy Components in Report?
I am trying to make a copy of a region in a report at run time. Ofcourse,
all the components on the region must also be copied to the new region as
well. I tried using "Assign" method of the TppRegion. But it gave me "Cannot
assign TppRegion to a TppRegion" error .Seems like the "Assign" method of
the TppRegion is not implemented. Can anybody suggest a good method of
making a copy of a Region at run time?
Thanks,
Vikram
all the components on the region must also be copied to the new region as
well. I tried using "Assign" method of the TppRegion. But it gave me "Cannot
assign TppRegion to a TppRegion" error .Seems like the "Assign" method of
the TppRegion is not implemented. Can anybody suggest a good method of
making a copy of a Region at run time?
Thanks,
Vikram
This discussion has been closed.
Comments
objects in the original region using the region's Objects[] array property.
So you can loop through the objects, that is fine, but you need to clone
them, so you have to pull the class out from each object, instantiate one,
and then assign the properties of the object. This is a lot of work. What
you can do is do what the designer does, and stream a copy of the region
down, and them stream it back up into an object. Take a look is
ppDsgner.pas at the TppDesignerWindow's SelectionToClipboard and
ClipboardToSelection methods.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
objects and create similar components in the destination region.
Since I need to change the properties of the objects after copying its
probably easier for me to create them one-by-one and set the props.
Thanks for the tip.
Vikram