hi jacasoj ..i dont see your post on this page which i received in mail i got : Hello Yuv! I think we both have (we'll, you had), the same problem. I've done just the same as you but it just displays a sympathetic 'null' in the variable print... If you can please post your scriptlet just the way you did, you'll help me plenty! Thanx :cheer: i dont know if you found the solution..still i am attaching my scriptlet here import net.sf.jasperreports.engine.JRDefaultScriptlet; import net.sf.jasperreports.engine.JRScriptletException; /** * This class to use User Defined Variables inside JasperReports * @author YVa * */ public class ReportScriptlet extends JRDefaultScriptlet { /** * To initialize the variable when report initializes */ public void beforeReportInit() throws JRScriptletException { Integer intVal = (Integer) this.getVariableValue("MyPageCounter"); if (intVal == null) { intVal = new Integer(1); } this.setVariableValue("MyPageCounter", intVal); } /** * We want to use this variable as if page counter , hence increment by one * here */ public void beforePageInit() throws JRScriptletException { Integer intVal = (Integer) this.getVariableValue("MyPageCounter"); this.setVariableValue("MyPageCounter", new Integer(intVal.intValue() + 1)); } }