<!--
      (Do not remove this comment block.)
  Version: 2.0.x
   Last modified: May 13th 2007
        modified: November 28th 2006
        modified: August 12th 2006
	modified: February 28th 2005

  Maintainers:
               Chris Lyttle <chris@wilddev.net>
               Neil Williams <linux@codehelp.co.uk>

  Author:
               Chris Lyttle <chris@wilddev.net>
  Translators:
               (translators put your name and email here)
-->

<chapter id="Reports">
  <title>Reports And Charts</title>

     <note><para>This section is a "work in process" all of the material has not been reviewed for V2.0.
      While it may not be strictly accurate, it is at least a "guide".</para></note>

   <para>Reports and Charts give GnuCash the ability to present an overview of financial
    data in various ways. This can range from a simple summary of account totals to an
    advanced portfolio view. This section will present an explanation of the main GnuCash
    reports and how to adjust them.</para>

   <para>GnuCash has classified the main types of reports into four major classes. These
    are all available under the Reports menu.</para>

     <sect1 id="report-general">
      <title>General Reports</title>

       <para>The General Reports includes the Tax Report and TXF Export, the Account
        Summary and the Transaction Reports and also the reports in the Sample &amp; Custom menu.</para>

        <itemizedlist>
         <listitem>
          <para>Account Summary:</para>
         </listitem>

         <listitem id="report-taxreport">
          <para>Tax Report and TXF Export: The tax report is used to export all tax
           related Income and Expenses to a TXF (Tax eXchange Format) file. This is in
           addition to the HTML format that all reports allow. The TXF file can be imported
           into tax filing programs such as TaxCut or TurboTax.</para>

          <note><para>For this to work, the user has to segregate taxable and non taxable
           income to different accounts, as well as deductible and non deductible expenses.
           The Tax Information dialog is used for this. To access the Tax Information dialog
           go to <guimenu>Edit -&gt; Tax Options</guimenu>. The user also must set the TXF category of each tax
           related account. The Tax Information dialog is described in the Setting Tax Options
           section.</para></note>

         </listitem>

         <listitem>
          <para>Transaction Report:</para>
         </listitem>

         <listitem>
          <para>Welcome Sample Report:</para>
         </listitem>

         <listitem>
          <para>Custom Multicolumn Report: This report is used to place multiple reports
           into a single report window to examine a set of financial information at a glance.</para>
         </listitem>

         <listitem>
          <para>Sample Graphs</para>
         </listitem>

         <listitem>
          <para>Sample Report with Examples:</para>
         </listitem>
        </itemizedlist>

   </sect1>

   <sect1 id="report-assets">
    <title>Assets &amp; Liabilities</title>

     <para>The Assets &amp; Liabilities reports includes the Balance Sheet report,
      Investment reports and the Net Worth report.</para>

      <itemizedlist>
       <listitem>
        <para>Advanced Portfolio:</para>
       </listitem>

       <listitem>
        <para>Asset Barchart:</para>
       </listitem>

       <listitem>
        <para>Asset Piechart:</para>
       </listitem>

       <listitem>
        <para>Average Balance:</para>
       </listitem>

       <listitem>
        <para>Balance Sheet: This report summarizes assets, liabilities, and equity.
         When properly maintained, assets should equal the sum of liabilities and equity.
         If that is not the case, there is some kind of internal imbalance in the
         accounts.</para>
       </listitem>

       <listitem>
        <para>General Journal:</para>
       </listitem>

       <listitem>
        <para>General Ledger:</para>
       </listitem>

       <listitem>
        <para>Investment Portfolio: This report summarizes the value of the stocks in
         the current portfolio.</para>
       </listitem>

       <listitem>
        <para>Liability Barchart:</para>
       </listitem>

       <listitem>
        <para>Liability Piechart:</para>
       </listitem>

       <listitem>
        <para>Net Worth Barchart: Net worth is the difference between the value of assets
         or liabilities.</para>
       </listitem>

       <listitem>
        <para>Price Scatterplot:</para>
       </listitem>
      </itemizedlist>
   </sect1>

   <sect1 id="report-income">
    <title>Income &amp; Expense</title>

     <para>The Income &amp; Expense reports includes the Cash Flow and Income Statement reports.</para>

      <itemizedlist>
       <listitem>
        <para>Budget Report:</para>
       </listitem>

       <listitem>
        <para>Cash Flow:</para>
       </listitem>

       <listitem>
        <para>Equity Statement:</para>
       </listitem>

       <listitem>
        <para>Expense Barchart:</para>
       </listitem>

       <listitem>
        <para>Expense Piechart:</para>
       </listitem>

       <listitem>
        <para>Expense vs Day of Week:</para>
       </listitem>

       <listitem>
        <para>Income Barchart:</para>
       </listitem>

       <listitem>
        <para>Income &amp; Expense Chart:</para>
       </listitem>

       <listitem>
        <para>Income Statement: This report summarizes sources of income and expenditure.
         (This report was called Profit &amp; Loss in gnucash-1.8.)</para>
       </listitem>

       <listitem>
        <para>Income Statement:</para>
       </listitem>

       <listitem>
        <para>Income vs Day of Week:</para>
       </listitem>

       <listitem>
        <para>Trial Balance: This report summarizes sources of income and expenditure.</para>
       </listitem>
      </itemizedlist>

   </sect1>

   <sect1 id="report-biz">
    <title>Business Reports</title>

      <para>The Business Reports includes Customer and Vendor Reports and Printable
       Invoices as well as Aging reports.</para>

       <itemizedlist>
        <listitem>
         <para>Customer Report:</para>
        </listitem>

        <listitem>
         <para>Easy Invoice:</para>
        </listitem>

        <listitem>
         <para>Employee Report:</para>
        </listitem>

        <listitem>
         <para>Fancy Invoice:</para>
        </listitem>

        <listitem>
         <para>Payable Aging:</para>
        </listitem>

        <listitem>
         <para>Printable Invoice:</para>
        </listitem>

        <listitem>
         <para>Receivable Aging:</para>
        </listitem>

        <listitem>
         <para>Vendor Report:</para>
        </listitem>
       </itemizedlist>

     </sect1>

     <sect1 id="report-custom">
      <title>Customizing Reports and Graphs</title>

        <para>GnuCash reports have many options for customization. To access report options
         choose the Options button on the toolbar.</para>

           <note> <para>Check changed Graphic Engine Options and describe Saving Customized Reports</para></note>
<!--          
              suggest how to save report options E.g. Choose definite options when you
              want to see an Income Statement, so you want to save them for future and
              not to choose all the time.

                File -> Add Report   (in 2.0.5).
              But first, you must change the title of the report in the options. -->

        <para>Many reports share similar sorts of options. Some common ones include:</para>

        <itemizedlist>
          <listitem>
            <para>Report Name: Set the title of the report. This is also used to print the
             report for later viewing.</para>
          </listitem>

          <listitem>
            <para>Date Options: Reports typically specify either a single date, or a date
             range, for the report. Dates can be specified in two ways, either directly
             (using the date selector), or by selecting a relative date from the menu.
             Relative dates allow you to specify dates like "Beginning of this year" or
             "Today".</para>
          </listitem>

          <listitem>
            <para>Step Size: This option is used on bar charts to determine the interval which
             each bar represents. Typical values are daily, weekly, monthly, and yearly.</para>
          </listitem>

          <listitem>
            <para>Accounts: Select the appropriate accounts for the report. Note that in some
             reports only certain types of accounts can be selected. For example, an expense
             piechart only allows expense accounts to be selected. </para>
          </listitem>

          <listitem>
            <para>Show Long Account Names: This option allows displaying either short account
             names (for example, Power) or long account names (for example, Utilities:Power).
            </para>
          </listitem>

          <listitem>
            <para>Include Subaccounts?: Summary reports typically have an include all
             subaccounts option, which if selected ensures that all subaccounts are included
             if the parent account is.</para>
          </listitem>

          <listitem>
            <para>Depth: This option allows the selection of how many levels the report
             displays subaccounts. If the subaccounts go deeper than selected, an overall value
             for all the subaccounts is calculated and included in a total. To make sure every
             account selected is individually displayed, select All.</para>
          </listitem>

          <listitem>
            <para>Style Sheet: Select a Style Sheet. Style sheets control how reports are
             displayed. At the moment, there are three style sheets, "default", "Easy" and "technicolor".
             You can customize each of these from the Edit -&gt; Style Sheets... menu item.
             This is described in the Changing Style Sheets section. <xref linkend="change-style"></xref></para>
          </listitem>

          <listitem>
            <para>Plot Dimensions: There are width and height options for most graphs, which
             specify the displayed dimensions (in pixels).</para>
          </listitem>

          <listitem>
            <para>Report Currency: Select the report currency. Generally, values will be
             converted to this currency for display.</para>
          </listitem>

          <listitem>
            <para>Price Source: Select how stock and currency prices are calculated in this
             report. Choose between a weighted average of prices over all transactions, prices
             at current values, or prices at the time of the report date.</para>
          </listitem>

          <listitem>
            <para>Totals: Charts display totals in the chart legend if this option is selected.
            </para>
          </listitem>

          <listitem>
            <para>Maximum Slices: Controls the maximum number of slices displayed in a
             piechart - other accounts will be placed in a slice marked Other. </para>
          </listitem>

          <listitem>
            <para>Maximum Bars: Controls the maximum number of bars displayed in a barchart.
            </para>
          </listitem>

          <listitem>
            <para>Display Columns: Choose columns to show from the register.</para>
          </listitem>
        </itemizedlist>
      </sect1>

      <sect1 id="report-print">
        <title>Printing or Exporting Reports and Graphs</title>

          <note><para> Verify !!!  How customize printing with Gnome?</para></note>

        <para>GnuCash is able to print reports and to export the reports to HTML (web) pages. The
         Print GnuCash Document dialog is accessed from the Print button on the toolbar or
         go to File -&gt; Print in the menu. To Export a report to a web page (HTML) select
         the Export button on the toolbar and type in a file name.</para>


        <para>The Print GnuCash Document dialog is used to select which Printer to send the
         print job to or to print to a File. It also contains a Preview button to view the
         document before printing. Press Print to send the job to the selected printer or
         Cancel to dismiss the Print dialog.</para>


        <para>Printing from an open register prints the Account Report, which is also called
         the Register Report. This lists transactions in the account with a total. Other
         reports print as viewed in the Report screen.</para>
      </sect1>

      <sect1 id="report-create">
        <title>Creating Reports and Graphs</title>

             <note><para>This section may need updating !!!</para> </note>

        <para>It is possible to write reports if the current ones are not suitable. To do this
         you will need to know Scheme (a LISP-like programming language), and it is an
         excellent idea to have a copy of the GnuCash source code available. </para>

        <para>The reporting interface is documented in the source code file
         src/report/report-system/doc/report-html.txt. The file src/report/utility-reports/hello-world.scm
         in the GnuCash source distribution provides a good example of how reports are
         developed.</para>

        <para>It is also necessary to access data from the engine to get information for your
         report. This is performed by a set of Scheme wrapper functions that are documented in
         the file src/g-wrap/gnc.html. Examine some of the other reports in src/scm/report for
         an indication of how they are used.</para>

        <para>At present, reports are produced by calling a HTML-generation API, which outputs
         a dialect of HTML and rendering this with a HTML widget. This has limitations,
         particularly when trying to align objects precisely, as might be necessary for
         printing onto pre-printed invoices for example.</para>
   </sect1>

</chapter>
