'Method to build the table.
@return: A list of Table objects. Normally this will be a list with
just one table object, but if the table needs to be split
across columns then one object per page will be created.'

def build(self):

    if (self.resource != None):
        ds = S3PDFDataSource(self)
        ds.select()
        self.labels = ds.getLabels()
        self.data.append(self.labels)
        (self.subheadingList, data) = ds.getData()
        (self.data + data)
    if (self.raw_data != None):
        self.data = self.raw_data
    self.rheader = []
    if (len(self.data) == 0):
        return None
    else:
        NONE = current.messages['NONE']
        for index in range(len(self.labels)):
            try:
                value = data[0][index]
            except:
                value = NONE
            self.rheader.append([self.labels[index], value])
    content = []
    style = [('FONTSIZE', (0, 0), ((-1), (-1)), self.fontsize), ('VALIGN', (0, 0), ((-1), (-1)), 'TOP'), ('FONTNAME', (0, 0), (0, (-1)), 'Helvetica-Bold'), ('FONTNAME', (1, 0), (1, (-1)), 'Helvetica')]
    (self.rheader, style) = self.pdf.addCellStyling(self.rheader, style)
    table = Table(self.rheader, repeatRows=1, style=style, hAlign='LEFT')
    content.append(table)
    return content
