Sorry for my poo english..
I have created a variable in the main document that is sent to a subreport (CKLocazione - class java.lang.integer - init value 0)
In the subreport I created the same variable (CKLocazione - Calculation count - class java.lang.integer)
This variable increments only if a field value is equal to 2 and the result must return to the main page.
I'm not expert, I'm still learning
What is the solution?