.. include:: ../substitutions

.. oe:namespace:: OEDepict

.. meta::
   :keywords: OEWriteReport

.. _OEDepict_OEWriteReport:


.. oe:function:: OEWriteReport


   .. list-table:: **The overloaded versions of the OEWriteReport function**
      :widths: 100 200
      :header-rows: 1

      * - Link
        - Description

      * - :ref:`OEWriteReport(filename, report)<api_OEWriteReport_fname_report>`
        - writes report into file

      * - :ref:`OEWriteReport(stream, ext, report)<api_OEWriteReport_stream_ext_report>`
        - writes report into output stream

.. _api_OEWriteReport_fname_report:

   .. oe:api::

      bool OEWriteReport(const std::string& filename, const OEReport& report,
                         unsigned int page = 0u)


   Writes page(s) of the report into a file with the given name.

   *filename*
      The filename into which the page(s) of the report are written.
      The file extension determines the type of the multi-page image.

   *report*
      The :ref:`OEReport <OEDepict_OEReport>` object of which page(s) is/are
      being written into the given file.

   *pageidx*
      This value has to be in the range from `0` to
      :oe:meth:`OEDepict::OEReport::NumPages()<OEDepict::OEReport::NumPages>`.

   .. note::

      If :math:`pageidx` is a valid page number *i.e* in the range from `1` to
      :oe:meth:`OEDepict::OEReport::NumPages()<OEDepict::OEReport::NumPages>`,
      then only the :math:`pageidx^{th}` page of the report is written into the
      file.
      If :math:`pageidx` is zero and the file extension is recognized as a multi-page
      format, than all pages of the report are written into the file.

   .. seealso::

      * :oe:func:`OEDepict::OEIsRegisteredImageFile` function
      * :oe:func:`OEDepict::OEIsRegisteredMultiPageImageFile` function


   .. ################################################################

.. _api_OEWriteReport_stream_ext_report:

   .. oe:api::

      bool OEWriteReport(OEPlatform::oeostream& os,
                         const std::string& extension, const OEReport& report,
                         unsigned int page = 0u)

   Writes page(s) of the report into the given stream.

   *os*
      The stream into which the page(s) of the report are written.

   *ext*
      The extension which determine the type of the image.

   *report*
      The :ref:`OEReport <OEDepict_OEReport>` object of which page(s) is/are
      being written into the given file.

   *pageidx*
      This value has to be in the range from `0` to
      :oe:meth:`OEDepict::OEReport::NumPages()<OEDepict::OEReport::NumPages>`.

   .. note::

      If :math:`pageidx` is a valid page number *i.e* in the range from `1` to
      :oe:meth:`OEDepict::OEReport::NumPages()<OEDepict::OEReport::NumPages>`,
      then only the :math:`pageidx^{th}` page of the report is written into the
      stream.
      If :math:`pageidx` is zero and the file extension is recognized as a multi-page
      format, than all pages of the report are written into the stream.

   .. seealso::

      * :oe:func:`OEDepict::OEIsRegisteredImageFile` function
      * :oe:func:`OEDepict::OEIsRegisteredMultiPageImageFile` function
      * :oe:func:`OEDepict::OEWriteReportPageByPage` function
