code: def make_text_page(self, valumap):
          
          logger.info('Making a text report page using template %r.', self.text_template)
          fh = open(self.text_template)
          template = fh.read()
          fh.close()
          
          parts = []
          for sr in self.subreports:
              report_data = [item.text for item in sr.report_data if item.text]
              if report_data:
                  parts.append('\n{1}\n***** {0} *****\n{1}'.format(sr.title, '*' * (len(sr.title)+12)))
                  parts.extend(report_data)
  
          valumap['subreports'] = '\n'.join(parts) # "\n<<NO SUBREPORT RELATED EVENTS>>\n"
          text_page = Template(template).safe_substitute(valumap)
          return TextPart(fmt='text', text=text_page, ext='txt')
docs: Builds the report as text page, using the template page from file.