<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                >小計:是指數字列表的一部分的總和 >縱向分組小計:是指每個縱向分組下的小計 # 縱向分組小計 [TOC] ## 示例1—不存在橫向分組小計 ### 1、效果展示 縱向分組小計:[點擊預覽示例1](https://bootapi.jeecg.com/jmreport/view/590808622016319488) 以地區為分組依據,計算銷售金額合計;`合計`兩個字展示在省份下。 ![](https://img.kancloud.cn/6c/e2/6ce2950639113e8e682cfa149f1b2ddb_615x387.png) ### 2、創建一個名為`區域省份銷售統計`的數據報表 > 創建一個區域銷售表,有七個字段:ID、數量、區域名稱、年、省份、價格、月份 ![](https://img.kancloud.cn/70/ea/70ea527bff8715bfb137ba1298a7d933_808x210.png) #### 2.1 為`區域省份銷售統計`創建SQL數據源 ![](https://img.kancloud.cn/4b/53/4b535eb44bce8c1f69a10f39263b6773_1917x891.png) >部分數據展示 ![](https://img.kancloud.cn/d9/b5/d9b50cfb8139f5c35463aff51dc2f3e1_1920x896.png) #### 2.2 將字段拖拽到設計器頁面 ![](https://img.kancloud.cn/51/91/51912bbe74cf314d94cb0459f637e76c_1919x909.png) #### 2.3 設置縱向分組、橫向分組、動態屬性 >[danger]此步驟涉及到`橫向縱向組合動態列`和`交叉報表` 橫向縱向組合動態列請參考 [橫向縱向組合動態列](http://report.jeecg.com/2119057) 交叉報表請參考 [交叉報表](http://report.jeecg.com/2112709) * 地區(areaname)縱向分組: `#{jm.group(areaname)}` * 省份(province)縱向分組:` #{jm.group(province)}` * 年份(year)橫向分組: `#{jm.groupRight(year)}年` * 月份(month)橫向分組: `#{jm.groupRight(month)}月` * 銷售額(amount)動態屬性:`#{jm.dynamic(amount)}` ![](https://img.kancloud.cn/ef/a9/efa9d105be87756fdfaac041eea63985_1332x895.png) #### 2. 4、重點來了->設置分組小計 >[danger] 特別注意:本例中` #{jm.group(areaname)}`為分組依據字段、`#{jm.group(province)}`為分組字段,則合計可正常顯示,”合計“兩個字展示在省份下;自1.4.0版本開始當只有分組依據字段,無其他分組字段時,”合計“兩個字自動展示在分組字段后一個字段中。 >`#{jm.group(areaname)}`設置為分組依據 ![](https://img.kancloud.cn/79/bc/79bc09fe21d8ef882fa2fdab3584ccaa_1636x852.png) >`#{jm.dynamic(amount)}`設置為`求和` ![](https://img.kancloud.cn/01/ee/01ee995044c2b89fbb17f797b2b2aa27_1638x898.png) >保存預覽 ![](https://img.kancloud.cn/92/7c/927c6e0523a9e39ac5a4f86ea5001d71_1911x980.png) ## 示例2—存在橫向分組小計 ### 1、效果展示 組合分組小計:[點擊預覽示例2](https://bootapi.jeecg.com/jmreport/view/590812531803901952) 以區域為分組依據,設置縱向小計和橫向小計 小計:橫向計算,單價*金額 合計:金額列組內相加 ![](https://img.kancloud.cn/db/fd/dbfd1dfd8facf727dbad7bc72f6d9038_998x520.png) ### 2、創建一個名為`區域省份銷售統計`的數據報表 > 創建一個區域銷售表,有七個字段:ID、數量、區域名稱、年、省份、價格、月份 ![](https://img.kancloud.cn/70/ea/70ea527bff8715bfb137ba1298a7d933_808x210.png) #### 2.1 為`區域省份銷售統計`創建SQL數據源 ![](https://img.kancloud.cn/4b/53/4b535eb44bce8c1f69a10f39263b6773_1917x891.png) >部分數據展示 ![](https://img.kancloud.cn/d9/b5/d9b50cfb8139f5c35463aff51dc2f3e1_1920x896.png) #### 2.2 將字段拖拽到設計器頁面 ![](https://img.kancloud.cn/da/2c/da2c2069b85fcf956f6a85bda41d7cda_1920x906.png) #### 2.3 設置橫向分組、縱向分組、動態屬性、橫向小計 >[danger]此步驟涉及到`橫向縱向組合動態列`和`交叉報表`和`橫向分組小計` 橫向縱向組合動態列請參考 [橫向縱向組合動態列](http://report.jeecg.com/2119057) 交叉報表請參考 [交叉報表](http://report.jeecg.com/2112709) 橫向分組小計請參考 [橫向分組小計](http://report.jeecg.com/2250464) * 地區(areaname)縱向分組: `#{jm.group(areaname)}` * 部門(province)縱向分組: `#{jm.group(province)}` * 年份(year)橫向分組: `#{jm.groupRight(year)}年` * 月份(month)橫向分組: `#{jm.groupRight(month)}月` * 動態字段: 單價(`#{jm.dynamic(price)}`) 金額(`#{jm.dynamic(amount)}`) 小計(`#{jm.compute(price*amount)}`) ![](https://img.kancloud.cn/78/7f/787fb4c16bfae0ef8f0a82853d30b076_1337x850.png) #### 2.4、重點來了->設置分組小計 >[danger] 特別注意:本例中`#{jm.group(areaname)}`為分組依據字段、`#{jm.group(dept)}`為分組字段,則合計可正常顯示,”合計“兩個字展示在省份下;自1.4.0版本開始當只有分組依據字段,無其他分組字段時,”合計“兩個字自動展示在分組字段后一個字段中。 > `#{jm.group(areaname)}`設置為分組依據 ![](https://img.kancloud.cn/85/45/85458035925469cb617cded0a53b4390_1636x848.png) >`#{jm.dynamic(amount)}`設置成求和列 ![](https://img.kancloud.cn/63/0e/630e3c6a51e4b7ca90d3c80b33b0aa5a_1646x845.png) >保存預覽 ![](https://img.kancloud.cn/d2/31/d2310abc4a48716c3b0b0b03fc473a20_1911x980.png) ## 特殊規則注意 >[danger]設置動態單元格類型 當數據不完整時系統默認會進行補0操作便于小計表達式計算,如果該單元格不是數值類型則需要設置為文本,設置文本后該單元格顯示為空;如:`備注`字段為空時,不需要展示為0,則設置備注字段類型為`文本`。 ![](https://img.kancloud.cn/0f/52/0f52e2c01175cae3ecc01d83315885d1_1177x532.png) ## 數據格式 重要!!!(數據必須完整) >[danger] 特別注意:當有橫向分組時,數據中第一條`數據必須完整`;例如:期望展示1-12月的數據,則第一條數據1-12月必須都有數據。 * SQL數據: ![](https://img.kancloud.cn/83/53/8353142445f8c452572c3d7eec73ebd1_682x569.png) * 返回JSON格式: ``` { "data": [{ "amount": "100", "month": "1", "areaname": "華北", "year": "2020", "price": "5", "id": "1", "dept": "河北", "settleamount": "100" }, { "amount": "200", "month": "2", "areaname": "華北", "year": "2020", "price": "5", "id": "10", "dept": "河北", "settleamount": "200" }, { "amount": "202", "month": "2", "areaname": "華北", "year": "2020", "price": "6", "id": "12", "dept": "河南", "settleamount": "202" }, { "amount": "203", "month": "1", "areaname": "華東", "year": "2020", "price": "6", "id": "13", "dept": "遼寧", "settleamount": "203" }, { "amount": "204", "month": "2", "areaname": "華東", "year": "2020", "price": "6", "id": "14", "dept": "遼寧", "settleamount": "204" }, { "amount": "205", "month": "1", "areaname": "華南", "year": "2020", "price": "5", "id": "15", "dept": "湖北", "settleamount": "205" }, { "amount": "206", "month": "2", "areaname": "華南", "year": "2020", "price": "5", "id": "16", "dept": "湖北", "settleamount": "206" }, { "amount": "207", "month": "1", "areaname": "華南", "year": "2020", "price": "5", "id": "17", "dept": "安徽", "settleamount": "207" }, { "amount": "208", "month": "2", "areaname": "華南", "year": "2020", "price": "5", "id": "18", "dept": "安徽", "settleamount": "208" }, { "amount": "201", "month": "2", "areaname": "華北", "year": "2021", "price": "5", "id": "20", "dept": "河北", "settleamount": "201" }, { "amount": "200", "month": "1", "areaname": "華北", "year": "2021", "price": "5", "id": "21", "dept": "河北", "settleamount": "200" }, { "amount": "202", "month": "2", "areaname": "華北", "year": "2021", "price": "6", "id": "22", "dept": "河南", "settleamount": "202" }, { "amount": "209", "month": "1", "areaname": "華北", "year": "2021", "price": "6", "id": "23", "dept": "河南", "settleamount": "209" }, { "amount": "202", "month": "1", "areaname": "華北", "year": "2020", "price": "6", "id": "24", "dept": "河南", "settleamount": "202" }, { "amount": "203", "month": "1", "areaname": "華東", "year": "2021", "price": "6", "id": "25", "dept": "遼寧", "settleamount": "203" }, { "amount": "204", "month": "2", "areaname": "華東", "year": "2021", "price": "6", "id": "26", "dept": "遼寧", "settleamount": "204" }, { "amount": "205", "month": "1", "areaname": "華南", "year": "2021", "price": "5", "id": "27", "dept": "湖北", "settleamount": "205" }, { "amount": "206", "month": "2", "areaname": "華南", "year": "2021", "price": "5", "id": "28", "dept": "湖北", "settleamount": "206" }, { "amount": "207", "month": "1", "areaname": "華南", "year": "2021", "price": "5", "id": "29", "dept": "安徽", "settleamount": "207" }, { "amount": "208", "month": "2", "areaname": "華南", "year": "2021", "price": "5", "id": "30", "dept": "安徽", "settleamount": "208" }, { "amount": "203", "month": "1", "areaname": "華東", "year": "2020", "price": "6", "id": "43", "dept": "天津", "settleamount": "203" }, { "amount": "204", "month": "2", "areaname": "華東", "year": "2020", "price": "6", "id": "44", "dept": "天津", "settleamount": "204" }, { "amount": "203", "month": "1", "areaname": "華東", "year": "2021", "price": "6", "id": "45", "dept": "天津", "settleamount": "203" }, { "amount": "204", "month": "2", "areaname": "華東", "year": "2021", "price": "6", "id": "46", "dept": "天津", "settleamount": "204" }] } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看