{"Name":"109x EXAMPLE PO API use and meta data","Active":true,"Notes":"","Roles":124927,"AType":26,"IncludeWoItemDescendants":false,"Template":"\n\n\n\t

Example: Meta data and API usage

\n\t

See help documentation for further details

\n\t\n\t
\n\t\t

ayServerMetaData - from the database

\n\t\t

If specify only the ayServerMetaData between mustashes, displays all this info:

\n\t\t

{{ ayJSON ayServerMetaData }}

\n\t\t\n\t
\n\t
\n\n\t
\n\t\t

ayClientMetaData - from the web browser you have used for this session

\n\t\t

If only specify ayClientMetaData between the mustaches then displays all this info (keys and values):

\n\t\t

{{ ayJSON ayClientMetaData }}

\n\t\t\n\t
\n\t
\n\n\t
\t\t\n\t\t

ayReportMetaData - from this report template

\n\t\t

If only specify ayReportMetaData between the mustashes then displays all this info (keys and values including array values):

\n\t\t

{{ ayJSON ayReportMetaData }}

\n\t\t\n\t
\n\t
\n\n\t
\n\t\t

myData - Fetched dynamically from API route enum-list/list/AyaType using report template's Prepare

\n\t\t

In this case, myData includes ServerInfo AND SearchResults

\n\t\t

specifically, Prepare searches for the text \"purple\" in any object in the database and returns....\n\t\t

If only specify myData (the name given via Prepare in this report template) between mustashes then displays all this info:

\n\t\t

{{ ayJSON myData }}

\n\t\t\n\t
\n\t
\n\t\n\t
\n\t\t

ayReportData - to display the PO Number value and the PO Notes value for each PO in the list:

\n\t\t{{#each ayReportData}}\n\t\t

PO#: {{ Serial }}

\n\t\t
Notes: {{ Notes }}
\n\t\t{{/each}}\n\t
\n\n\n","Style":".bluefont {\n color: blue;\n}\n\n.greenfont {\n color: green;\n}\n\nul[title]::before {\n content: attr(title);\n /* then add some nice styling as needed, eg: */\n font-weight: bold;\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: \"Purple\"};\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,"HeaderTemplate":null,"FooterTemplate":null,"DisplayHeaderFooter":false,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"15mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":false,"Scale":1.00000}