Create Parameter of same name in both Main and Sub report.
1) Open Design tab of Main-report
2) Select Subreport and go to subreport properties
3) click Edit Parameters
4) Add new parameter // Note: Both parameter name should be same in main and subreport
5) Done!. you can directly pass parameters in a map like following:
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("REPORT_TYPE", report_type);
parameters.put("CMS", cms);
parameters.put("SITE", site);
parameters.put("OPPORTUNITY_ID", opportunity_id);