Skip to content

Understanding reportGenerator.py

Deepak Balaji edited this page Apr 4, 2020 · 2 revisions

This page explains what reportGenerator.py does

To start off, this module generates a audit ready report by converting all the information stored in the spreadsheet into something that the top management can understand at a glance, with technical details for the administrator as well so as to remediate any shortcomings

imports

  • A4 from reportlab.lib.pagesizes to set the page size as that of the standard A4 dimensions

  • canvas from reportlab.pdfgen to write stuff into the A4 page

  • reader from csv to read the data stored in the CSV

variables

  • colorPass RGB value for the color of the text that indicates PASS

  • colorFail RGB value for the color of the text that indicates FAIL

  • colorWarn RGB value for the color of the text that indicates CHEK

  • colorPrimary RGB value for the primary color used in the document

  • colorSecondary RGB value for the secondary color used in the document

functions

  • setInfo Sets the following information into the metadata of the created document

    • Author
    • Creator
    • Producer
    • Subject
  • makeOutline Sets a navigable outline panel where all the individual result and it's page number is displayed

  • drawBorder Draws the border on the page with the specified color

  • makeTitle Makes the first page of the report where the organization, system ID, result, and the name of the auditor is printed

  • makeResult Makes the page that displays the test start and finish times

  • makeIntro Makes the page(s) that print out the options that were given during the program execution

  • makeIndex Makes the index page(s), that contains the recommendation numbers that were tested, the result and the message

  • makeBody Makes dedicated page(s) for each and every control that was tested, explaining what was checked and why the result that is displayed was arrived at

  • createPDF The function that calls all the above functions to generate a PDF from the CSV that is given as input

  • generatePDF The function that concurrently calls createPDF for all the reports that need to be generated from the spreadsheet(s) given as input

Clone this wiki locally