-
Notifications
You must be signed in to change notification settings - Fork 0
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
Report Generation #20
Comments
There are three modules for Drupal 8 which allow creating pdf from content:
|
I had a look at those three modules @fgeyer16 suggested:
I would suggest using Entity print and include all dynamic content (like the map compoment) as screenshots. Alternatively I will have a look at athenapdf (https://github.com/arachnys/athenapdf), which is a pdf service that should work as a Docker image. |
Report generation has now high priority as it's "show-stopper" feature for CSIS v1 and can be implemented even if no additional data (e.g. from impact calculation) is yet available. Imho the following step are required:
|
I added fields to the summary view mode of GL-Step and Study group. So for now all Content of type "Report Image" which is related to a Step or a Study is shown on the Summary tabs. |
@fgeyer16 What we still need is
|
I've installed entity print, but the result is not what I've expected. That's the Assess Risk & Impact Summary Page including report images from MCDA: And that's what entity print generates: I've set permission on almost any entities rendered in the summary view (e.g. EU-GL: Use all print engines: Authenticated user) but that didn't help. According to the module description no separate PDF Engine is required for Drupal 8. However the documentation says that Dompdf has to be installed (not clear if this required for Drupal 7 or 8) as opposed to the Module description which requires wkhtmltopdf for Drupal 7. I tried to install Dompdf, but it failed with the following error:
But as PDF generation as such works, I'm not sure if using another (?) PDF engine would solve the problem. |
@p-a-s-c-a-l In the csis-helpers Module that button could then trigger the generation of the screenshot and create a Report image entity via JSON:API + then link that created Report image to the corresponding Group (this is already done, since it wasn't much work). It seems like you already managed to create the screenshot and post the Report image in your Scenario analysis app. I can now try to extract the necessary code from there and add it to the csis-helpers Module. |
@patrickkaleta
Any idea what's wrong with the entity print module? I've tested it only in my local instance. I can make it available on CSIS. |
@p-a-s-c-a-l Regarding the entity print module, I will have a look at it in my local instance as well (check which PDF engine works best) and talk to the guy responsible for setting up entity print in a different Drupal 8 project. On the CSIS module-page I can already see that the entity print module is available, it only needs to be installed (activated), so I don't think you need to do anything at the moment. |
@p-a-s-c-a-l Then you can arrange the fields on the PDF view mode. To copy an existing view mode first set Layout for Gl-step to none
I installed entity print on my localsystem and dompdf was installed automatically by composer with its dependencies without an error I think composer was confused when you tried to install it a second time. From the log it looks like as if you (or composer) tried to get dompdf 0.8.0 while dompdf 0.8.3 was already installed So composer could not resolve dependencies. |
Thanks, I'll give it a try. Regarding dompdf, you'r right, it's automatically installed. :-) |
@p-a-s-c-a-l , @fgeyer16 Installing TCPDF (v1) via "composer require tecnickcom/tcpdf ~6" worked fine and a pdf is generated. But I noticed that it has some problems when the format of the images is set to "Responsive image". In that case no image is printed onto the pdf. Using "Image" as the format works. Installing PHP Wkhtmltopdf worked with Composer:
Binary location has to be set to "/app/vendor/bin/wkhtmltopdf-amd64". |
I've created the PDF View for Assess Risk and Impact Summary and PDF creation works without the need to install additional modules:5.Assess.Risk.and.Impact.pdf The PDF doesn't look very nice yet, but I think this can be improved by configuring additional PDF Views, e.g. for Taxonomy Terms and Report Images. There also a possibility to style PDF with custom CSS. BTW @DenoBeno what about the availability Alejandro for developing some CSS styles for the CSIS in general? |
Display of Data Package could be improved in Study/Summary, the identifier shouldn't be shown so prominently. This is related to #52 (comment) |
Minor Issue: Scenario Analysis Report images are only relevant in RA/IA step, so the report image category "scenario analysis" should not be should be shown in the other Summary Views. @fgeyer16 any idea how this could be easily resolved? |
I altered the corresponding display to show the title and below that the identifier (in a less prominent way). |
Basic Report Generation Functionality implemented. |
Generate PDFs out of a Drupal Page either using a special Drupal Module (if available) or use some external libraries like Jasper Reports and fetch the study data from the REST API.
Important: All information needed to generate a report should reside in the Group Type "Study".
The text was updated successfully, but these errors were encountered: