code: def show_print_dialog(self):
          
          if not self.impact_function:
              # Now try to read the keywords and show them in the dock
              try:
                  active_layer = self.iface.activeLayer()
                  keywords = self.keyword_io.read_keywords(active_layer)
  
                  provenances = keywords.get('provenance_data', {})
                  extra_keywords = keywords.get('extra_keywords', {})
                  is_multi_exposure = (
                      extra_keywords.get(extra_keyword_analysis_type['key']) == (
                          MULTI_EXPOSURE_ANALYSIS_FLAG))
  
                  if provenances and is_multi_exposure:
                      self.impact_function = (
                          MultiExposureImpactFunction.load_from_output_metadata(
                              keywords))
                  else:
                      self.impact_function = (
                          ImpactFunction.load_from_output_metadata(keywords))
  
              except (KeywordNotFoundError,
                      HashNotFoundError,
                      InvalidParameterError,
                      NoKeywordsFoundError,
                      MetadataReadError,
                      # AttributeError  This is hiding some real error. ET
                      ) as e:
                  # Added this check in 3.2 for #1861
                  active_layer = self.iface.activeLayer()
                  LOGGER.debug(e)
                  if active_layer is None:
                      if self.conflicting_plugin_detected:
                          send_static_message(self, conflicting_plugin_message())
                      else:
                          send_static_message(self, getting_started_message())
                  else:
                      show_no_keywords_message(self)
              except Exception as e:  # pylint: disable=broad-except
                  error_message = get_error_message(e)
                  send_error_message(self, error_message)
  
          if self.impact_function:
              dialog = PrintReportDialog(
                  self.impact_function, self.iface, dock=self, parent=self)
              dialog.show()
          else:
              display_critical_message_bar(
                  "InaSAFE",
                  self.tr('Please select a valid layer before printing. '
                          'No Impact Function found.'),
                  iface_object=self
              )
docs: Open the print dialog