mousumib Posted December 2, 2019 Share Posted December 2, 2019 I have a main report and two sub report which contains one cross tab in each. I want to set width and left property of both sub report in detail band dynamically which I will pass as a param to main report. In between both sub report there is a gap, how to remove it? Cross tab has dynamic no of columns. I can calculate the width of both sub report and set main report page width(total of both sub report) as per that calculated value and also pass those as param. Any help is appreciated. I have tried to set pageWidth and Left/Width property from param but that's not working. Link to comment Share on other sites More sharing options...
mousumib Posted December 5, 2019 Author Share Posted December 5, 2019 Get idea from following post and done it.https://community.jaspersoft.com/questions/1013551/dynamic-positioning-object-using-x-and-y-coordinatesCode snippet :jasperPrint.setPageWidth(pageWidth);JRPrintPage page = jasperPrint.getPages().get(0);List<JRPrintElement> pageElements = page.getElements();pageElements.get(3).setX(0); pageElements.get(3).setWidth(tab1Width);pageElements.get(5).setX(tab1Width); pageElements.get(6).setX(tab1Width+tab2Width+10); pageElements.get(7).setX(tab1Width+tab2Width+90); 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