What is a report?

A Report, in Hybiscus terms, is a collection of components defined through the schema. For a quick example, refer to the Creating a report section, where you can see a report is simply a schema in which you add a number of components that populate your report.

Components

Components are the various elements that make up your report, such as images, tables, cards, sections, etc. They are also defined through a simple schema, which you add as a series of objects to your report schema.

Configuration

The Report schema takes two configuration keys, options and config. The options key is an object which specifies content for some of the fields in the report. The config key is another object for specifying various configuration parameters.

Example schema

{
    "type": "Report",
    "options": {
        "report_title": "The report",
        "report_byline": "Yet another byline",
        "version_number": "0.1b",
        "logo_url": "https://hybiscus.dev/public/public/docs/Wordmark.svg"
    },
    "config": {
        "enable_multi_page": true,
        "palette": "default",
        "typography": "default"
    },
    "components": []
}

Options

The following options can be specified in the options object:

KeyDescription
options.report_titleThe title of the report which appears at the top.
options.logo_urlURL to an image to use as a logo in place of the report title. Please note this is only supported on premium plans. See here for more details.
options.report_bylineA smaller byline which appears underneath the report title.
options.version_numberOptional. A version number which can be placed on the report.
options.enable_headerOptional. Whether to include the header at the top of the PDF. Defaults to true. Please note this is only supported on premium plans. See here for more details.
config.landscapeOptional. Whether to generate landscape PDFs. Defaults to false.
config.colour_themeOptional. The colour palette theme to apply to the report. See Themes for more details.
config.typography_themeOptional. The typography theme to apply to the report. See Themes for more details.
config.n_pagesDeprecated. The number of pages expected in your report. Please note the Free trial only supports single-page PDF reports. This option is deprecated. Please use config.enable_multi_page instead.
config.enable_multi_pageOptional. Set this to true to build multi-page PDF reports. Defaults to false. Please note the Free trial only supports single-page PDF reports. See here for more details.
config.enable_paginationOptional. Enables pagination at the bottom of the pages. Only applicable to multi-page PDF reports. Defaults to false.
config.cloud_storage.s3Optional. Pre-signed AWS S3 URL for uploading PDF directly to. Please note this is only supported on premium plans. See here for more details.
config.cloud_storage.azure_blob_storageOptional. Pre-signed Azure Blob Storage URL for uploading PDF directly to. Please note this is only supported on premium plans. See here for more details.
config.cloud_storage.google_cloud_storageOptional. Pre-signed Google Cloud Storage URL for uploading PDF directly to. Please note this is only supported on premium plans. See here for more details.
config.webhooksOptional. See the webhooks page for more details.
componentsThe list of components to add to the report.

Custom logo

The report title text can be replaced with a custom logo, that is provided by a publically accessible URL. This URL should point towards an image of format JPG, PNG, or SVG. When the options.logo_url key is set, the options.report_title option is ignored.

Setting a custom logo is only supported with a paid plan. See here for more details.

Cloud storage upload

For more details on uploading your PDF report directly to a cloud storage provider, see here.

Multi-page PDF reports

In cases where you need to add more components that can fit in a single page, you will need to set config.enable_multi_page to true. To generate multi-page PDF reports, you will need a premium plan. The number of pages that will be generated in a single PDF report will be automatically limited by your plan.

Previously, users needed to set config.n_pages to a value greater than 1. This config option still exists, however it is no longer required.

For multi-page PDF reports, you can also enable pagination at the bottom using the config.enable_pagination option.

Missing something?

Hybiscus is continuously improving and adding new features. If you think we are missing a critical feature, please do not hesitate to contact us and offer your feedback at info@hybiscus.dev