FAQ Q298: I need to create a highly customized report not supported by Planyo. What are my options?
Sezione: Integrations with other apps and data import/export
Planyo offers a wide range of reports which can be created, mostly in form of a listing of items such as reservations, additional products, payments etc. The reports are highly customizable, including things such as number of rows per reservation (e.g. you can have one row per person) or ability to include only very specific rows (you can use conditional statements to exclude rows based on your logic). However, in some cases, there may be a need to create a very specialized report which Planyo doesn't support. In such case we offer an option to call a script on your server which processes the data for given period and report settings (filters etc.) and returns the report in form of HTML code. Such report can then be downloaded in planyo as a PDF, or viewed in the planyo backend.
The report type
Custom (callback URL on your server) can be also used to create custom backend pages which can display any content you like. The data for the content can come from the reservation listing sent to the script by planyo, or you can use the API to pull any other data from Planyo. If you don't need detailed reservation listing to be POSTed to your script, set the option
Data rows to
Reservation data not sent. This will result in a faster execution time. Otherwise you can decide whether planyo should post a reservation listing for arrivals within specific period, or for reservations created within specific period.
Whenever the report needs to be generated, planyo will call the URL specified by you and will post the following parameters to your URL:
- data - a json-encoded array of reservations. This parameter is not passed if you chose the option reservation data not sent
- from, to - timestamp of the start and end dates of the report
- resource_id - resource ID to be included in the report (if specified in the settings)
- resource_filter_name, resource_filter_value - custom resource property and its value used to filter the resources which should be included in the report (if set)
- form_item_filter_name, form_item_filter_value - if set in the settings, this is the form item filter
- required_status - status filter (see this page for the numeric values used for statuses)
- color_filter - color filter, if set in the report settings
- sort_field - sort field to be used by the report
- agent_filter - agent filter, if set in the report settings
- site_id - site ID for the report (or Mxxx for a metasite)
The output of your script should be HTML code. This will be converted by Planyo to the PDF format if the PDF download button is pressed on the report page.