I have a main report with 4 sub reports. Is it possible to get the details of sub report in main report like name of subreport or id or something.
Yes Look at return values for a subreports http://jasperreports.sourceforge.net/schema.reference.html#returnValue . This lets you map values between the subreport and parent report, you can send back whatever you'd like. You'll need to map a variable in your subreport to a variable in your parent report, and may need to mess with 'evaluation times' wherever you display those values, but this is what you're looking for. Lot's of examples online if you have issues with this.