1821349743@qq.com
2023-02-20 059154a3b7d812b3bb4b89ecfa4d94f9b905f7e0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
package com.product.server.report.service;
 
import com.product.core.entity.DataTableEntity;
/**
 * 
 * @author Administrator
 * exmple
 * 
 *
 */
public class Report {
    /**
     * 报表名字,最前面的标题
     */
    private String reportName;
    
    /**
     * 报表数据
     */
    private DataTableEntity dt; //分组字段必须排在前面,并按分组的字段进行排序,如:    select a,b,c,* from table  order by  a,b,c
    /**
     * 显示标题,支持多级标题
     */
    private String title[][];//
    /**
     * 标题合并列数,一一对应标题,被合并的列,列数为0
     * 
     */
    private int colspan[][];//
    /**
     * 标题合并行数,一一对应标题,被合并的行,行数为0
     */
    private int rowspan[][];//
    
    /**
     * 取值字段
     */
    private String field[];//分组字段必须排在前面 a,b,c,
    /**
     * 分组的字段,要分组字段必须排在最前面
     */
    private boolean groupField[];//字段field[]一一对应,不是分组字段,则为false,是则为true 
    /**
     * 记录最后分组字段的下标
     */
    private int maxGroupFieldIndex=-1;
    /**
     * 统计的字段
     */
    private boolean totalField[];//字段field[]一一对应,,不是合计字段,则为false,是则为true 
    /**
     * 是否显示统计行
     */
    private boolean isShowTotalRow=false;
    /**
     * 是否最后总计
     */
    private boolean isTotal=false;
    /**
     * 列宽度,百分比,不能超过或小于100
     */
    private int colWidth[];//字段field[]一一对应,只需配最后一行的每列宽度,不能小于等于0,合起来的总数=100
    /**
     * 报表整体固定宽度,不设置默认为100%
     */
    private int width;
    
    public boolean isShowTotalRow() {
        return isShowTotalRow;
    }
    public void setShowTotalRow(boolean isShowTotalRow) {
        this.isShowTotalRow = isShowTotalRow;
    }
    private String aligh[];
    
    public String[] getAligh() {
        return aligh;
    }
    public void setAligh(String[] aligh) {
        this.aligh = aligh;
    }
    private String url[];//与字段field[]一一对应,穿透查询,字段对应的链接地址,可以有动态变量取前面字段值,格式:#{字段名},如 "3,~SG00~,1",需要在jsp页面中添加js方法
//    function show(searchKey){//来处理
//        var data=searchKey.split(',');
//        if(data[0]==1){
//            showDept(data[1]);
//        }else if(data[0]==2){
//            showPM(data[1])
//        }else if(data[0]==3){
//            showProject(data[1],data[2]);
//        }
//    }
//    //------------------------------------------
    /*
     * 统计字段的类型,如合计、平均值  暂不支持
     */
    private String totalType[];//字段field[]一一对应,不是合计字段,则为null,是则可以为SUM、ARG
    
    public String getTotalRowColor() {
        return totalRowColor;
    }
    public void setTotalRowColor(String totalRowColor) {
        this.totalRowColor = totalRowColor;
    }
    private String titleBackColor;//标题 背景
    private String bodyBackColor;//表格 背景
    private String totalRowColor;
    private String format[];//数据格式:字符串为null ,数字(小数):##.##,日期: yyyy-dd-mm,百分比: ##.##%,参照数据:
    private boolean page;//是否要分页
    
    private int pageSize;//每页多少条
    private int currentPage;//当前页
    private int totalPage;//总页数
    private int totalRow;//总条数
    
    public int getTotalRow() {
        return totalRow;
    }
    public void setTotalRow(int totalRow) {
        this.totalRow = totalRow;
    }
    public int getTotalPage() {
        return totalPage;
    }
    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }
    public int getCurrentPage() {
        return currentPage;
    }
    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }
    public int getPageSize() {
        return pageSize;
    }
    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }
    public boolean isPage() {
        return page;
    }
    public void setPage(boolean page) {
        this.page = page;
    }
    public boolean isFixHeader() {
        return isFixHeader;
    }
    public void setFixHeader(boolean isFixHeader) {
        this.isFixHeader = isFixHeader;
    }
    private String onloadMethod;//页面初始调用方法;
    private boolean isFixHeader;
    //-----------------------------------------------------
    public String getOnloadMethod() {
        return onloadMethod;
    }
    public void setOnloadMethod(String onloadMethod) {
        this.onloadMethod = onloadMethod;
    }
    public String getReportName() {
        return reportName;
    }
    public String[] getFormat() {
        return format;
    }
    public void setFormat(String format[]) {
        this.format = format;
    }
    public void setReportName(String reportName) {
        this.reportName = reportName;
    }
    public String getTitleBackColor() {
        return titleBackColor;
    }
    public void setTitleBackColor(String titleBackColor) {
        this.titleBackColor = titleBackColor;
    }
    public String getBodyBackColor() {
        return bodyBackColor;
    }
    public void setBodyBackColor(String bodyBackColor) {
        this.bodyBackColor = bodyBackColor;
    }
    public String[] getTotalType() {
        return totalType;
    }
    public void setTotalType(String[] totalType) {
        this.totalType = totalType;
    }
    
    public int[][] getRowspan() {
        return rowspan;
    }
    public void setRowspan(int[][] rowspan) {
        this.rowspan = rowspan;
    }
    public int getWidth() {
        return width;
    }
    public String[] getUrl() {
        return url;
    }
    public void setUrl(String[] url) {
        this.url = url;
    }
    public void setWidth(int width) {
        this.width = width;
    }
    public String[][] getTitle() {
        return title;
    }
    public int[][] getColspan() {
        return colspan;
    }
    public void setColspan(int[][] colspan) {
        this.colspan = colspan;
    }
    public void setTitle(String[][] title) {
        this.title = title;
    }
    public int[] getColWidth() {
        return colWidth;
    }
    public void setColWidth(int[] colWidth) {
        this.colWidth = colWidth;
    }
    public DataTableEntity getDt() {
        return dt;
    }
    public void setDt(DataTableEntity dt) {
        this.dt = dt;
    }
 
    public String[] getField() {
        return field;
    }
    public void setField(String[] field) {
        this.field = field;
    }
    public boolean[] getGroupField() {
        return groupField;
    }
    /**
     * 获取最大的分组字段下标
     * @param groupField
     */
    public void setGroupField(boolean[] groupField) {
        this.groupField = groupField;
        for(int i=0;i<groupField.length;i++){
            if(groupField[i]){
                maxGroupFieldIndex=i;
            }else{
                break;
            }
        }
    }
    public int getMaxGroupFieldIndex() {
        return maxGroupFieldIndex;
    }
    public void setMaxGroupFieldIndex(int maxGroupFieldIndex) {
        this.maxGroupFieldIndex = maxGroupFieldIndex;
    }
    public boolean[] getTotalField() {
        return totalField;
    }
    public void setTotalField(boolean[] totalField) {
        this.totalField = totalField;
    }
    public boolean isTotal() {
        return isTotal;
    }
    public void setTotal(boolean isTotal) {
        this.isTotal = isTotal;
    }
}