Our requirement is to generate a Jasper report with and without page break option and print it too. To achieve this we tried to handle “with page break” and “without page break” scenarios in a single jrxml template.For With Page Break the group tags will have “isStartNewPage” attribute set to TRUE.For Without Page Break the group tags will have “isStartNewPage” attribute set to FALSE. Below shows the <group> design for with (isStartNewPage="true") and without(isStartNewPage="false") page break scenarios. As we can't control the rendering of the group at run time we have tried at the band level by using the "<printWhenExpression><![CDATA[($P{hasPageBreak}.equals("1"))? new Boolean(true):new Boolean(false)]]></printWhenExpression>" <!-- with page break --><group name="Groupheader1" isStartNewPage="true" isReprintHeaderOnEachPage="true" > <groupExpression><![CDATA[$F{groupbaseid}]]></groupExpression> <groupHeader> <band height="0" isSplitAllowed="true" > <printWhenExpression><![CDATA[($P{hasPageBreak}.equals("1"))? new Boolean(true):new Boolean(false)]]></printWhenExpression> </band> </groupHeader> <groupFooter> <band height="0" isSplitAllowed="true" > <printWhenExpression><![CDATA[($P{hasPageBreak}.equals("1"))? new Boolean(true):new Boolean(false)]]></printWhenExpression> </band> </groupFooter> </group> <!-- without page break --> <group name="Groupheader1_nopb" isStartNewPage="false" isReprintHeaderOnEachPage="true" > <groupExpression><![CDATA[$F{groupbaseid}]]></groupExpression> <groupHeader> <band height="0" isSplitAllowed="true" > <printWhenExpression><![CDATA[($P{hasPageBreak}.equals("0"))? new Boolean(true):new Boolean(false)]]></printWhenExpression> </band> </groupHeader> <groupFooter> <band height="0" isSplitAllowed="true" > <printWhenExpression><![CDATA[($P{hasPageBreak}.equals("0"))? new Boolean(true):new Boolean(false)]]></printWhenExpression> </band> </groupFooter> </group> We are able to achieve this but with some issues like extra spacing, new page at end of the report, etc.The reason is design of one template differs from the other. Please suggest a solution to resolve the above mentioned issue wherein we can handle with and without page break cases in a single jrxml template.