Платформа 3V/Отчет/5. Настроить представление, оформление отчета/Настроить сортировку: различия между версиями
Перейти к навигации
Перейти к поиску
м (A.saydakova переименовал страницу Содержание/Отчет/Сортировка в Платформа 3V/Отчет/Сортировка поверх перенаправления) |
|||
Строка 58: | Строка 58: | ||
| nullsSortingMode || нулевые значения в начале / в конце ("PlaceFirst" / "PlaceLast") | | nullsSortingMode || нулевые значения в начале / в конце ("PlaceFirst" / "PlaceLast") | ||
|} | |} | ||
+ | |||
+ | === Пример использования в отчете=== | ||
+ | Описание кейса и примеры сортировок по различным атрибутам с разными типами данных см. на странице [[Платформа_3V/Справочник/Cортировка|'''Сортировка элементов справочника (SortingOptions)''']] | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="width:800px; overflow:auto;"> | ||
+ | <div style="font-weight:bold;line-height:1.6;">JSON отчета с сортировкой по возрастанию атр."Наименование"</div> | ||
+ | <div class="mw-collapsible-content mw-collapsed-content"> | ||
+ | <syntaxhighlight lang="JSON" line> | ||
+ | { | ||
+ | "workflowId": null, | ||
+ | "leftHeader": { | ||
+ | "useLazyDataLoadingStrategy": false, | ||
+ | "dictionaries": [ | ||
+ | { | ||
+ | "showDataIfAbsentFilter": null, | ||
+ | "coordAttribute": null, | ||
+ | "cartesianOptions": "Default", | ||
+ | "canSelectAttribute": null, | ||
+ | "groupingOptions": null, | ||
+ | "groupingMethod": "Default", | ||
+ | "sortingOptions": { | ||
+ | "attributes": [ | ||
+ | { | ||
+ | "attribute": { | ||
+ | "id": 2, | ||
+ | "discriminator": "OwnAttributeDefinitionDto" | ||
+ | }, | ||
+ | "sortDirection": "Ascending", | ||
+ | "nullsSortingMode": "PlaceFirst" | ||
+ | } | ||
+ | ] | ||
+ | }, | ||
+ | "rootElement": null, | ||
+ | "virtualElements": null, | ||
+ | "displayValueOptions": null, | ||
+ | "displayAttribute": null, | ||
+ | "dictionaryId": 67, | ||
+ | "filter": { | ||
+ | "value": null, | ||
+ | "skipIfValueNull": false, | ||
+ | "attributeId": null, | ||
+ | "attribute": { | ||
+ | "id": 1, | ||
+ | "discriminator": "OwnAttributeDefinitionDto" | ||
+ | }, | ||
+ | "conditionType": "AllElements", | ||
+ | "inversion": false, | ||
+ | "discriminator": "ValueConditionalDictionaryFilterDto" | ||
+ | }, | ||
+ | "selection": null, | ||
+ | "hierarchyId": null, | ||
+ | "limit": null | ||
+ | } | ||
+ | ], | ||
+ | "dictionaryAttributesLinks": [], | ||
+ | "specialFilters": { | ||
+ | "filtersByDataOptions": { | ||
+ | "filtersByData": [], | ||
+ | "needRestoreFullHierachy": false, | ||
+ | "joinOption": "Or", | ||
+ | "restoreElements": null | ||
+ | }, | ||
+ | "dictionaryAttributesLinks": [], | ||
+ | "needRestoreFullHierachy": false, | ||
+ | "restoreElements": null | ||
+ | }, | ||
+ | "isEditable": false | ||
+ | }, | ||
+ | "topHeader": { | ||
+ | "topHeaderItems": [ | ||
+ | { | ||
+ | "dictionaryAttributes": [ | ||
+ | { | ||
+ | "dictionaryId": 67, | ||
+ | "attribute": { | ||
+ | "id": 2, | ||
+ | "discriminator": "OwnAttributeDefinitionDto" | ||
+ | }, | ||
+ | "filter": null, | ||
+ | "sortingOptions": null, | ||
+ | "attributeId": null, | ||
+ | "displayAttributeType": "AttributeName", | ||
+ | "displayAttributeName": null, | ||
+ | "addFirstElementValue": false, | ||
+ | "overwriteNotFirstElementValues": true, | ||
+ | "delimiter": ", ", | ||
+ | "hideAttributeNameInHeader": false, | ||
+ | "headerNameDelimiter": " / ", | ||
+ | "duplicateValuesForNextDictionaries": true, | ||
+ | "duplicateValuesForNextRows": true, | ||
+ | "displayValueOptions": null, | ||
+ | "linkedAttributeSettings": null, | ||
+ | "skippedFilterAttributesByLink": [], | ||
+ | "filterOptionsByLinks": null | ||
+ | } | ||
+ | ], | ||
+ | "settings": null, | ||
+ | "hyperlinkOptions": null, | ||
+ | "hasImage": false, | ||
+ | "columnOptions": null, | ||
+ | "discriminator": "AttributeHeaderItemDto" | ||
+ | }, | ||
+ | { | ||
+ | "dictionaryAttributes": [ | ||
+ | { | ||
+ | "dictionaryId": 67, | ||
+ | "attribute": { | ||
+ | "id": 21, | ||
+ | "discriminator": "OwnAttributeDefinitionDto" | ||
+ | }, | ||
+ | "filter": null, | ||
+ | "sortingOptions": null, | ||
+ | "attributeId": null, | ||
+ | "displayAttributeType": "AttributeName", | ||
+ | "displayAttributeName": null, | ||
+ | "addFirstElementValue": false, | ||
+ | "overwriteNotFirstElementValues": true, | ||
+ | "delimiter": ", ", | ||
+ | "hideAttributeNameInHeader": false, | ||
+ | "headerNameDelimiter": " / ", | ||
+ | "duplicateValuesForNextDictionaries": true, | ||
+ | "duplicateValuesForNextRows": true, | ||
+ | "displayValueOptions": null, | ||
+ | "linkedAttributeSettings": null, | ||
+ | "skippedFilterAttributesByLink": [], | ||
+ | "filterOptionsByLinks": null | ||
+ | } | ||
+ | ], | ||
+ | "settings": null, | ||
+ | "hyperlinkOptions": null, | ||
+ | "hasImage": false, | ||
+ | "columnOptions": null, | ||
+ | "discriminator": "AttributeHeaderItemDto" | ||
+ | }, | ||
+ | { | ||
+ | "dictionaryAttributes": [ | ||
+ | { | ||
+ | "dictionaryId": 67, | ||
+ | "attribute": { | ||
+ | "id": 22, | ||
+ | "discriminator": "OwnAttributeDefinitionDto" | ||
+ | }, | ||
+ | "filter": null, | ||
+ | "sortingOptions": null, | ||
+ | "attributeId": null, | ||
+ | "displayAttributeType": "AttributeName", | ||
+ | "displayAttributeName": null, | ||
+ | "addFirstElementValue": false, | ||
+ | "overwriteNotFirstElementValues": true, | ||
+ | "delimiter": ", ", | ||
+ | "hideAttributeNameInHeader": false, | ||
+ | "headerNameDelimiter": " / ", | ||
+ | "duplicateValuesForNextDictionaries": true, | ||
+ | "duplicateValuesForNextRows": true, | ||
+ | "displayValueOptions": null, | ||
+ | "linkedAttributeSettings": null, | ||
+ | "skippedFilterAttributesByLink": [], | ||
+ | "filterOptionsByLinks": null | ||
+ | } | ||
+ | ], | ||
+ | "settings": null, | ||
+ | "hyperlinkOptions": null, | ||
+ | "hasImage": false, | ||
+ | "columnOptions": null, | ||
+ | "discriminator": "AttributeHeaderItemDto" | ||
+ | }, | ||
+ | { | ||
+ | "dictionaryAttributes": [ | ||
+ | { | ||
+ | "dictionaryId": 67, | ||
+ | "attribute": { | ||
+ | "id": 23, | ||
+ | "discriminator": "OwnAttributeDefinitionDto" | ||
+ | }, | ||
+ | "filter": null, | ||
+ | "sortingOptions": null, | ||
+ | "attributeId": null, | ||
+ | "displayAttributeType": "AttributeName", | ||
+ | "displayAttributeName": null, | ||
+ | "addFirstElementValue": false, | ||
+ | "overwriteNotFirstElementValues": true, | ||
+ | "delimiter": ", ", | ||
+ | "hideAttributeNameInHeader": false, | ||
+ | "headerNameDelimiter": " / ", | ||
+ | "duplicateValuesForNextDictionaries": true, | ||
+ | "duplicateValuesForNextRows": true, | ||
+ | "displayValueOptions": null, | ||
+ | "linkedAttributeSettings": null, | ||
+ | "skippedFilterAttributesByLink": [], | ||
+ | "filterOptionsByLinks": null | ||
+ | } | ||
+ | ], | ||
+ | "settings": null, | ||
+ | "hyperlinkOptions": null, | ||
+ | "hasImage": false, | ||
+ | "columnOptions": null, | ||
+ | "discriminator": "AttributeHeaderItemDto" | ||
+ | } | ||
+ | ], | ||
+ | "needFilterAttributesByLinks": false, | ||
+ | "enableFilterByLinks": false, | ||
+ | "numerationSettings": null, | ||
+ | "filterOptions": null | ||
+ | }, | ||
+ | "parameters": [], | ||
+ | "styles": [], | ||
+ | "styleOptions": [], | ||
+ | "stylesTemplate": [], | ||
+ | "filtersByDataOptions": null, | ||
+ | "view": null, | ||
+ | "externalExecutions": null, | ||
+ | "settings": null, | ||
+ | "code": "P_Сортировка элементов справочника (SortingOptions)", | ||
+ | "id": 82, | ||
+ | "name": "Сортировка элементов справочника (SortingOptions)" | ||
+ | } | ||
+ | </syntaxhighlight> | ||
+ | </div></div> | ||
+ | <br> | ||
+ | [[Файл:Сортировка в отчете.jpg|600px|безрамки|без]] |
Версия 13:21, 22 апреля 2021
Сортировка по столбцу
"sortings": [ ] |
---|
1 {
2 "column": 9,
3 "sortDirection": "Descending",
4 "nullsSortingMode": "PlaceLast",
5 "discriminator": "PivotColumnSortingDto"
6 }
|
Параметр | Описание |
---|---|
"column": 0 | нумерация столбцов начинается с 0 |
"sortDirection": "Descending" / Ascending | по убыванию / по возрастанию |
"nullsSortingMode": "PlaceFirst" / "PlaceLast", | нулевые в начале / нулевые в конце |
Сортировка по справочнику
Последовательное расположение в зависимости от выбранного атрибута справочника
"sortingOptions": [ ] |
---|
1 "sortingOptions": {
2 "attributes": [
3 {
4 "attribute": {
5 "id": 1,
6 "discriminator": "OwnAttributeDefinitionDto"
7 },
8 "sortDirection": "Descending",
9 "nullsSortingMode": "PlaceFirst"
10 }
11 ]
12 }
|
Значение | Описание |
---|---|
attribute | описание пути до атрибута, по которому будет производиться сортировка |
sortDirection | Направление по убыванию / по возрастанию ("Descending" / "Ascending") |
nullsSortingMode | нулевые значения в начале / в конце ("PlaceFirst" / "PlaceLast") |
Пример использования в отчете
Описание кейса и примеры сортировок по различным атрибутам с разными типами данных см. на странице Сортировка элементов справочника (SortingOptions)
JSON отчета с сортировкой по возрастанию атр."Наименование"
1 {
2 "workflowId": null,
3 "leftHeader": {
4 "useLazyDataLoadingStrategy": false,
5 "dictionaries": [
6 {
7 "showDataIfAbsentFilter": null,
8 "coordAttribute": null,
9 "cartesianOptions": "Default",
10 "canSelectAttribute": null,
11 "groupingOptions": null,
12 "groupingMethod": "Default",
13 "sortingOptions": {
14 "attributes": [
15 {
16 "attribute": {
17 "id": 2,
18 "discriminator": "OwnAttributeDefinitionDto"
19 },
20 "sortDirection": "Ascending",
21 "nullsSortingMode": "PlaceFirst"
22 }
23 ]
24 },
25 "rootElement": null,
26 "virtualElements": null,
27 "displayValueOptions": null,
28 "displayAttribute": null,
29 "dictionaryId": 67,
30 "filter": {
31 "value": null,
32 "skipIfValueNull": false,
33 "attributeId": null,
34 "attribute": {
35 "id": 1,
36 "discriminator": "OwnAttributeDefinitionDto"
37 },
38 "conditionType": "AllElements",
39 "inversion": false,
40 "discriminator": "ValueConditionalDictionaryFilterDto"
41 },
42 "selection": null,
43 "hierarchyId": null,
44 "limit": null
45 }
46 ],
47 "dictionaryAttributesLinks": [],
48 "specialFilters": {
49 "filtersByDataOptions": {
50 "filtersByData": [],
51 "needRestoreFullHierachy": false,
52 "joinOption": "Or",
53 "restoreElements": null
54 },
55 "dictionaryAttributesLinks": [],
56 "needRestoreFullHierachy": false,
57 "restoreElements": null
58 },
59 "isEditable": false
60 },
61 "topHeader": {
62 "topHeaderItems": [
63 {
64 "dictionaryAttributes": [
65 {
66 "dictionaryId": 67,
67 "attribute": {
68 "id": 2,
69 "discriminator": "OwnAttributeDefinitionDto"
70 },
71 "filter": null,
72 "sortingOptions": null,
73 "attributeId": null,
74 "displayAttributeType": "AttributeName",
75 "displayAttributeName": null,
76 "addFirstElementValue": false,
77 "overwriteNotFirstElementValues": true,
78 "delimiter": ", ",
79 "hideAttributeNameInHeader": false,
80 "headerNameDelimiter": " / ",
81 "duplicateValuesForNextDictionaries": true,
82 "duplicateValuesForNextRows": true,
83 "displayValueOptions": null,
84 "linkedAttributeSettings": null,
85 "skippedFilterAttributesByLink": [],
86 "filterOptionsByLinks": null
87 }
88 ],
89 "settings": null,
90 "hyperlinkOptions": null,
91 "hasImage": false,
92 "columnOptions": null,
93 "discriminator": "AttributeHeaderItemDto"
94 },
95 {
96 "dictionaryAttributes": [
97 {
98 "dictionaryId": 67,
99 "attribute": {
100 "id": 21,
101 "discriminator": "OwnAttributeDefinitionDto"
102 },
103 "filter": null,
104 "sortingOptions": null,
105 "attributeId": null,
106 "displayAttributeType": "AttributeName",
107 "displayAttributeName": null,
108 "addFirstElementValue": false,
109 "overwriteNotFirstElementValues": true,
110 "delimiter": ", ",
111 "hideAttributeNameInHeader": false,
112 "headerNameDelimiter": " / ",
113 "duplicateValuesForNextDictionaries": true,
114 "duplicateValuesForNextRows": true,
115 "displayValueOptions": null,
116 "linkedAttributeSettings": null,
117 "skippedFilterAttributesByLink": [],
118 "filterOptionsByLinks": null
119 }
120 ],
121 "settings": null,
122 "hyperlinkOptions": null,
123 "hasImage": false,
124 "columnOptions": null,
125 "discriminator": "AttributeHeaderItemDto"
126 },
127 {
128 "dictionaryAttributes": [
129 {
130 "dictionaryId": 67,
131 "attribute": {
132 "id": 22,
133 "discriminator": "OwnAttributeDefinitionDto"
134 },
135 "filter": null,
136 "sortingOptions": null,
137 "attributeId": null,
138 "displayAttributeType": "AttributeName",
139 "displayAttributeName": null,
140 "addFirstElementValue": false,
141 "overwriteNotFirstElementValues": true,
142 "delimiter": ", ",
143 "hideAttributeNameInHeader": false,
144 "headerNameDelimiter": " / ",
145 "duplicateValuesForNextDictionaries": true,
146 "duplicateValuesForNextRows": true,
147 "displayValueOptions": null,
148 "linkedAttributeSettings": null,
149 "skippedFilterAttributesByLink": [],
150 "filterOptionsByLinks": null
151 }
152 ],
153 "settings": null,
154 "hyperlinkOptions": null,
155 "hasImage": false,
156 "columnOptions": null,
157 "discriminator": "AttributeHeaderItemDto"
158 },
159 {
160 "dictionaryAttributes": [
161 {
162 "dictionaryId": 67,
163 "attribute": {
164 "id": 23,
165 "discriminator": "OwnAttributeDefinitionDto"
166 },
167 "filter": null,
168 "sortingOptions": null,
169 "attributeId": null,
170 "displayAttributeType": "AttributeName",
171 "displayAttributeName": null,
172 "addFirstElementValue": false,
173 "overwriteNotFirstElementValues": true,
174 "delimiter": ", ",
175 "hideAttributeNameInHeader": false,
176 "headerNameDelimiter": " / ",
177 "duplicateValuesForNextDictionaries": true,
178 "duplicateValuesForNextRows": true,
179 "displayValueOptions": null,
180 "linkedAttributeSettings": null,
181 "skippedFilterAttributesByLink": [],
182 "filterOptionsByLinks": null
183 }
184 ],
185 "settings": null,
186 "hyperlinkOptions": null,
187 "hasImage": false,
188 "columnOptions": null,
189 "discriminator": "AttributeHeaderItemDto"
190 }
191 ],
192 "needFilterAttributesByLinks": false,
193 "enableFilterByLinks": false,
194 "numerationSettings": null,
195 "filterOptions": null
196 },
197 "parameters": [],
198 "styles": [],
199 "styleOptions": [],
200 "stylesTemplate": [],
201 "filtersByDataOptions": null,
202 "view": null,
203 "externalExecutions": null,
204 "settings": null,
205 "code": "P_Сортировка элементов справочника (SortingOptions)",
206 "id": 82,
207 "name": "Сортировка элементов справочника (SortingOptions)"
208 }