Jump to: navigation, search

Report-writing tutorial

24 bytes removed, 02:28, 28 December 2012
Report class: format
Report class '''must''' provide a <tt>write_report()</tt> method. This method should dump the report's contents into the already opened document instance.
def write_report(self): self.doc.start_paragraph("ABC-Title") self.doc.write_text(_("Some text")) self.doc.end_paragraph()
The rest of the report class is pretty much up to the report writer. Depending on the goals and the scope of the report, there can be any amount of code involved. When the user generates the report in any mode, the class constructor will be run, and then the <tt>write_report()</tt> method will be called. So if you wrote that beautiful method listing something really important, make sure it is eventually called from within the <tt>write_report()</tt>. Otherwise nobody will see it unless looking at the code.

Navigation menu