Files
raven/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE table layout parent child.ayrt
2021-12-22 18:51:22 +00:00

1 line
5.3 KiB
Plaintext

{"Name":"z_table layout parent child","Active":true,"Notes":"example of displaying a Parent value when the #each references a Child, use a ../ in front of the Property name in the mustaches","Roles":124927,"AType":26,"IncludeWoItemDescendants":false,"Template":"<html>\n<body>\t\n\t<table><!--beginning of your table-->\n\n\t<thead><!-- this indicates start of your table header section -->\n\t\t<tr><!-- this indicates start of one row in your thead -->\n\t\t\t<th>column header 1</th> <!-- The text in <th> elements are bold and centered by default, can also override by setting specifics in your CSS -->\n\t\t\t<th>column header 2</th>\n\t\t\t<th>column header 3</th>\n\t\t\t<th>{{ayT 'PurchaseOrderItemSerialNumbers'}}</th>\n\t\t</tr><!-- this indicates end of that one row in your thead -->\n\t</thead><!-- this indicates end of your table header section -->\n\n\t{{#each ayReportData}}<!-- this #each encompasses the area that repeats for each object (i.e. each PO) in your Sample Data -->\n\t<!-- if want the header repeated for every PO, the #each to encompass the thead area too, otherwise encompass the tbody -->\t\n\t<tbody>\t<!-- this indicates start of your table body section -->\t\n\t\t{{#each Items}} <!-- this #each encompasses the area that repeats for each Child object (i.e. each PO Item) in your Sample Data -->\n\t\t\t<tr><!-- this indicates start of one row in your tbody -->\n\t\t\t\t<td>{{ayT 'PurchaseOrder'}} {{../Serial}}</td> <!-- when the #each references a Child, use a ../ in front of the Property name in the mustaches to display a Parent value -->\n\t\t\t\t<td class=\"fontgreen\">{{ayT 'PurchaseOrderItemPartNumber'}} {{PartNameViz}}</td> <!-- to display a value when the #each references a Child, encompass the Property name in mustaches -->\n\t\t\t\t<td>{{ayT 'PurchaseOrderItemQuantityOrdered'}} {{QuantityOrdered}}</td><!-- The text in <td> elements are regular and left-aligned by default, or set specifics in your CSS -->\n\t\t\t\t<td>{{Serials}}</td><!-- in this specific instance, Serials with an S refers to the serials received for that PO Item -->\n\t\t\t</tr>\n\t\t{{/each}}<!-- this closes the emcompassed area that repeats for each Child object (i.e. each PO Item) in your Sample Data -->\t\t\n\t</tbody><!-- this indicates end of your table body section -->\n\t{{/each}}<!-- this closes the emcompassed area that repeats for each object (i.e. each PO) in your Sample Data -->\n\n\t<tfoot class=\"footertext\"><!-- this applies specific CSS class attributes to all of tfoot and its td's -->\n\t\t<tr>\n\t\t\t<td>footer stuff 1</td>\n\t\t\t<td colspan=\"2\">expands across two columns with or without having to have text</td><!-- this inline colspan spans multiple columns -->\n\t\t\t<td>footer stuff 3</td>\n\t\t</tr>\n\t</tfoot><!-- this indicates end of your table footer section -->\t\n\n\t</table><!-- end of your table-->\t\n\n</body>\n</html>","Style":".singlePage\n{\npage-break-after: always;\n}\n\n.footertext {\n font-size: 14pt;\n font-style: italic;\n background-color: pink;\n}\n\nbody {\n font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif; \n}\n\n.reporttitle { \n margin-bottom: 20pt; \n font-weight: bold; \n font-size: 13pt; \n color: #9e9e9e;\n text-align: center;\n} \n\ntable { \n border-collapse: collapse;\n white-space: pre-wrap;\n width: 100%;\n table-layout: fixed; /* the # of columns set in the first row of the thead will be fixed and applied throughout table and rows */\n }\n\nth {\n border-bottom: solid 1pt #9e9e9e;\n height: 50px;\n font-size: 13pt; \n color: #9e9e9e;\n}\n\ntbody td {\n padding: 10px;\n word-wrap: break-word;\n font-size: 9pt;\n}\n\n\ntbody tr:nth-child(even) {\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\n}\n\n\n.rightlean {\n text-align: right;\n}\n.leftlean {\n text-align: left;\n}\n.centerlean {\n text-align: center;\n}\n\n\n.fontgreen {\n color: green;\n}\n.fontblue {\n color: blue;\n}\n.fontred {\n color:red;\n}\n\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 //see the help documentation for details\n\n await ayGetTranslations([\"PurchaseOrder\", \"PurchaseOrderItemPartNumber\", \"PurchaseOrderItemQuantityOrdered\", \"PurchaseOrderItemSerialNumbers\" ]);\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":"<span style=\"font-size:6pt;width: 94%; text-align:left; \">&nbsp;&nbsp;&nbsp;&nbsp;Todays date:&nbsp; <span class=\"date\"></span>&nbsp; set in PDF Options</span>","FooterTemplate":"<span style=\"font-size:6pt;width: 94%; text-align: right; \">&nbsp; set in PDF Options&nbsp;&nbsp;Page&nbsp;<span class=\"pageNumber\"></span>&nbsp;of&nbsp;<span class=\"totalPages\"></span>&nbsp;&nbsp;&nbsp;&nbsp;</span>","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"15mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000}