Reports

From WHMCS Documentation

Revision as of 15:09, 11 March 2008 by Matt (talk | contribs) (Creating your own Reports)

Existing Reports

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

  • Disk Usage Summary
  • Monthly Orders
  • Top 10 Clients By Income
  • Server Revenue Forecasts
  • Monthly Transactions
  • Sales Tax Liability
  • Daily Performance
  • Recurring Income
  • Yearly Income Report
  • Promotions Usage

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.

All reports are contained within the modules/reports folder, open source, and can 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 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");
# Report Footer Text - this gets displayed below the report table of data
$data["footertext"] = "";
?>