2006 IR Open Dicussion Posted August 26, 2006 Share Posted August 26, 2006 By: Christiaan - christiaan_se Copying design from one band to another 2006-02-16 06:50 Hi, I want to copy the design of a band of one report to another report. I currently have the following code, which seems to work fine, but I was wondering if need to call getCopy() instead of adding the JRDesignElement right away. If so, I need to pass in a JRAbstractObjectFactory, how can I retrieve one? private void replaceBand(JRDesignBand originalBand, JRDesignBand newBand) { if(newBand.getElements().length > 0) { for(JRElement element : originalBand.getElements()) { if(element instanceof JRDesignElement) { JRDesignElement designElement = (JRDesignElement) element; originalBand.removeElement(designElement); } } originalBand.setHeight(newBand.getHeight()); for(JRElement element : newBand.getElements()) { if(element instanceof JRDesignElement) { JRDesignElement designElement = (JRDesignElement) element; originalBand.addElement(designElement); } } } } kind regards, Christiaan Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now