code: public static String getSql(Report report) {
  		String sql;
  		if (report.getSql() != null) {
  			sql = report.getSql();
  		} else {
  			sql = report.getQuery().toString();
  		}
  		return sql;
  	}
docs: Get sql string from report object
  
  @param report
  report
  @return sql string from report object