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
        # Merge the top left cells
        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)):
            # Add the label
            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)
                type = childWidget.get("Type")
                realWidget = survey_question_type[type](childWidget.id)
                realWidget.label = False
                #realWidget.xlsMargin = (0,0)
                col = endcol
                realWidget.startPosn = (col, row)
                (endrow, endcol) = realWidget.writeToMatrix(matrix,
                                                             row,
                                                             col,
                                                             langDict,
                                                             answerMatrix
                                                            )
                if endrow > maxrow:
                    maxrow = endrow
                if needHeading:
                    # Now add the heading for this column
                    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
        # Add widget padding
        self.addPaddingToCell(matrix, startrow, startcol, row, endcol)
        row += self.xlsMargin[1]
        endcol += self.xlsMargin[0]
        return (row, endcol)

    # -------------------------------------------------------------------------
Test round-tripping types *fe_args* through the default data model's
dataset/ETHPy150Open sahana/eden/modules/s3db/survey.py/S3QuestionTypeGridWidget.writeToMatrix--crossover with--dataset/ETHPy150Open numba/numba/numba/tests/test_datamodel.py/TestArgInfo._test_as_arguments