Added a private variable to set the format of report. Changed the if condition to switch case