Version 37 (modified by Fran Boon, 10 years ago) ( diff )

Geraldo no longer used

Blueprint for Reporting/Charting

We need to be able to generate Pretty & Informative Reports from the database.

e.g. for BluePrintImpact

These can be implemented as an S3XRC Custom method


We will want to be able to customise reports by allowing the user to filter the data (this could include fields in the resource, components and reference resources)

An example is: eg Code:

Location Filtering

We need to be able to fitler by a location so that it shows data in all locations which are children of that location (eg villages in a district)


For quick visualisations in the browser, we have included jqPlot.

We have included the Healthscapes SaVaGe library to easily output SVG graphs:

T2 includes a basic barchart function:

def barchart(data,width=400,height=15,scale=None,
    if not scale: scale=max([m for n,c,m in data])
    if not scale: return None
    return TABLE(_class='barchart',
           *[TR(TD(n,_width=label_width,_style="text-align: right"),
           _style="vertical-alignment: middle") for n,c,m in data])

Custom s3xrc method

The custom s3xrc Would allow quick visualisations of resources on the server. There would need to be vars specifying which variables go in which axis in each resource.

Report model/view/controller

This module could provide the user with the ability to create and embed graphs in their instance of sahana. The idea is to provide the user with the ability display any set of data; it need not be tied to a resource or may be a more complex combination of variables than provided in the sahana framework. The graphs could be in svg format allowing for interactivity. The files themselves could also be stand alone so that they could be easily exported and saved locally.

The basic workflow would be:

  • Create a graph with a web-form or file upload using report/scatter/create. There numerous settings that could be altered to create different a looks and feel.
    • Or it can be created with a call to the url with the data as vars, such as report/scatter/create?data={"x": [1, 2, 3], "y": [3, 4, 3], "title": "Test Title"}&settings={"width": 300, "height": 200}
  • An entry gets created in the database for the graph. It can be retrieved an and inserted into a web-page in an object or embed tag, such as <object data="/eden/report/scatter/get.svg?id=1" />
    • These could appear inside popups on the map
    • Or, the graphs can be represented without an entry in the database using report/scatter/create?view.svg={"x": [1, 2, 3], "y": [3, 4, 3], "title": "Test Title"}&settings={"width": 300, "height": 200}


We want to be able to provide reports suitable for displaying inside popups on Map Polygons:


For more formal reports (which can also be retrieved via webservices using the PDF representation of the REST Controller), we currently use ReportLab. This also supports Graphics (via PIL)

Other options:


Excel files are currently written using xlwt. Other options:

  • Pod to create Open Document Format


Could be something to use Flash? (although best-avoided, if possible, to minimise client support)

Phase2 version:


Note: See TracWiki for help on using the wiki.