| 58 | | === 2. Tworzenie szablonu Flexy dla raportu === #tworzenie_szablon |
| | 58 | === 2.2. Tworzenie szablonu Flexy dla raportu === #tworzenie_szablon |
| | 59 | |
| | 60 | Skoro posiadamy już raport SQL teraz należy utworzyć szablon. |
| | 61 | Czym jest szablon? |
| | 62 | Otóż jest to plik z rozszerzeniem '''.html''', którego przykładowa zawartość wygląda następująco: |
| | 63 | {{{ <style> |
| | 64 | TABLE .ReportTable TD { |
| | 65 | font-size: 12px; |
| | 66 | } |
| | 67 | |
| | 68 | TD.printLabel { |
| | 69 | font-size: 12px; |
| | 70 | vertical-align: top; |
| | 71 | font-style: italic; |
| | 72 | border-bottom: 1px solid grey; |
| | 73 | } |
| | 74 | |
| | 75 | TD.printData { |
| | 76 | font-size: 12px; |
| | 77 | vertical-align: top; |
| | 78 | border-bottom: 1px solid grey; |
| | 79 | } |
| | 80 | |
| | 81 | .printHeader { |
| | 82 | font-size: 16px; |
| | 83 | font-weight: bold; |
| | 84 | margin-bottom: 10px; |
| | 85 | } |
| | 86 | |
| | 87 | .parag { |
| | 88 | text-indent: 20px; |
| | 89 | } |
| | 90 | </style> |
| | 91 | <div style="margin-left:20px;"> |
| | 92 | |
| | 93 | <p class="printHeader" style="margin-top: 10px;">Temat</p> |
| | 94 | {resultQueries[0][0][dscrpt]} |
| | 95 | |
| | 96 | <p class="printHeader" style="margin-top: 10px;">Treść</p> |
| | 97 | {resultQueries[0][0][conten]:h} |
| | 98 | |
| | 99 | <p class="printHeader" style="margin-top: 10px;">Załączniki</p> |
| | 100 | <ul style="list-style-type:none;"> |
| | 101 | {foreach:resultQueries[2],k,v} |
| | 102 | <li style="font-size:12px;"> - {v[filenm]}<li> |
| | 103 | {end:} |
| | 104 | </ul> |
| | 105 | |
| | 106 | <p class="printHeader" style="margin-top: 10px;">Komentarze</p> |
| | 107 | <ul style="list-style-type:none;"> |
| | 108 | {foreach:resultQueries[1],k,v} |
| | 109 | <li><i>{v[addtxt]} {v[adddat]}</i><BR>{v[commnt]:h}<li> |
| | 110 | {end:} |
| | 111 | </ul> |
| | 112 | |
| | 113 | <table class="RaportTable RaportTable2" style="margin-top:20px; background-color: white; width: 100%" border=0 cellpadding=1 cellspacing=2> |
| | 114 | <tr> |
| | 115 | <td class="printLabel">Dokument od:</td> |
| | 116 | <td class="printData">{resultQueries[0][0][srctxt]}</td> |
| | 117 | <td class="printLabel">Dokument do:</td> |
| | 118 | <td class="printData">{resultQueries[0][0][trgtxt]}</td> |
| | 119 | </tr> |
| | 120 | <tr> |
| | 121 | <td class="printLabel">Klient:</td> |
| | 122 | <td class="printData">{resultQueries[0][0][cname_]}</td> |
| | 123 | <td class="printLabel">Numer sprawy:</td> |
| | 124 | <td class="printData">{resultQueries[0][0][symbol]}</td> |
| | 125 | </tr> |
| | 126 | </table> |
| | 127 | |
| | 128 | </div> |
| | 129 | }}} |
| | 130 | |
| | 131 | Należy zwrócić uwagę, że nie ma tutaj definicji typowych dla pliku html, jak ''<html>, <head>, <body>, <!DOCTYPE...>''. Jest niejako tylko czysta treść. |