waited for a long time .. but no reply from Stackoverflow...
Anyway i found my solution..
First in your summary band put this line
<printWhenExpression><![CDATA[new Boolean($P{REPORT_PARAMETERS_MAP}.put("LastPageNumber",$V{PAGE_NUMBER}).equals("dummyPrintWhen"))]]></printWhenExpression>
Remember this above line must be only in the summary band of the report.
After that you can compare this parameter at any point of time in your report to find last page number .
For Example
<printWhenExpression><![CDATA[new Boolean(!$V{PAGE_NUMBER}.equals($P{REPORT_PARAMETERS_MAP}.get("LastPageNumber")))]]></printWhenExpression>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…