This commit is contained in:
2020-08-21 18:34:46 +00:00
parent a64b34d2d0
commit e1febb3ebb

View File

@@ -4,6 +4,22 @@
REPORTING
TODO:
Plan how it would work, templating engine runs how, what steps lead from render route to produced report?
simlute it on paper before coding it
Find c# versions of all required tools to see if going to need dependency on Node or not
handlebars is a big one
Code minimum effective test as proof of concept, just start with static data, static report stuff and cobbled together render
no database involvement during testing!!
no designer other than vs code statically
just hit a route to trigger a static test then expand from there doing all the trickiest stuff first as proof of concept.
Once it renders a report of each type we need in mock then can actually code
CLIENT UI
At client maybe pick output format first then select report, so can pick HTML to just view immediately, can pick pdf to download or print, can pick csv to export etc
@@ -21,7 +37,10 @@ REPORT TEMPLATE FORMAT
can be subbed at runtime by giving alternate or this will just be the default
defaultData - static data saved with report like a json fragment or something
renderAsType - renderType (pdf, text, csv, etc this way the report is designed specifically for that type and if they want more than one they need to copy and modify)
How to include libs like labels etc?
I guess we have a curated set we include and for security and if they want something else they can just use a CDN script link
Need to vet those I guess
Data
Reports during render can be told to use ayaType and id, dynamic data list object or static data object passed directly into route
@@ -50,6 +69,10 @@ TODO:
Actually, the report itself should contain the chosen localization stuff as it will be generated without a client involvement at times
so the designer would set this, maybe it follows the server or maybe we *do* send a hint but also the report has a default locale if none specified
hard coded
Process:
consolidates the data, report, checks rights, sanitizes report html / css using whatever tool is necessary (client should also do this)
renders document, perhaps in a queue system is best
returns:
like a download route, returns rendered document with correct mime type set
@@ -95,6 +118,7 @@ HTML -> PDF
Headless Chrome
https://github.com/jsreport/jsreport-chrome-pdf
FAST SPEED (according to jsreport docs)
jsreport uses headless chrome by default which has built in pdf from html ability.
they use a NODE library Puppeteer for it, but there is a c# wrapper for .net core linux windows mac: https://github.com/hardkoded/puppeteer-sharp
@@ -119,6 +143,7 @@ HTML -> PDF
https://stackoverflow.com/questions/62042078/puppeteer-sharp-for-server-side-html-to-pdf-conversions
WeasyPrint
https://github.com/jsreport/jsreport-weasyprint-pdf
SLOWEST SPEED
https://github.com/Kozea/WeasyPrint based on python, does it's own rendering doesn't rely on a web browser engine like the rest
free, recommended by wkhtmltopdf author as an alternative
@@ -129,6 +154,7 @@ HTML -> PDF
wkhtmltopdf
https://github.com/jsreport/jsreport-wkhtmltopdf
MEDIUM SPEED
https://wkhtmltopdf.org/downloads.html
Well used, old based on older webkit so doesn't support css3 but likely enough for our purposes
@@ -142,12 +168,23 @@ HTML -> PDF
HTML -> DOCX
This is a possiblity that needs to be researched, instead of pdf go docx which is in theory multi platform and openable on other devices? Not sure
https://github.com/jsreport/jsreport-docx
https://github.com/EricWhiteDev/Open-Xml-PowerTools
HTML -> XLSX
https://github.com/jsreport/jsreport-xlsx
HTML -> TEXT
https://github.com/jsreport/jsreport-html-to-text
https://github.com/jsreport/jsreport-text
TEMPLATE ENGINE
https://github.com/jsreport/jsreport-handlebars
Handlebars by default for jsreport which is easy peasy to work with
PDF META DATA EDITING
https://github.com/jsreport/jsreport-pdf-meta
Render outputs
JSReport renders to different outputs, they call it recipes https://jsreport.net/learn/recipes