Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to create and export reports as PDF #834

Closed
wants to merge 18 commits into from

Conversation

axpatito
Copy link

Hi everyone,

First of all @To-om this is my first Scala PR so pls be gentle :)

This PR implements the following process:

  1. Migrates DB to generate a case_report model with a default empty report.
  2. Adds an admin menu to modify the default report. (The report modal windows has an instance of the js case class, so all of those objects and attributes are available to use in the final report)
  3. Adds a button on the UI when the case is closed to generate report.
  4. The report button generates a pop up windows that reads the report generated in step 2 and renders it on screen.
  5. jspdf (https://github.com/MrRio/jsPDF) is added as a dependency to render such content in a downloadable PDF.

ATM it is only possible to edit and use the default case_report (read below for next steps).

Also, tons of things can be done with jsPDF, so I was thinking on sharing a couple of templates. The base HTML template I'm using in the example is at https://gist.github.com/axpatito/082837b3053788218092ac47d56992f8

Screenshots:
Steps 1 and 2

image

Step 3
image

Step 4
image
image

Step 5
image

Why was it implemented like this?

The idea behind this PR is to be able to have and edit multiple report templates by admins, and give the analysts the posibility to choose one of those templates.

To do:

  1. Document the javascript variables that are available to the report
  2. Add to the admin form the possibility to create new case_report templates.
  3. Add the ability to edit those templates.
  4. Add a dropbox to the reports modal window to select the type of report.

@axpatito axpatito changed the title Add tha ability to create and export reports as PDF Add the ability to create and export reports as PDF Dec 17, 2018
@axpatito axpatito changed the base branch from master to develop December 20, 2018 18:05
@axpatito
Copy link
Author

I did not see #678

I believe this PR implements the same functionality.

Closing it.

@axpatito axpatito closed this Dec 20, 2018
@crackytsi
Copy link

But i think only your pr supports pdf... :(

@nadouani
Copy link
Contributor

I think we need a mix of them and some additions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants