Name: opal-reporting
Owner: Open Health Care
Description: null
Created: 2017-05-04 09:10:17.0
Updated: 2017-05-04 09:12:50.0
Pushed: 2018-01-09 09:49:06.0
Homepage: null
Size: 47
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This is reporting - an Opal plugin.
The Opal Reporting plugin provides developers with a highly extensible method of creating downloadable reports in Opal.
This plugin is Alpha software.
Although it aldeady provides significant and useful functionality, it is in active development, and delvelopers should anticipate backwards-incompatible API changes as part of minor (x.VERSION.x) releases.
A report is a cut of data from an Opal application. The reports are downloaded as a zipped file containing one or more csv files.
In this section we walk you through creating a simple Report.
Pip install opal-reporting from github and add it to your INSTALLED_APPS
Create a report object in your {{ application }}/reports.py. This should look something like the below…
s YourFirstReport(Report):
slug = "your-first-report"
display_name = "Your First Report"
description = """Everyone has to have one report that is their first, this one is yours."""
def generate_report_data(self, *args, **kwargs):
return [
ReportFile(
file_name="some_file.txt", file_data=[['hello']]
)
]
Now if you go to “/reporting/#/list” You should see your report listed. Click on this and it should have an option to download your new report.
Add template to your report, for example
s YourFirstReport(Report):
slug = "your-first-report"
display_name = "Your First Report"
description = """Everyone has to have one report that is their first, this ones yours"""
template = "my_template.html"
This allows you to put your own template into the front end instead of the default one.