Project

General

Profile

innhan_03042023.txt

Luc Tran Van, 04/03/2023 10:07 AM

 
1
UPDATE CM_REPORT_TEMPLATE_DETAIL SET REPORT_TEMPLATE_DETAIL_CONTENT = N'<style type="text/css">
2
    * {
3
        font-family: Arial, Helvetica, sans-serif;
4
    }
5
    body {
6
        page-break-inside: auto
7
    }
8
    table {
9
        page-break-inside: avoid;
10
        page-break-after: auto;
11
        width: 100%;
12
        height: 100%;
13
        box-sizing: border-box;
14
        padding: 1.2mm 1.2mm 1.2mm 1.2mm;
15
        display: inline-block;
16
        border: 0;
17
    }
18
    table[border] {
19
        border-collapse: collapse;
20
    }
21
    tbody {
22
        display: table;
23
        width: 100%;
24
        height: 100%;
25
        border: black;
26
    }
27
    img {
28
        vertical-align: middle;
29
        border-style: none;
30
        width: 10mm !important;
31
        height: 10mm !important;
32
    }
33
    html,
34
    body {
35
        margin: 0;
36
        padding: 0;
37
    }
38
</style> 
39
<body>
40
    <div style="flex-wrap: wrap;">
41
        <p>{table1.TableStart.GroupByTable[ROW]}</p>
42
        <table align="left" border="1">
43
            <tbody>
44
                <tr>
45
                    <td rowspan="2" style="text-align: center; width:10mm">
46
                        QRCode{{table1.ASSET_CODE}}</td>
47
                    <td style="padding-left: 1mm;width: 22%;"><span style="font-size: 8px;">Mã TS</span></td>
48
                    <td class="custom-code" style="padding-left: 1mm;width: 88%;"><span style="font-size: 10px; word-break: break-word;">{table1.ASSET_CODE}</span></td>
49
                </tr>
50
                <tr>
51
                    <td style="padding-left: 1mm; width: 22%;"><span style="font-size: 8px;">Tên TS</span></td>
52
                    <td style="padding-left: 1mm;width: 88%;"><span style="font-size: 8px; word-break: break-word;">{table1.ASSET_NAME}</span></td>
53
                </tr>
54
                <tr>                   
55
                    <td class="custom" colspan="3" style="padding-left: 1mm; text-align: center;"><span style="word-break: break-word; ">{table1.DVSD}</span></td>
56
                </tr>
57
            </tbody>
58
        </table>
59
        <p>{table1.TableEnd}</p>
60
    </div>
61
</body>
62
<script type="text/javascript" defer>
63
    window.addEventListener("DOMContentLoaded", (event) => {
64
        const lstTdCustomElement = document.querySelectorAll(".custom-code span");
65
        lstTdCustomElement.forEach((item, index) => {
66
            const getTextContentTd = item.textContent;
67
            if (getTextContentTd.length > 25) {
68
                item.style.fontSize = "6px";
69
            }else if (getTextContentTd.length > 22) {
70
                item.style.fontSize = "7px";
71
            }else if (getTextContentTd.length > 19) {
72
                item.style.fontSize = "8px";
73
            }else if (getTextContentTd.length > 18) {
74
                item.style.fontSize = "9px";
75
            } else {
76
                item.style.fontSize = "10px";
77
            }
78
        })
79
    });
80
    window.addEventListener("DOMContentLoaded", (event) => {
81
        const lstTdCustomElement = document.querySelectorAll(".custom span");
82
        lstTdCustomElement.forEach((item, index) => {
83
            const getTextContentTd = item.textContent;
84
            if (getTextContentTd.length > 70) {
85
                item.style.fontSize = "3px";
86
            } else if (getTextContentTd.length > 60) {
87
                item.style.fontSize = "4px";
88
            }else if (getTextContentTd.length > 50) {
89
                item.style.fontSize = "5px";
90
            }else if (getTextContentTd.length > 40) {
91
                item.style.fontSize = "6px";
92
            }else if (getTextContentTd.length > 35) {
93
                item.style.fontSize = "7px";
94
            } else if (getTextContentTd.length > 29) {
95
                item.style.fontSize = "9px";
96
            } else {
97
                item.style.fontSize = "10px";
98
            }
99
        })
100
    });
101
</script>' WHERE REPORT_TEMPLATE_DETAIL_ID = 'RTMPD0000000020'