Page 1 of 1

Copying report component

Posted: Mon Jun 21, 2010 4:35 am
by m.n
Hello,

I'd like to copy the component:

Code: Select all

StiReport report;
// [...]
StiComponent originalComponent = report.GetComponentByName("A");
StiComponent newComponent = (StiComponent)originalComponent.Clone(true);
component.Parent.Components.Add(component);
Is there a better (safer, faster...) way than above one?

Copying report component

Posted: Mon Jun 21, 2010 7:02 am
by Jan
Hello,

Its a correct code, but you need assign to component new name if you want compile report with cloned components in future.

Thank you.

Copying report component

Posted: Mon Jun 28, 2010 7:18 am
by m.n
Thanks.
And once more question: in what conditions StiComponent.Clone(true) can return a null value?

Copying report component

Posted: Tue Jun 29, 2010 6:11 am
by Jan
Hello,

This method should nor return null value in any cases.

Thank you.