zspartan Posted April 19, 2011 Share Posted April 19, 2011 We are trying to use iReport to generate printable reports that have to be hole punched and put into a binder. Therefore, we need to have the margin on odd pages be shifted over to the right of the page, and shifted to the left on even pages. We are struggling to implement this and would appreciate any guidance on the matter possible. Link to comment Share on other sites More sharing options...
jpauze Posted April 19, 2011 Share Posted April 19, 2011 Not 100% on whether you can dynamically adjust report margins at runtime as this si a report setting not a page setting. Don't think possible but maybe someone who is more well versed in iReport/Jasper than I can confirm. One option (hack) would be to double up the objects and/or detail bands and then control which one prints through a printWhenExpression depending on the odd vs even pages. Example: following print expression would only print if an even page. new Boolean(($V{REPORT_COUNT}.intValue() % 2) == 0) This way you can offset the objects accordingly to get the margin you are looking for on the report. That's all I can think of. Link to comment Share on other sites More sharing options...
zspartan Posted April 19, 2011 Author Share Posted April 19, 2011 Thank you for the suggestion. Doubling the elements may not be the ideal solution, but it may be the best currently available and I greatly appreciate your time. If nothing else it at least lets us move on to other challenges. Link to comment Share on other sites More sharing options...
kolaitis Posted April 27, 2011 Share Posted April 27, 2011 Another approch.Create a Group on one of your database field. (Start OnNew Page = true) On group footer create Subreport . Aling to left most position. printWhenExpression: new Boolean(($V{REPORT_COUNT}.intValue() % 2) == 1) oddCopy the created subreport on desire right position, on top of the other subreport.printWhenExpression: new Boolean(($V{REPORT_COUNT}.intValue() % 2) == 0) evenGood Luck. Link to comment Share on other sites More sharing options...
facumanzi Posted July 23, 2020 Share Posted July 23, 2020 Hi, I have the same problem, furthermore another problem I have is that the content in my report is dinamic. Someone could help me please? 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