code: def open_in_composer(self):
          
          impact_layer = self.impact_function.analysis_impacted
          report_path = dirname(impact_layer.source())
  
          impact_report = self.impact_function.impact_report
          custom_map_report_metadata = impact_report.metadata
          custom_map_report_product = (
              custom_map_report_metadata.component_by_tags(
                  [final_product_tag, pdf_product_tag]))
  
          for template_path in self.retrieve_paths(
                  custom_map_report_product,
                  report_path=report_path,
                  suffix='.qpt'):
  
              layout = QgsPrintLayout(QgsProject.instance())
  
              with open(template_path) as template_file:
                  template_content = template_file.read()
  
              document = QtXml.QDomDocument()
              document.setContent(template_content)
  
              # load layout object
              rwcontext = QgsReadWriteContext()
              load_status = layout.loadFromTemplate(document, rwcontext)
  
              if not load_status:
                  # noinspection PyCallByClass,PyTypeChecker
                  QtWidgets.QMessageBox.warning(
                      self,
                      tr('InaSAFE'),
                      tr('Error loading template: %s') % template_path)
  
                  return
  
              QgsProject.instance().layoutManager().addLayout(layout)
              self.iface.openLayoutDesigner(layout)
docs: Open in layout designer a given MapReport instance.
  
          .. versionadded: 4.3.0