Yes, I set it to System. However, I've solved the issue. You have to pass the main report's variable as a parameter, with the value expression like $V{mainVariable}. Then the subreport can change it as it likes, sort of like it's a global variable. Strange that return values didn't work. I used this to get a TOC to work with many subreports. Now each subreport runs the same scriptlet the main report does. To get the page numbering correct, I pass in the main report's current page as a parameter, then in the scriptlet I do: Code:// Get the current subreport's page. Integer pageIndex = (Integer)this.getVariableValue("PAGE_NUMBER"«»); // Get the current main report page. Integer currentPage = (Integer)this.getParameterValue("currentPage"«»); // Calculate the real page number of the subreport. Integer realPage = currentPage + pageIndex - 1;