loulijun2021
2022-07-04 991a63234bba49da5a22d0f64ae15837d3253829
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
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
{
    "Version":"6.6.6.0",
    "Title":"7-2e.脚本.四舍五入",
    "Author":"锐浪报表软件",
    "Description":"报表中实现四舍五入:\r\n1、报表中的小数数据可以通过设置格式串控制其显示位数,但这样并不会改变数据的实际值。如果对数据进行累计统计,计算机自动统计的与根据显示数据进行统计的结果很可能不一致。\r\n2、为了保持统计值与显示值一致,需要对数据进行必要的四舍五入处理。\r\n3、四舍五入方式一:在报表脚本代码中调用 IGRUtility.NumberRound45 方法。通常在记录集的“提交记录前脚本”中将字段的原始值进行四舍五入。\r\n4、四舍五入方式二:在综合文字框的表达式中定义 round45 函数。",
    "Font":{
        "Name":"宋体",
        "Size":105000,
        "Weight":400,
        "Charset":134
    },
    "Printer":{
        "Oriention":"Landscape"
    },
    "DetailGrid":{
        "CenterView":true,
        "ColLine":{
            "Color":"646F71"
        },
        "RowLine":{
            "Color":"646F71"
        },
        "Recordset":{
            "ConnectionString":"Provider=Microsoft.Jet.OLEDB.4.0;\r\nUser ID=Admin;\r\nData Source=..\\Data\\Northwind.mdb",
            "QuerySQL":"select OrderID,ProductID,UnitPrice*12.6573 as Amount,UnitPrice*12.657 as Amount2\r\nfrom OrderDetails\r\nwhere OrderID<=10300\r\norder by OrderID",
            "BeforePostRecordScript":"var f = Sender.Fields.Item(\"Amount2\");\r\nf.AsFloat = Report.Utility.NumberRound45(f.AsFloat, 2);",
            "Field":[
                {
                    "Name":"OrderID",
                    "Type":"Integer"
                },
                {
                    "Name":"ProductID",
                    "Type":"Integer"
                },
                {
                    "Name":"UnitPrice",
                    "Type":"Float",
                    "Format":"#,##0.##"
                },
                {
                    "Name":"Amount",
                    "Type":"Float"
                },
                {
                    "Name":"Amount2",
                    "Type":"Float"
                }
            ]
        },
        "Column":[
            {
                "Name":"UnitPriceaaa",
                "Width":2.77813
            },
            {
                "Name":"rawAmount",
                "Width":5
            },
            {
                "Name":"Amount",
                "Width":5
            },
            {
                "Name":"Amount2",
                "Width":5
            },
            {
                "Name":"Amount3",
                "Width":5
            }
        ],
        "ColumnContent":{
            "Height":0.79375,
            "ColumnContentCell":[
                {
                    "Column":"UnitPriceaaa",
                    "TextAlign":"MiddleRight",
                    "DataField":"ProductID"
                },
                {
                    "Column":"rawAmount",
                    "TextAlign":"MiddleRight",
                    "DataField":"Amount"
                },
                {
                    "Column":"Amount",
                    "TextAlign":"MiddleRight",
                    "DataField":"Amount"
                },
                {
                    "Column":"Amount2",
                    "TextAlign":"MiddleRight",
                    "DataField":"Amount2"
                },
                {
                    "Column":"Amount3",
                    "FreeCell":true,
                    "Control":[
                        {
                            "Type":"MemoBox",
                            "Name":"MemoBox6",
                            "Dock":"Fill",
                            "TextAlign":"MiddleRight",
                            "Text":"[#round45(Amount, 2)#]"
                        }
                    ]
                }
            ]
        },
        "ColumnTitle":{
            "BackColor":"E2EFF1",
            "Height":0.9,
            "Font":{
                "Name":"宋体",
                "Size":105000,
                "Bold":true,
                "Charset":134
            },
            "RepeatStyle":"OnGroupHeaderPage",
            "ColumnTitleCell":[
                {
                    "GroupTitle":false,
                    "Column":"UnitPriceaaa",
                    "TextAlign":"MiddleCenter",
                    "Text":"产品ID"
                },
                {
                    "GroupTitle":false,
                    "Column":"rawAmount",
                    "TextAlign":"MiddleCenter",
                    "Text":"小数字段(原始数据)"
                },
                {
                    "GroupTitle":false,
                    "Column":"Amount",
                    "TextAlign":"MiddleCenter",
                    "Text":"小数字段(控制显示位数)"
                },
                {
                    "GroupTitle":false,
                    "Column":"Amount2",
                    "TextAlign":"MiddleCenter",
                    "Text":"小数字段(四舍五入/脚本)"
                },
                {
                    "GroupTitle":false,
                    "Column":"Amount3",
                    "TextAlign":"MiddleCenter",
                    "Text":"小数字段(四舍五入/表达式)"
                }
            ]
        },
        "Group":[
            {
                "Name":"Group1",
                "ByFields":"OrderID",
                "GroupHeader":{
                    "Height":0.79375,
                    "Font":{
                        "Name":"宋体",
                        "Size":90000,
                        "Bold":true,
                        "Charset":134
                    },
                    "Control":[
                        {
                            "Type":"FieldBox",
                            "Name":"Field1",
                            "Left":1.5875,
                            "Width":2.61938,
                            "Height":0.79375,
                            "DataField":"OrderID"
                        },
                        {
                            "Type":"StaticBox",
                            "Name":"StaticBox3",
                            "Width":1.5875,
                            "Height":0.79375,
                            "Text":"订单号:"
                        }
                    ]
                },
                "GroupFooter":{
                    "BackColor":"E1FFFF",
                    "Height":1.79917,
                    "Font":{
                        "Name":"宋体",
                        "Size":105000,
                        "Bold":true,
                        "Charset":134
                    },
                    "PrintGridBorder":false,
                    "Control":[
                        {
                            "Type":"StaticBox",
                            "Name":"StaticBox2",
                            "BackColor":"FFFFFF",
                            "Width":2.40771,
                            "Height":0.79375,
                            "Text":"本单小计"
                        },
                        {
                            "Type":"MemoBox",
                            "Name":"MemoBox1",
                            "AlignColumn":"Amount",
                            "Left":7.77875,
                            "Top":0.79375,
                            "Width":5.02708,
                            "Height":0.79375,
                            "TextAlign":"MiddleRight",
                            "Text":"小数显示三位:[#Sum(Amount):#,##0.000#]"
                        },
                        {
                            "Type":"MemoBox",
                            "Name":"MemoBox2",
                            "AlignColumn":"Amount",
                            "Left":7.77875,
                            "Width":5.02708,
                            "Height":0.79375,
                            "TextAlign":"MiddleRight",
                            "Text":"小数显示二位:[#Sum(Amount):#,##0.00#]"
                        },
                        {
                            "Type":"MemoBox",
                            "Name":"MemoBox3",
                            "AlignColumn":"rawAmount",
                            "Left":2.77813,
                            "Width":5.02708,
                            "Height":0.79375,
                            "TextAlign":"MiddleRight",
                            "Text":"精确显示:[#Sum(Amount)#]"
                        },
                        {
                            "Type":"MemoBox",
                            "Name":"MemoBox4",
                            "AlignColumn":"Amount2",
                            "Left":12.7794,
                            "Width":5.02708,
                            "Height":0.79375,
                            "TextAlign":"MiddleRight",
                            "Text":"精确显示:[#Sum(Amount2)#]"
                        },
                        {
                            "Type":"MemoBox",
                            "Name":"MemoBox5",
                            "AlignColumn":"Amount2",
                            "Left":12.7794,
                            "Top":0.79375,
                            "Width":5.02708,
                            "Height":0.79375,
                            "TextAlign":"MiddleRight",
                            "Text":"小数显示二位:[#Sum(Amount2):#,##0.00#]"
                        },
                        {
                            "Type":"MemoBox",
                            "Name":"MemoBox7",
                            "AlignColumn":"Amount3",
                            "Left":17.78,
                            "Width":5.02708,
                            "Height":0.79375,
                            "TextAlign":"MiddleRight",
                            "Text":"精确显示:[#Sum(round45(Amount,2))#]"
                        },
                        {
                            "Type":"MemoBox",
                            "Name":"MemoBox8",
                            "AlignColumn":"Amount3",
                            "Left":17.78,
                            "Top":0.79375,
                            "Width":5.02708,
                            "Height":0.79375,
                            "TextAlign":"MiddleRight",
                            "Text":"四舍五入一位:[#round45(Sum(round45(Amount,2)), 1)#]"
                        }
                    ]
                }
            }
        ]
    },
    "ReportHeader":[
        {
            "Height":1.37583,
            "Control":[
                {
                    "Type":"StaticBox",
                    "Name":"TitleBox",
                    "Center":"Horizontal",
                    "Left":7.54063,
                    "Top":0.211667,
                    "Width":9.63083,
                    "Height":0.79375,
                    "Font":{
                        "Name":"宋体",
                        "Size":150000,
                        "Bold":true,
                        "Charset":134
                    },
                    "TextAlign":"MiddleCenter",
                    "Text":"演示报表中对数据进行四舍五入"
                }
            ]
        }
    ]
}