We have provided a framework that lets you create your own reports, requiring some knowledge of PHP. Existing reports are stored in
/app/Reports and there is a folder for each category.
Take an existing report and make a copy under a new name, you can also set up a new category folder if desired.
- Open the newly created report file, and update the
$record->descriptionwith what you are going to call the report and what it will show.
Update the timeframe option, there are the following options:
monthly- Allows selection of data for report for each month.
yearly- Allows selection of data for report for each year.
custom- Allows to choose any window of time for the report as well as all time, defaults to one month from current date but can be overridden by setting $startDate and $endDate (UNIX timestamps).
none- for reports where time options are not needed
- Update the charts option, which lets you define what charts are available to the user when viewing the report. The value is an array of strings, with the first item of the array being the chart that is shown by default when loading the report. There are the following options:
pie- Pie chart, requires just two columns of data.
bar- Bar chart, works with multiple columns of data
column- Column chart, works with multiple columns of data
histogram- Histogram, requires just two columns of data
line- Line graph, requires three columns of data where one column is time-based
area- Area graph, requires three columns of data where one column is time-based
stacked- Stacked Area graph, similar to area graph but the various rows are stacked on top of each other
stepped- Stepped Area graph, similar to area graph but the various rows are stacked on top of each other
geo- Geo graph, requires just two columns of data where one is geographical-based
table- Table, visible on another tab
- If it is a report related to tickets or users, you may wish to show the filtering options, set the
$report->filteringvalue to either '
ticket' or '
user'. If the filtering options is not needed, it should be set to null.
$report->queryto fetch the data required for the report. We use the Eloquent ORM by Laravel, we recommend to read the documentation and view the other reports to get an idea on how it works. You will need to remember to import the model classes, such as
getDatafunction to handle the data returned and convert it to a format that works with Google Charts. Each line in the existing reports are commented to explain what is being done and should help with what you're trying to do.XSS Attacks
Please ensure all output data is passed through the
e(string)for short. Alternatively, if you need to output user-defined HTML use the