From a64b34d2d0a0e7cccafad43278cd26ce648732a5 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 21 Aug 2020 17:55:21 +0000 Subject: [PATCH] --- ayanova/devdocs/todo.txt | 69 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 2 deletions(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 6e73088c..3c881d30 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -4,6 +4,62 @@ REPORTING +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 + + + +REPORT TEMPLATE FORMAT + Report template is a db stored object with fields relating to various bits of the report design: + content - the html markup for the report + css - css style to apply to report + script - javascript methods to use with report + defaultlocale - default locale to render from + defaultDataAyType - default object type for this report when it's intended to report directly off an object + i.e. Widget type so all the report requires is an ID to render and it will fetch that and report it + defaultDataList - default dataListOptions values (saved datalist?) + 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) + + + Data + Reports during render can be told to use ayaType and id, dynamic data list object or static data object passed directly into route + priority is aytype, direct data then datalist + can pass in a datalistoptions or actual data during render or if not specified then it looks to it's defaultDataList first, then to it's defaultData + if no data source specified then it could be just a blank template form for hand filling or something so just print it anyway + + + + +TODO: + Render route api + + route: + report/render + parameters: + reporttemplateid + (any value in template having dynamic option? or just predefined?) + dataObjectId (if reporting directly off an object type then this is the id of the object to fetch) + dataListOptions object (optional, overrides data) + data (optional, json format, overriden by dataList if specified instead) + render (optional, defaults to default PDF renderer but can support other kinds, should support more than one of same kind i.e. pdf-chrome, pdf-weasy) + enum type renderType + pdf-chrome, pdf-weasy, text, excel, docx, html + localeHint (some kind of locale hint as to how to process dates and stuff or maybe this is in the report itself) + 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 + returns: + like a download route, returns rendered document with correct mime type set + + report object + Mix of javascript, html and css and some header shit + Columns: + id, content, css, js, version?(need version for future proofing when changes to designer or system ensue), + + + COMMERCIAL OPTIONS =-=-=-=-=-=-=-=-=- @@ -27,6 +83,7 @@ I will use the Monaco editor which is what vscode uses, here is a Vue wrapper: RENDER Going to need to render at the server, possibly from data passed from teh client to the server or generated AT the server in the case of notification deliver reports (Localization is a "black hole" issue if rendered AT the server) +Need to queue rendering, can't just spin up endless converters for every report JSReport renders at server and returns result to client, the API docs show pretty clearly how this happens: https://jsreport.net/learn/api @@ -48,10 +105,18 @@ HTML -> PDF someone said that another pdf tool can be used to set those post processing but fuckery abounds other solutions below apparently don't have this issue. Even jsreport has listed workarounds and tools to resolve this + Update: apparently there are ways: + https://stackoverflow.com/questions/44575628/alter-the-default-header-footer-when-printing-to-pdf?noredirect=1&lq=1 + see last comment seems relevant, also other linked cases all mention various things. Finally, could use a pdf writer tool to post process maybe. - There seem to be many potential issues with missing libraries, rights and sandbox and etc etc etc on linux - + There seem to be many potential issues with missing libraries, rights and sandbox and etc etc etc on linux These things kind of turned me off this a bit, it's not plug and play and simple + + + LINKS: + https://github.com/hardkoded/puppeteer-sharp + https://stackoverflow.com/search?q=puppeteer-sharp + https://stackoverflow.com/questions/62042078/puppeteer-sharp-for-server-side-html-to-pdf-conversions WeasyPrint SLOWEST SPEED