docs: public void generateReport(ViewDelegate view, Model model, ReportType reportType){
          // ZAP: Allow scan report file name to be specified
      	
      	final ReportType localReportType;
      	
      	if(reportType == null) {
      		localReportType=ReportType.HTML;
      	} else {
      		localReportType=reportType;	
      	}
      	
          try {
              JFileChooser chooser = new WritableFileChooser(Model.getSingleton().getOptionsParam().getUserDirectory());
  	        
              chooser.setFileFilter(new FileFilter() {
  
              	@Override
                  public boolean accept(File file) {
                      if (file.isDirectory()) {
                          return true;
                      } else if (file.isFile()) {
                      	String lcFileName=file.getName().toLowerCase(Locale.ROOT);
                      	switch (localReportType) {
                          case XML:
                              return lcFileName.endsWith(XML_FILE_EXTENSION);
                          case MD:
                              return lcFileName.endsWith(MD_FILE_EXTENSION);
                          case JSON:
                              return lcFileName.endsWith(JSON_FILE_EXTENSION);
                          case HTML:
                          default:
                              return (lcFileName.endsWith(HTM_FILE_EXTENSION) || lcFileName.endsWith(HTML_FILE_EXTENSION));
                          }
                      }
                      return false;
                  }
  
                  @Override
                  public String getDescription() {
                  	switch(localReportType) {
                  	case XML:
                  		return Constant.messages.getString("file.format.xml");
                  	case MD:
                  		return Constant.messages.getString("file.format.md");
                  	case JSON:
                  		return Constant.messages.getString("file.format.json");
                  	case HTML:
                  	default:
                  		return Constant.messages.getString("file.format.html"); 
                  	}
                  }
              });
  
              String fileExtension="";
          	switch(localReportType) {
          	case XML:
          		fileExtension=XML_FILE_EXTENSION;
          		break;
          	case JSON:
          		fileExtension=JSON_FILE_EXTENSION;
          		break;
          	case MD:
          		fileExtension=MD_FILE_EXTENSION;
          		break;
          	case HTML:
          	default: 
          		fileExtension=HTML_FILE_EXTENSION;
          		break;
          	}
          	chooser.setSelectedFile(new File(fileExtension)); //Default the filename to a reasonable extension;
          	
              int rc = chooser.showSaveDialog(View.getSingleton().getMainFrame());
              File file = null;
              if (rc == JFileChooser.APPROVE_OPTION) {
                  file = chooser.getSelectedFile();
  
                  File report = generate(file.getAbsolutePath(), model, localReportType);
                  if (report == null) {
                      view.showMessageDialog(Constant.messages.getString("report.unknown.error", file.getAbsolutePath()));
                      return;
                  }
  
                  if (Files.notExists(report.toPath())) {
                      logger.info("Not opening report, does not exist: " + report);
                      return;
                  }
  
                  try {
                  	DesktopUtils.openUrlInBrowser(report.toURI());
                  } catch (Exception e) {
                      logger.error(e.getMessage(), e);
                      view.showMessageDialog(Constant.messages.getString("report.complete.warning", report.getAbsolutePath()));
                  }
              }
  
          } catch (Exception e) {
              logger.error(e.getMessage(), e);
              view.showWarningDialog(Constant.messages.getString("report.unexpected.error"));
          }
      }