I'm trying to create Sub Report in Jaspersoft Studio 5.5. My table structure is like below:
DEPT(DEPTNO, DNAME, LOC)
EMP(EMPNO, ENAME, SAL, DEPTNO)
Main Report name: MainReport.jrxml
Sub Report name: SubReport.jrxml
I have tried like below.
Created one row in the "Main Report" by passing parameter for DeptNo.
Now, Dragged Subreport component from Palette on to the main report.
Selected "Create a new report" option from "Subreport" wizard.
Tried to write the below query to get Employees from the Active Department. Problem started from here onwards. I could not understand how to supply the parameter to get the parent DEPTNO
SELECT EMPNO, ENAME, SALARY FROM EMP WHERE DEPTNO = 10
In the above code, I've Just hard coded DEPTNO = 10
to complete the query. This is where I want support from experts to know how to replace DEPTNO = 10
with the parameter