'Function to write out basic details to the matrix object'

def writeToMatrix(self, matrix, row, col, langDict={}, answerMatrix=None):

    self._store_metadata()
    self.getMetaData()
    startrow = row
    startcol = col
    endrow = row
    endcol = col
    maxWidth = 20
    labelWidth = (maxWidth / 2)
    codeNum = self.qstnNo
    row += 1
    needHeading = True
    subtitle = survey_T(self.subtitle, self.langDict)
    cell = survey_MatrixElement(startrow, startcol, subtitle, style='styleSubHeader')
    cell.merge((labelWidth - 1), 0)
    matrix.addElement(cell)
    for line in xrange(int(self.rowCnt)):
        label = survey_T(self.rows[line], self.langDict)
        (lwidth, lheight) = (labelWidth, ((len(label) / ((4 * labelWidth) / 3)) + 1))
        cell = survey_MatrixElement(row, col, label, style='styleSubHeader')
        cell.merge((lwidth - 1), (lheight - 1))
        matrix.addElement(cell)
        maxrow = (row + lheight)
        endcol = (col + lwidth)
        for cell in xrange(int(self.colCnt)):
            code = ('%s%s' % (self.question['code'], codeNum))
            codeNum += 1
            childWidget = self.getChildWidget(code)
            qtype = childWidget.get('Type')
            realWidget = survey_question_type[qtype](childWidget.id)
            realWidget.label = False
            col = endcol
            realWidget.startPosn = (col, row)
            (endrow, endcol) = realWidget.writeToMatrix(matrix, row, col, langDict, answerMatrix)
            if (endrow > maxrow):
                maxrow = endrow
            if needHeading:
                label = survey_T(self.columns[cell], self.langDict)
                cell = survey_MatrixElement(startrow, col, label, style='styleSubHeader')
                cell.merge(((endcol - col) - 1), 0)
                matrix.addElement(cell)
        row = maxrow
        col = startcol
        needHeading = False
    self.addPaddingToCell(matrix, startrow, startcol, row, endcol)
    row += self.xlsMargin[1]
    endcol += self.xlsMargin[0]
    return (row, endcol)
