code: private static ReportLayout getReportLayoutForHeaderFunctions(ReportLayout layout) {
  		ReportLayout convertedLayout = ObjectCloner.silenceDeepCopy(layout);
  		
  		List<FunctionBandElement> headerFunc = getHeaderFunctions(convertedLayout);
  		Band footerBand = convertedLayout.getFooterBand();
  		insertFunctionsInFooterBands(headerFunc, footerBand, convertedLayout.getColumnCount());
  		
  		List<ReportGroup> groups = convertedLayout.getGroups();
  		for (ReportGroup rg : groups) {
  			List<FunctionBandElement> groupHeaderFunc = getGroupHeaderFunctions(convertedLayout, rg.getName());
  			Band gBand = convertedLayout.getBand(ReportLayout.GROUP_FOOTER_BAND_NAME_PREFIX + rg.getName());
  			insertFunctionsInFooterBands(groupHeaderFunc, gBand, convertedLayout.getColumnCount());
  		}
  		
  		return convertedLayout;
  	}
docs: If a report layout contains a function in header or in group header, we must add it as hidden in footer or group footer
  to be computed (any function is added to a new row)
  
  @param layout report layout
  
  @return a new report layout with header functions also inserted in footers