This commit is contained in:
2020-09-09 21:35:56 +00:00
parent 46a2ceb05b
commit 76413455f2

View File

@@ -1 +1 @@
{"Name":"EXAMPLE API use and meta data","Active":true,"Notes":"","Roles":124927,"ObjectType":2,"Template":"<html>\n\n<body>\n\t<h2>Example: Meta data and API usage</h2>\n\t<p>See help documentation for details</p>\n\t\n\t<div>\n\t\t<h4>ayServerMetaData</h4>\n\t\t{{ ayJSON ayServerMetaData }}\n\t</div>\n\n\t<div>\n\t\t<h4>ayClientMetaData</h4>\n\t\t{{ ayJSON ayClientMetaData }}\n\t</div>\n\n\t<div>\n\t\t<h4>ayReportMetaData</h4>\n\t\t{{ ayJSON ayReportMetaData }}\n\t</div>\n\n\n\t<div>\n\t\t<h4>myData</h4>\n\t\t<h5>(Fetched dynamically from API route <strong>enum-list/list/AyaType</strong>)</h5>\n\t\t{{ ayJSON myData }}\n\t</div>\n\n\t<div>\n\t\t<h4>ayReportData</h4>\n\t\t{{#each ayReportData}}\n\t\t<h2>{{ Name }}</h2>\n\t\t<div>Notes: <span class=\"example\">{{ Notes }}</span></div>\n\t\t{{/each}}\n\t</div>\n</body>\n\n</html>","Style":".example {\n color: blue;\n}","JsPrerender":"async function ayPrepareData(reportData) {\n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders \n\n //Example of using API GET method to fetch data from API server and make it available to the report template\n let route=`${reportData.ayServerMetaData.ayApiUrl}server-info`;\n\n //Put the data into the main report data object so it's available to the template\n reportData.myData={ServerInfo:await ayGetFromAPI(route, reportData.ayClientMetaData.Authorization)};\n\n //Example API POST method to fetch data from api server\n route=`${reportData.ayServerMetaData.ayApiUrl}search`;\n let searchPostData={phrase: \"Fresh\"};\n reportData.myData.SearchResults=await ayPostToAPI(route, searchPostData);\n\n return reportData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\n//https://handlebarsjs.com/guide/#custom-helpers\nHandlebars.registerHelper('loud', function (aString) {\n return aString.toUpperCase()\n})","RenderType":0}
{"Name":"EXAMPLE API use and meta data","Active":true,"Notes":"","Roles":124927,"ObjectType":2,"Template":"<html>\n\n<body>\n\t<h2>Example: Meta data and API usage</h2>\n\t<p>See help documentation for details</p>\n\t\n\t<div>\n\t\t<h4>ayServerMetaData</h4>\n\t\t{{ ayJSON ayServerMetaData }}\n\t</div>\n\n\t<div>\n\t\t<h4>ayClientMetaData</h4>\n\t\t{{ ayJSON ayClientMetaData }}\n\t</div>\n\n\t<div>\n\t\t<h4>ayReportMetaData</h4>\n\t\t{{ ayJSON ayReportMetaData }}\n\t</div>\n\n\n\t<div>\n\t\t<h4>myData</h4>\n\t\t<h5>(Fetched dynamically from API route <strong>enum-list/list/AyaType</strong>)</h5>\n\t\t{{ ayJSON myData }}\n\t</div>\n\n\t<div>\n\t\t<h4>ayReportData</h4>\n\t\t{{#each ayReportData}}\n\t\t<h2>{{ Name }}</h2>\n\t\t<div>Notes: <span class=\"example\">{{ Notes }}</span></div>\n\t\t{{/each}}\n\t</div>\n</body>\n\n</html>","Style":".example {\n color: blue;\n}","JsPrerender":"async function ayPrepareData(reportData) {\n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders \n\n //Example of using API GET method to fetch data from API server and make it available to the report template\n\n //Put the data into the main report data object so it's available to the template\n reportData.myData={ServerInfo:await ayGetFromAPI(\"server-info\")};\n\n //Example API POST method to fetch data from api server\n let searchPostData={phrase: \"Fresh\"};\n reportData.myData.SearchResults=await ayPostToAPI(\"search\", searchPostData);\n\n return reportData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\n//https://handlebarsjs.com/guide/#custom-helpers\nHandlebars.registerHelper('loud', function (aString) {\n return aString.toUpperCase()\n})","RenderType":0}