# Reports And Charts

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".

Reports and Charts give &app; 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 &app; reports and how to adjust them.

&app; has classified the main types of reports into four major classes. These are all available under the Reports menu.

## General Reports

The General Reports include the Account Summary Report, Custom Reports, the Tax Schedule Report and TXF Export, and the Transaction Report and also the reports in the Sample & Custom menu.

### Account Summary

### Tax Schedule Report and TXF Export

The tax schedule report lists all taxable income and deductible expense amounts used in the preparation of US Income Tax returns. The purpose of the report is to provide a complete audit trail for these amounts. The report is intended to be used by a tax payer to manually prepare his or her own tax return, or alternatively, to be provided to a tax preparer for that purpose. The report can also be used to generate an export of all tax related income and expenses to a TXF (Tax eXchange Format) file (this is in addition to exporting to the HTML format that all reports allow). The TXF file can be imported into tax filing programs such as TaxCut or TurboTax. The report should be run, inspected carefully for errors or omissions, and then corrections made to transactions, report settings, currency conversion rates or the account structure as needed. This process should be repeated as often as needed until all the amounts on the report are correct before a final version is used and saved along with the tax returns.

For accounts specified in the report options (none = all) that are also flagged as Tax-related, all transactions for the time period selected (also in the report options) are included. The report sorts transactions by date within account providing subtotals by account within tax code within Form or Schedule line number. Support is also provided for multiple copies of and for sub-line items for selected Forms/Schedules. Optionally uses special date processing to include federal estimated tax payments after year end.

All totals are in USD since this is the currency required for filing US Income Tax returns. Non-USD transaction amounts are converted to USD using the transaction conversion rate to USD, if available. If not, a conversion rate from the price database is used (either the date nearest the transaction date or nearest the report date as specified in the report options; if none is available, transaction amounts are converted to zero and the report provides a comment accordingly). A complete audit trail of conversions is provided.

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 Income Tax Information dialog is used for this. To access the Income Tax Information dialog go to Edit Tax Report Options. The user also must set the TXF category of each tax related account. The Income Tax Information dialog is described in the section.

### Transaction Report

This report lists transactions in selected accounts during a specified financial period. Two fields may be optionally used for sorting and totalling.

#### Report Options

##### Transaction Report — Report Options

Transaction Report — Report Options screen

This is an image of the Transaction Report — Report Options — Display tab.

- Accounts tab

  - Accounts — Select one or more accounts to be reported.

    There are 4 buttons to aid account selection

    Select All | Select all accounts
    Clear All | Clear the selection and unselect all accounts
    Select Children | Select all descendants of selected account
    Select Default | Select the default account selection

  - Show Hidden Accounts — Show accounts that have been marked hidden.

  - Filter By — Optionally select accounts to be either included or excluded depending on Filter type

  - Show Hidden Accounts — Show accounts that have been marked hidden in the Filter By list of accounts

  - Filter Type — One of

    None | Do not do any filtering
    Include Transactions to/from Filter Accounts | Include Transactions to/from Filter Accounts only
    Exclude Transactions to/from Filter Accounts | Exclude Transactions to/from all Filter Accounts

  - Void Transactions — One of

    Non-void only | Show only non-voided transactions
    Void only | Show only voided transactions
    Both | Show both and include voided transactions in totals

  - Reset defaults button — Reset all values to their defaults

- Display tab

  - Date

  - Reconciled Date

  - Num

  - Description

  - Memo

  - Notes — Display the notes if the memo is unavailable

  - Account Name

  - Use Full Account Name

  - Account Code

  - Other Account Name — For multi-split transactions, this parameter should be unticked. See below for more details.

  - Use Full Other Account Name

  - Other Account Code

  - Shares — Display number of shares

  - Price — Display share prices

  - Amount — One of

    None | Do not display Amount
    Single | Single column display
    Double | Two column display

  - Running Balance

  - Totals

  - Sign Reverses — One of

    None | Do not display signs reversed
    Credit Accounts | Reverse amount display for Liability, Payable, Equity, Credit Card and Income accounts
    Income and Expense | Reverse amount display for Income and Expense accounts

  - Reset defaults button Reset all values to their defaults

- General tab

  - Report name — Enter a descriptive name for this report

  - Stylesheet — Select Default, Easy, Footer or Technicolor

  - Start Date — Enter or select a specific Start Date

    or select one of the following named start date options which will be used to determine the start date each time the report is run

    Today | The current date
    Start of this month | First day of the current month
    Start of previous month | First day of the previous month
    Start of current quarter | First day of the current quarterly accounting period
    Start of previous quarter | First day of the previous quarterly accounting period
    Start of this year | First day of the current calendar year
    Start of previous year | First day of the previous calendar year
    Start of accounting period | First day of the accounting period as defined in the global preferences

  - End Date — Enter or select a specific End Date,

    or select one of the following named end date options which will be used to determine the end date each time the report is run

    Today | The current date
    End of this month | Last day of the current month
    End of previous month | Last day of the previous month
    End of current quarter | Last day of the current quarterly accounting period
    End of previous quarter | Last day of the previous quarterly accounting period
    End of this year | Last day of the current calendar year
    End of previous year | Last day of the previous calendar year
    End of accounting period | Last day of the accounting period as defined in the global preferences

  - Style — One of

    Single | Display 1 line
    Multi-Line | Display N lines

    In stable version 2.8.0, the Style option will be renamed to Detail Level and moved to the Display tab.

  - Common Currency — Convert all transactions into a common currency

  - Report's currency — Select the currency to display values

  - Table for Exporting — Formats the table for cut & paste exporting with extra cells

  - Reset defaults button — Reset all values to their defaults

- Sorting tab

  - Primary Key — Primary Sort Key. One of

    None | Do not sort
    Account Name | Sort and subtotal by account name
    Account Code | Sort and subtotal by account code
    Date | Sort by date
    Exact Time | Sort by exact time
    Reconciled Date | Sort by the reconciled date
    Register Order | Sort as within the register
    Other Account Name | Sort by account transferred from/to's name
    Other Account Code | Sort by account transferred from/to's code
    Amount | Sort by amount
    Description | Sort by description
    Number | Sort by check/transaction number
    Memo | Sort by memo

  - Show Full Account Name — Show the full account name for subtotals and subtitles

  - Show Account Code — Show the account code for subtotals and subtitles

  - Primary Subtotal — Subtotal according to the primary key

  - Primary Subtotal for Date Key — Do a date subtotal. Only configurable if primary key is date, exact time or register order. One of None, weekly, monthly, quarterly or yearly

  - Primary Sort Order — One of

    Ascending | Smallest to largest, earliest to latest
    Descending | Largest to smallest, latest to earliest

  - Secondary Key — Secondary Sort Key. Same options as Primary Key

  - Secondary Subtotal — Subtotal according to the secondary key

  - Secondary Subtotal for Date Key — Do a date subtotal. Only configurable if primary key is date, exact time or register order. One of None, weekly, monthly, quarterly or yearly

  - Secondary Sort Order — One of

    Ascending | Smallest to largest, earliest to latest
    Descending | Largest to smallest, latest to earliest

  - Reset defaults button — Reset all values to their defaults

#### Displaying Split Account Details

This is controled by the Style option on the General tab.

In stable version 2.8.0 this option will be renamed to Detail Level on the Display tab.

In Single line mode, there's only one line per transaction. So you can have the account name on one side of the equation and

a. the other account name if there's only one other split in the transaction

or

b. "Split" if there are multiple other splits in the transaction. You can't display multiple "other" account names in one line. There's just no room for it.

In the case of Multi-Line mode, this report uses a completely different concept. For each transaction, every split (both the split in this account and the split(s) in the other account(s) !) is printed on a separate line. And every split really means every split: both the split which belongs in the account being reported and the split(s) in the other account(s) that balance the transaction. So even the most basic transaction, with only two splits (this account and other account) will print two lines in multiline mode.

For a simple transaction like this

Description | Account | Debit | Credit
Cheques Received
"multiple payers" | IncomeAccount |  | £30.00
| BankAccount | £30.00 |

then on a Transaction Report for the bank account the details appear pretty much as above.

For clarity of the accounts, you might enter transactions with multiple splits referring to the same account. For example, the above transaction might well be entered like this

Description | Account | Debit | Credit
Cheques Received
"FirstPayer" | IncomeAccount |  | £10.00
"SecondPayer" | IncomeAccount |  | £20.00
| BankAccount | £30.00 |

When this transaction is printed on the bank account's Transaction Report in Single line mode, then under other account it simply prints the word split instead of the account name.

To display the additional split detail, you need to set Single/Multi-Line to Multi-Line and then tick Display -> Account Name. Do NOT tick Display -> Other Account Name.

You can choose whether or not to turn off the full account name using Display -> Use Full Account Name.

Use Full Other Account Name has no effect in Multi-Line mode.

### Welcome Sample Report

### 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.

### Sample Graphs

### Sample Report with Examples

## Assets & Liabilities

The Assets & Liabilities reports includes the Balance Sheet report, Investment reports and the Net Worth report.

- Advanced Portfolio:

  Columns

  - Account — Stock Account

  - Symbol — Ticker Symbol/Abbreviation as defined in the Security Editor. A report option can suppress this column.

  - Listing — Type as defined in the Security Editor. A report option can suppress this column.

  - Shares — Number of shares (quantity). A report option sets how many decimal places to show. A report option can suppress this column.

  - Price — Unit market price as at report date. A report option can suppress this column.

  - Basis — Cost of all shares acquired by any means, including brokerage fees if the option to include them is checked. Report option Basis calculation method can be set to Average, LIFO or FIFO.

  - Value — Number of shares * Unit market price as at report date

  - Money In — Sum of the cost of stock purchased, excluding stock acquired as part of a Dividend Reinvestment Plan. I.e. External money used to purchase shares.

  - Money Out — Money from selling shares or a spin off transaction.

  - Realized Gain — Money received for selling shares minus basis for shares sold, minus brokerage fees for the sale if the option to include them in basis is checked.

  - Unrealized Gain — Value less Basis for unsold shares

  - Total Gain — Realized Gain + Unrealized Gain

  - Rate of Gain — Total Gain / Money In * 100 (from &app; 2.6.1 onwards)

  - Income — Total of all income transactions associated with a stock account.

    To include income from dividends which are not reinvested (if there is no split to the stock account in the income transaction, the report has no way of associating the income with a particular stock) :

    Ensure there is a dummy transaction split to the stock account with quantity 0, price 1 and value 0 in the dividend transaction. Enter the dummy stock split with no values in the dividend account and it will create the transaction with price 1 even though you cannot see the Price column in that register.

    In GnuCash 2.6.6, this report was modified to simplify the recording of dividend and interest payments. With this change it may not be necessary to include the dummy stock split in the transaction. The report will find income (and expense) transactions that are in the parent account of the stock account being reported on. This is done by looking in the parent account for transactions that have exactly two splits (not counting trading account splits) where the other split is to an income or expense account with the same name as the stock's account.

    For example given an account structure like

                        Assets (type ASSET)
                          Broker (type ASSET)
                            Widget Stock (type STOCK)
                        Income (type INCOME)
                          Dividends (type INCOME)
                            Widget Stock (type INCOME)

    A transaction that debits the "Assets:Broker" account and credits the "Income:Dividends:Widget Stock" account will count as income even though it doesn't have a split with account "Assets:Broker:Widget Stock".

    This only works if the parent account ("Assets:Broker" in this case) is a Bank or Asset account and the Income/Expense account has the same name as the stock account. It won't double count transactions that have a dummy split since they won't have exactly two split transactions.

    It will not work if the income or expense account split is to a subaccount of the account with the same name as the stock account i.e. "Income:Dividends:Widget Stock:Franked"

  - Brokerage Fees — Brokerage Fees

  - Total Return — Total Gain + Income

  - Rate of Return — Total Return / Money In * 100

  Common report options are described in

  Report Specific Options

  - Accounts Tab

    - Include accounts with no shares — Unchecked (default) or checked.

  - Display Tab

    - Show ticker symbols — Checked default) or unchecked. If unchecked, Symbol column will be omitted.

    - Show listings — Checked (default) or unchecked. If unchecked, Listing column (source of shares price quotes) will be omitted.

    - Show number of shares — Checked (default) or unchecked. If unchecked, Shares column will be omitted.

    - Share decimal places — The number of decimal places to show in the number of shares. Default is 2.

    - Show prices — Checked (default) or unchecked. If unchecked, Price column will be omitted.

  - General Tab

    - Price Source — Nearest in time (default) or Most Recent.

    - Basis calculation method — Average (default), FIFO or LIFO.

    - Set preference for price list data — Checked (default): Use price list data. If there is no relevant price list data, transaction prices will be used and there will be a warning. Unchecked: Get prices from stock transactions.

    - How to report brokerage fees — Include in basis (default), Include in gain or Ignore.

- Asset Barchart:

  The Asset Barchart report displays bars that present the value of all assets in a &app; file over time. By default, the report shows all accounts in Accounts Receivable, Current Assets, Fixed Assets, Investments and Special Accounts (if they exist) and it displays monthly bars for the current financial period. This report provides a graphic view of the assets in the file over time.

  Like all the generic reports, the user can assign a title and save the report with it's selected options for re-use later.

  The display is in the form of either a stacked barchart or simple barchart with an option to display a table of the values.

  This report calculates and displays a default of 8 bars or up to 24 separate asset accounts value at the end of the day on several dates through a specified time period. The report automatically selects the most significant accounts to display with all other selected accounts summed as Other.

  The report exploits the outline structure of the chart of accounts to allow the user to select top level accounts and sub-accounts down to a user-selectable depth. Selected sub-accounts below the selected depth are automatically summed up into the next level when it is also selected. The default number of sub-account levels is 2, giving a summary view. Increasing the number of sub-levels increases the detail available to display. It is possible to un-select a higher level account and leave sub-accounts selected to force greater detail to appear in the report.

  By default the report includes all asset accounts and sub-accounts, as well as Imbalance and Orphan Special accounts in whatever currencies or commodities may be present. The report's base currency is the default currency of the &app; file but if the file has data for multiple currencies, then it can be changed to another currency.

  Since each account may be individually selected, the report can be designed to focus on a small subset of data such as current assets or investments.

  The overall interval of the report defaults to start at the start of the current accounting period and to end at the end of the current accounting period. Numerous other starting choices and ending choices are available.

  The first bar shows the selected values at the end of the day on the first date chosen. There are a number of choices for step size from day to year with the default being month. Note that if any step date would fall on the 29th, 30th or 31st in a month that does not have such a date the next interval will be 31 days later. For that step only the date will slip up to 3 days into the following month. This is true for releases at least through 2.4.13. Bug 639049 is open in Bugzilla to modify this behavior.

  Currently, there is no option to start the report on the last day of any period. There is also no option to show beginning balances or end of previous step balances. This makes it difficult to correlate this report to business quarterly reports, for example.

  The Net Worth linechart report, Liability barchart report and Net Worth barchart report are similar except for the graphic type and default account groups selected.

  Other features are customizable in a manner similar to other standard reports.

- Asset Piechart:

- Average Balance:

- 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.

- General Journal:

- General Journal:

- Investment Portfolio: This report summarizes the value of the stocks in the current portfolio.

- Liability Barchart:

- Liability Piechart:

- Net Worth Barchart: Net worth is the difference between the value of assets or liabilities.

- Net Worth Linechart: Net worth plotted over time. Net worth is the difference between the value of assets or liabilities.

- Price Scatterplot:

## Income & Expense

The Income & Expense reports includes the Cash Flow and Income Statement reports.

- Budget Report:

- Cash Flow:

- Equity Statement:

- Expense Barchart:

- Expense Piechart:

- Expense vs Day of Week:

- Income Barchart:

- Income & Expense Chart:

- Income Statement: This report summarizes sources of income and expenditure. (This report was called Profit & Loss in gnucash-1.8.)

- Income Statement:

- Income vs Day of Week:

- Trial Balance: This report summarizes sources of income and expenditure.

## Business Reports

The Business Reports includes Customer and Vendor Reports and Printable Invoices as well as Aging reports.

- Customer Report:

- Easy Invoice:

- Employee Report:

- Fancy Invoice:

- Payable Aging:

- Printable Invoice:

- Receivable Aging:

- Vendor Report:

## Customizing Reports and Graphs

&app; reports have many options for customization. First, run the original report itself. Then, access the report options with the Options button on the toolbar.

Check changed Graphic Engine Options and describe Saving Customized Reports

Many reports share similar sorts of options. Some common ones include:

- Report Name: Set the title of the report. This is also used to print the report for later viewing.

- 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.

- 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.

- 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.

- Show Long Account Names: This option allows displaying either short account names (for example, Power) or long account names (for example, Utilities:Power).

- 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.

- 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.

- Style Sheet: Select a Style Sheet. Style sheets control how reports are displayed. At the moment, there are four style sheets: Default, Easy, Footer and Technicolor. You can customize each of these from the Edit Style Sheets... menu item. This is described in the Changing Style Sheets section.

- Plot Dimensions: There are width and height options for most graphs, which specify the displayed dimensions (in pixels).

- Report Currency: Select the report currency. Generally, values will be converted to this currency for display.

- 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.

- Totals: Charts display totals in the chart legend if this option is selected.

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

- Maximum Bars: Controls the maximum number of bars displayed in a barchart.

- Display Columns: Choose columns to show from the register.

## Printing or Exporting Reports and Graphs

Verify !!! How customize printing with Gnome?

&app; is able to print reports and to export the reports to HTML (web) pages. The Print &app; Document dialog is accessed from the Print button on the Toolbar or go to File 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.

The Print &app; 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.

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.

## Creating Reports and Graphs

This section may need updating !!!

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 &app; source code available.

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 &app; source distribution provides a good example of how reports are developed.

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.

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.