shriyakish Posted March 24, 2011 Share Posted March 24, 2011 Hello,I need a specific text in Details band to come on a new page. So I create a dummy group and add the field to the group.But when I set property ' start on a new page' to true, it still continues with the Detail section.Please help.I am using IReport 3.5 Thanks. Link to comment Share on other sites More sharing options...
mvw Posted March 24, 2011 Share Posted March 24, 2011 Hi,Try setting "minHeightToStartNewPage" property in Scriptlet,Important:minHeight < (Page height) - (Header + Footer + external groups) heightdon't set "Start on a new page" property for the group Good luck! Code:public void beforeGroupInit(String groupName) throws JRScriptletException{ if (groupName.equals("myGroup")) { JasperReport jr = (JasperReport) getParameterValue("JASPER_REPORT"); JRGroup grp = getGroup(jr, "myGroup"); Boolean isNewPage = {define_your_condition}; if (isNewPage) { grp.setMinHeightToStartNewPage(450); } else { grp.setMinHeightToStartNewPage(0); } }}public static JRGroup getGroup(JasperReport jr, String groupName) { JRGroup group = null; if (jr != null) { JRGroup[] groups = jr.getGroups(); if (groups != null) { for (int i = 0; i < groups.length; ++i) { if (groups[i].getName().equals(groupName)) { group = groups[i]; break; } } } } return group;} Link to comment Share on other sites More sharing options...
shriyakish Posted March 24, 2011 Author Share Posted March 24, 2011 Thank You for your reply.I have never worked with Scriptlets before.I will look into it and see if it solves my problem and get back.Thanks once again. Link to comment Share on other sites More sharing options...
shriyakish Posted March 24, 2011 Author Share Posted March 24, 2011 Oh... there is also a property in IReport setMinHeightToStartNewPage.Will try to set that in IReport and see if it works. Thanks. 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