{"id":28069794,"url":"https://github.com/demisto/sane-reports","last_synced_at":"2025-11-08T03:02:10.775Z","repository":{"id":38418500,"uuid":"62472771","full_name":"demisto/sane-reports","owner":"demisto","description":"Reports library that will keep you sane and not pulling your hair out","archived":false,"fork":false,"pushed_at":"2024-06-16T10:19:51.000Z","size":5970,"stargazers_count":53,"open_issues_count":13,"forks_count":13,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-05-12T19:14:42.627Z","etag":null,"topics":["dashboards","data-visualization","javascript-library","reporting-engine"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/demisto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2016-07-02T22:57:28.000Z","updated_at":"2025-05-08T12:40:21.000Z","dependencies_parsed_at":"2023-01-21T13:02:38.142Z","dependency_job_id":"bd397643-ac74-467a-9821-d8a6a3d310a4","html_url":"https://github.com/demisto/sane-reports","commit_stats":{"total_commits":682,"total_committers":29,"mean_commits":"23.517241379310345","dds":0.7653958944281525,"last_synced_commit":"fb476874757700dc529b85038599f206c620132d"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/demisto%2Fsane-reports","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/demisto%2Fsane-reports/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/demisto%2Fsane-reports/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/demisto%2Fsane-reports/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/demisto","download_url":"https://codeload.github.com/demisto/sane-reports/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253805844,"owners_count":21967054,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dashboards","data-visualization","javascript-library","reporting-engine"],"created_at":"2025-05-12T19:14:51.387Z","updated_at":"2025-10-25T01:32:13.068Z","avatar_url":"https://github.com/demisto.png","language":"JavaScript","readme":"# Sane Reports by [Demisto](https://demisto.com)\n[![CircleCI](https://circleci.com/gh/demisto/sane-reports.svg?style=svg\u0026circle-token=eac6cf719d42f37bfa95f8a33112970fe4799cc5)](https://circleci.com/gh/demisto/sane-reports)\n[![Coverage Status](https://coveralls.io/repos/github/demisto/sane-reports/badge.svg?branch=master\u0026t=C6DzM5)](https://coveralls.io/github/demisto/sane-reports?branch=master)\n\n## Prerequisites\n- Node v10.24.1 (https://tecadmin.net/install-nvm-macos-with-homebrew/)\n- Chromium 86.0.4240.0 or closer version (https://chromium.en.uptodown.com/mac/download/3208047)\n\n## Quick start\n\n**Chromium/Chrome**\n```sh\n$ npm install\n$ npm run make\n$ ./reportsServer templates/test.json dist/test.pdf # for linux users.\n$ ./reportsServer-macos templates/test.json dist/test.pdf # for macOS users.\n$ ./reportsServer-win.exe templates/test.json dist/test.pdf # for windows users.\n```\n\n**PhantomJS**\n```sh\n$ npm install\n$ cd sane-reports\n$ phantomjs reportsServer.js templates/test.json dist/test.pdf\n```\n\nReport will be generated in: `dist/test.pdf`\n\n## Generating dashboard mode (browser) report\n```sh\n$ git clone git@github.com:demisto/sane-reports.git\n$ cd sane-reports\n$ npm install\n$ npm start\n```\nNow open browser at: http://localhost:8082\n\n## Generating PDF report\n```sh\n$ git clone git@github.com:demisto/sane-reports.git\n$ cd sane-reports\n$ npm install\n$ npm run make\n$ npm run production\n$ npm run generate-report\n```\nThis will generate a PDF report in the `dist` folder. The name of the report will start with `report-`.\n\n### Generate report options:\nYou can create PDF report with the following command as well:\n\n#### Chromium/Chrome\n`\n./reportsServer \u003creport_template_file\u003e [\u003coutput_file\u003e \u003cdist_folder\u003e \u003corientation\u003e \u003cresourceTimeout\u003e \u003ctype\u003e \u003cheaderLeftImage\u003e \u003cheaderRightImage\u003e \u003ccustomReportType\u003e \u003cpageSize\u003e \u003cdisableTopHeaders\u003e \u003cchromiumPath\u003e]\n`\n\n#### PhantomJS\n`\nphantomjs reportServer.js \u003creport_template_file\u003e [\u003coutput_file\u003e \u003cdist_folder\u003e \u003corientation\u003e \u003cresourceTimeout\u003e \u003ctype\u003e \u003cheaderLeftImage\u003e \u003cheaderRightImage\u003e \u003ccustomReportType\u003e \u003cpageSize\u003e \u003cdisableTopHeaders\u003e]\n`\n\n- report_template_file: The template of the report (JSON format)\n- output_file: The name of the generated report (leave empty for default name)\n- dist_folder: should be `dist`\n- orientation: The orientation of the report: portrait/landscape (default portrait)\n- resourceTimeout: Timeout for generating the report (default is 4000ms)\n- type: The report type: pdf or csv (default is pdf)\n- headerLeftImage: The image to show at the left side of the report header of each page (base64 or url)\n- headerRightImage: The image to show at the right side of the report header of each page (base64 or url)\n- customReportType: Custom report type if needed. currently not used.\n- pageSize: The report page size to generate. Possible: A4, A3, A5, letter (default A4).\n- disableTopHeaders: true or \"true\" to disable the top headers and show icons in the footer. (default false)\n- chromiumPath: a custom chromium or chrome path. The service searches for installed chromium or chrome by order. Default usage by priority: Chromium -\u003e Google Chrome Stable -\u003e Google Chrome -\u003e the default path '/usr/bin/chromium-browser'.\n\n### Example:\n- npm run make\n- npm run production\n- `./reportsServer-macos templates/incidentDailyReportTempalte.json dist/incidentDailyReportTempalte.pdf dist portrait 4000 pdf '' '' '' A4 '' '/Applications/Chromium.app/Contents/MacOS/Chromium'`\n\n### Running on MacOS Locally:\nYou can use npm script:\n```\nnpm run test:macos\n```\n\n## Debugging\n- Download the [mamba-reports.patch](https://github.com/demisto/sane-reports/files/7072628/mamba-reports.patch.txt)\n- Apply the patch (In WebStorm: git -\u003e patch -\u003e apply patch...)\n- Debug the server and add a breakpoint in the beginning of the method `servicereport.go/generatePdfReport`\n- genereta a PDF report from the UI (web-client)\n- when it stops on the breakpoint:\n  - refresh the files in `Debug/lib/temp` (right click -\u003e reload from disk)\n  - copy the last json content from the server folder to `incidentDailyReportTemplate.json`\n  - while the project is running `(npm start)` the page will be auto-reloaded at `localhost:8082`\n\nTo debug the automation/docker image behind sane pdf reports, you can use your own automation with the `reports.pdf.script` setting (use in the troubleshooting tab).\n\n\u003e Alternative: also possible to change the docker image at the automation settings (show filter deprecated automations to see it)\n\u003e ![screenshot](https://user-images.githubusercontent.com/89729679/153238994-71864559-fe3e-43cb-a8d6-aa5c775ae1bd.png)\n\n## Demo\nReports templates (JSON) examples can be found in the [templates](https://github.com/demisto/sane-reports/blob/master/templates) folder.\n\nExample reports outputs can be found in the [examples](https://github.com/demisto/sane-reports/blob/master/examples) folder.\n\n## Create your own report template\nYou can edit existing report templates or create your own template.\nReport templates are created in JSON format and includes sections.\nSections are ordered according to their row and column positions. \n\n**Section types**: Header, Divider, Date, Image, JSON, Markdown, Table, Text, Bar Chart, Line Chart, Pie Chart, HTML, List, Grouped List, Items Section.\n\nEach section can have its own style (camled case css style: font-size -\u003e fontSize).\n##### Important notice:\n**HTML sections use `dangerouslySetInnerHTML` to set the given text as html. This method may cause a security risk, so before using, please validate the source of the text, and use with cautious at your own risk.**\n\n## Contributor License Agreement\nContributions are welcome and appreciated. To contribute follow the [Quick Start](#quick-start) section and submit a PR. \n\nBefore merging any PRs, we need all contributors to sign a contributor license agreement. By signing a contributor license agreement, we ensure that the community is free to use your contributions.\n\nWhen you open a new pull request, a bot will evaluate whether you have signed the CLA. If required, the bot will comment on the pull request, including a link to accept the agreement. The CLA document is also available for review as a [PDF](https://github.com/demisto/content/blob/master/docs/cla.pdf).\n\n## License\ndemisto/sane-reports is licensed under the [Apache License 2.0](https://github.com/demisto/sane-reports/blob/master/LICENSE)\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdemisto%2Fsane-reports","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdemisto%2Fsane-reports","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdemisto%2Fsane-reports/lists"}