'Produce an XLS sheet of the grouped table
@param r: the S3Request
@return: the XLS document'

def xls(self, r, filename=None):

    field_types = self.field_types
    data = self.data
    columns = data.get('c')
    labels = data.get('l')
    aggregate = self.aggregate
    if aggregate:
        functions = dict(((c, m) for (m, c) in aggregate))
    else:
        functions = {}
    types = {}
    for column in columns:
        field_type = field_types.get(column, 'virtual')
        if (field_type == 'virtual'):
            method = functions.get(column)
            if (method and (method != 'count')):
                field_type = 'double'
        types[column] = field_type
    rows = []
    self.xls_group_data(rows, data)
    self.xls_table_footer(rows)
    xlsdata = {'columns': columns, 'headers': labels, 'types': types, 'rows': rows}
    from s3.s3export import S3Exporter
    exporter = S3Exporter().xls
    return exporter(xlsdata, title=self.title, use_colour=True, evenodd=False)
