Reports

From WHMCS Documentation

Revision as of 10:21, 2 January 2013 by John (talk | contribs) (Creating your own Reports)

Existing Reports

WHMCS comes with a selection of reports by default. These include:

  • Aging Invoices
  • Annual Income Report
  • Client Statement
  • Daily Performance
  • Disk Usage Summary
  • Income Forecast
  • Monthly Orders
  • Monthly Transactions
  • Promotions Usage
  • Sales by Product
  • Sales Tax Liability
  • Server Revenue Forecasts
  • Support Ticket Replies
  • Ticket Ratings Reviewer
  • Top 10 Clients by Income

There are also a selection of graphs which give a visual overview including:

  • Account Status Summary
  • Aging Invoices
  • Domain Status Summary
  • Monthly Income
  • Monthly New Orders Income
  • Monthly Signups
  • Staff Ticket Ratings
  • Ticket Rating Totals

To view any of these reports, simply click the Reports button on the main menu and then choose the report you wish to view from the list. The output of every report can be downloaded in CSV format and is available in a printer friendly format. To access this simply click the appropriate link in the Tools section at the bottom of the report.

All reports are contained within the modules/reports folder, are open source, and can therefore be edited and modified to fit your needs.

Creating your own Reports

With the modular reporting system WHMCS uses, it is easy to add your own reports into the system to generate the statistical information you need.

To create your own report, you should begin by looking at the format of a report module in one of the existing reports. These can be found in "modules/reports". The report name you choose must be unique, and should be all lowercase, containing only letters & numbers (a-z, 0-9), always starting with a letter.

The format with some descriptions is as follows:

<?php

# The title of your report
$reportdata["title"] = "";

# The description of your report
$reportdata["description"] = "";

# Header text - this gets displayed above the report table of data
$reportdata["headertext"] = "";

# Report Table of Data Column Headings - should be an array of values
$reportdata["tableheadings"] = array("Column 1","Column 2","Column 3");

# Report Table Values - one of these lines for each row you want in the table
# should be an array of values to match the column headings
$reportdata["tablevalues"][] = array("Data 1","Data 2","Data 3");
$reportdata["tablevalues"][] = array("Data 1","Data 2","Data 3");
$reportdata["tablevalues"][] = array("Data 1","Data 2","Data 3");

# Report Footer Text - this gets displayed below the report table of data
$data["footertext"] = "";

?>