Reusable content can be moved between templates by serializing a component from one report and deserializing it into another.

Serialize a band, deserialize into the target.
StiHeaderBand customerHeader = (StiHeaderBand) customerReport.getComponents().get("HeaderBand1");
String headerStr = StiSerializerControler.serializedObjectAsString(customerHeader);

StiHeaderBand newHeader = new StiHeaderBand();
StiDeserializerControler.deserializeFromString(headerStr, newHeader);

newHeader.setPage(originalReport.getPages().get(0));
originalReport.getPages().get(0).getComponents().add(originalIndex, newHeader);
newHeader.setName(StiNameCreation.createName(originalReport, "HeaderBand"));

How it works. Serialization clones the component and everything inside it, so a header (with its texts) transplants cleanly into another template.

By using this website, you agree to the use of cookies for analytics and personalized content. Cookies store useful information on your computer to help us improve efficiency and usability. For more information, please read the privacy policy and cookie policy.