@boldreports/javascript-reporting-extensions 5.2.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -0
- package/barcode.reportitem.css +47 -0
- package/barcode.reportitem.js +275 -0
- package/custombranding.config.js +9 -0
- package/extension.config.js +25 -0
- package/images/barcode.png +0 -0
- package/images/qrbarcode.png +0 -0
- package/package.json +39 -0
- package/qrbarcode.reportitem.js +290 -0
package/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
## BoldReports Javascript Extension
|
|
2
|
+
|
|
3
|
+
The `Bold Reports` extension contain scripts and themes for barcode report item to be integrated in [JavaScript Report Viewer](https://www.boldreports.com/embedded-reporting/javascript-report-viewer) and [JavaScript Report Designer](https://www.boldreports.com/embedded-reporting/javascript-report-designer) for enterprise web development(HTML5). A barcode report item is used for representing data in a visual, machine-readable form. You can build reports that display a barcode to make tasks like tracking shipping orders and employee identification numbers easier.
|
|
4
|
+
|
|
5
|
+
## Demos
|
|
6
|
+
|
|
7
|
+
### Online Demos
|
|
8
|
+
|
|
9
|
+
Take a look at the `Bold Reports JavaScript` live demo [here](https://demos.boldreports.com/home/).
|
|
10
|
+
|
|
11
|
+
## Documentation
|
|
12
|
+
|
|
13
|
+
For complete `Bold Reports JavaScript` documentation, please visit [https://help.boldreports.com/embedded-reporting/javascript-reporting/](https://help.boldreports.com/embedded-reporting/javascript-reporting/)
|
|
14
|
+
|
|
15
|
+
### Offline Demos
|
|
16
|
+
|
|
17
|
+
Download our JavaScript Reporting Platform installer from [here](https://www.boldreports.com/pricing/).
|
|
18
|
+
|
|
19
|
+
## Support
|
|
20
|
+
|
|
21
|
+
In case of any questions regarding the use of `Bold Reports JavaScript`, please [contact us](mailto:support@boldreports.com) by sending your queries.
|
|
22
|
+
|
|
23
|
+
## Release Notes
|
|
24
|
+
|
|
25
|
+
Refer to the online `Bold Reports JavaScript` Product [Release Notes](https://www.boldreports.com/release-history/).
|
|
26
|
+
|
|
27
|
+
## License Information
|
|
28
|
+
|
|
29
|
+
For licensing information about `Bold Reports JavaScript`, Take a look at the Syncfusion License Agreements from [here](https://www.boldreports.com/terms-of-use).
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
.customitem-barcode {
|
|
2
|
+
background-image: url('images/barcode.png');
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.customitem-qrbarcode {
|
|
6
|
+
background-image: url('images/qrbarcode.png');
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.customitem-barcode,
|
|
10
|
+
.customitem-qrbarcode {
|
|
11
|
+
background-position: 50% 50%;
|
|
12
|
+
background-repeat: no-repeat;
|
|
13
|
+
height: 25px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.e-rptdesigner-itempanel-dragelements .customitem-barcode,
|
|
17
|
+
.e-rptdesigner-itempanel-dragelements .customitem-qrbarcode {
|
|
18
|
+
margin-top: 0px !important;
|
|
19
|
+
height: 100%;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.e-rptdesigner-loaderDiv .e-rptdesigner-spinnerDiv {
|
|
23
|
+
box-sizing: content-box !important;
|
|
24
|
+
-moz-box-sizing: content-box !important;
|
|
25
|
+
-webkit-box-sizing: content-box !important;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* Safari */
|
|
29
|
+
@-webkit-keyframes spin {
|
|
30
|
+
0% {
|
|
31
|
+
-webkit-transform: rotate(0deg);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
100% {
|
|
35
|
+
-webkit-transform: rotate(360deg);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@keyframes spin {
|
|
40
|
+
0% {
|
|
41
|
+
transform: rotate(0deg);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
100% {
|
|
45
|
+
transform: rotate(360deg);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
var EJBarcode = (function () {
|
|
2
|
+
function EJBarcode(rptDesigner) {
|
|
3
|
+
this.customJSON = null;
|
|
4
|
+
this.rootElement = null;
|
|
5
|
+
this.customItemDiv = null;
|
|
6
|
+
this.reportDesigner = null;
|
|
7
|
+
this.loaderDiv = null;
|
|
8
|
+
this.errMsgDiv = null;
|
|
9
|
+
this.reportDesigner = rptDesigner;
|
|
10
|
+
}
|
|
11
|
+
EJBarcode.prototype.initializeItem = function (args) {
|
|
12
|
+
args.isBuildInService = true;
|
|
13
|
+
args.defaultHeight = 120;
|
|
14
|
+
args.defaultWidth = 180;
|
|
15
|
+
args.minimumHeight = 15;
|
|
16
|
+
args.minimumWidth = 90;
|
|
17
|
+
args.renderCallback = $.proxy(this.renderData, this);
|
|
18
|
+
args.loadingCallback = $.proxy(this.showIndicator, this);
|
|
19
|
+
};
|
|
20
|
+
EJBarcode.prototype.renderItem = function (customJson, target) {
|
|
21
|
+
this.customJSON = customJson;
|
|
22
|
+
this.rootElement = target;
|
|
23
|
+
this.renderBarcode();
|
|
24
|
+
};
|
|
25
|
+
EJBarcode.prototype.renderBarcode = function () {
|
|
26
|
+
this.customItemDiv = ej.buildTag('div.customitem', '', {
|
|
27
|
+
'width': '100%',
|
|
28
|
+
'height': '100%',
|
|
29
|
+
'border': '1pt dotted gray',
|
|
30
|
+
'box-sizing': 'border-box',
|
|
31
|
+
'-moz-box-sizing': 'border-box',
|
|
32
|
+
'-webkit-box-sizing': 'border-box',
|
|
33
|
+
'overflow': 'hidden', 'position': 'absolute'
|
|
34
|
+
}, {
|
|
35
|
+
'id': this.customJSON.Name + '_customItem'
|
|
36
|
+
});
|
|
37
|
+
var loaderDiv = this.loaderDiv = ej.buildTag('div.e-rptdesigner-loaderDiv', '', {
|
|
38
|
+
'width': '100%', 'height': '100%', 'display': 'none', 'opacity': '0.9',
|
|
39
|
+
'position': 'absolute', 'border': '0.5px dotted black',
|
|
40
|
+
'background-color': 'white',
|
|
41
|
+
'z-index': '4000', 'overflow': 'hidden'
|
|
42
|
+
});
|
|
43
|
+
var spinnerDiv = ej.buildTag('div.e-rptdesigner-spinnerDiv', '', {
|
|
44
|
+
'border': '5px solid #f3f3f3',
|
|
45
|
+
'border-radius': '50%', 'margin': '-17.5px 0 0 -17.5px',
|
|
46
|
+
'border-top': '5px solid #3498db',
|
|
47
|
+
'-webkit-animation': 'spin 2s linear infinite',
|
|
48
|
+
'animation': 'spin 2s linear infinite',
|
|
49
|
+
'background': 'transparent',
|
|
50
|
+
'position': 'absolute',
|
|
51
|
+
'left': '50%',
|
|
52
|
+
'top': '50%',
|
|
53
|
+
'cursor': 'default',
|
|
54
|
+
'height': '25px',
|
|
55
|
+
'width': '25px'
|
|
56
|
+
});
|
|
57
|
+
var errorRootDiv = this.errMsgDiv = ej.buildTag('div', '', {
|
|
58
|
+
'display': 'none', 'position': 'relative', 'z-index': '3000',
|
|
59
|
+
'font-family': 'Segoe UI', 'font-size': '13px', 'height': '100%', 'width': '100%'
|
|
60
|
+
});
|
|
61
|
+
var errorDiv = ej.buildTag('div', 'Failed to load barcode', {
|
|
62
|
+
'display': 'table-cell', 'overflow': 'hidden', 'font-family': 'Segoe UI',
|
|
63
|
+
'font-size': '13px', 'vertical-align': 'middle', 'text-align': 'center'
|
|
64
|
+
});
|
|
65
|
+
this.rootElement.append(loaderDiv);
|
|
66
|
+
loaderDiv.append(spinnerDiv);
|
|
67
|
+
errorRootDiv.append(errorDiv);
|
|
68
|
+
this.customItemDiv.append(errorRootDiv);
|
|
69
|
+
this.rootElement.append(this.customItemDiv);
|
|
70
|
+
};
|
|
71
|
+
EJBarcode.prototype.onPropertyChange = function (name, oldValue, newValue) {
|
|
72
|
+
var args = [];
|
|
73
|
+
for (var _i = 3; _i < arguments.length; _i++) {
|
|
74
|
+
args[_i - 3] = arguments[_i];
|
|
75
|
+
}
|
|
76
|
+
switch (name) {
|
|
77
|
+
case 'BarcodeValue':
|
|
78
|
+
this.updatePropertyVal(name, newValue);
|
|
79
|
+
break;
|
|
80
|
+
case 'BarcodeType':
|
|
81
|
+
this.updatePropertyVal(name, newValue);
|
|
82
|
+
break;
|
|
83
|
+
case 'DisplayBarcodeText':
|
|
84
|
+
this.updatePropertyVal(name, (newValue === true) ? 'true' : 'false');
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
EJBarcode.prototype.onPositionChanged = function (top, left) {
|
|
88
|
+
};
|
|
89
|
+
EJBarcode.prototype.onSizeChanged = function (height, width) {
|
|
90
|
+
if (!ej.isNullOrUndefined(height) && !ej.isNullOrUndefined(width)) {
|
|
91
|
+
this.customItemDiv.css({
|
|
92
|
+
width: width,
|
|
93
|
+
height: height
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
else if (!ej.isNullOrUndefined(height) && ej.isNullOrUndefined(width)) {
|
|
97
|
+
this.customItemDiv.css({
|
|
98
|
+
height: height
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
else if (ej.isNullOrUndefined(height) && !ej.isNullOrUndefined(width)) {
|
|
102
|
+
this.customItemDiv.css({
|
|
103
|
+
width: width
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
EJBarcode.prototype.getPropertyGridItems = function () {
|
|
108
|
+
var barCodeType = this.getPropertyVal('BarcodeType');
|
|
109
|
+
var propertyItems = {
|
|
110
|
+
'HeaderText': this.customJSON.Name,
|
|
111
|
+
'PropertyType': 'barcode',
|
|
112
|
+
'SubType': 'barcode',
|
|
113
|
+
'IsEditHeader': true,
|
|
114
|
+
'Items': [{
|
|
115
|
+
'CategoryId': 'basicsettings',
|
|
116
|
+
'DisplayName': this.getLocale('categoryBasicSettings'),
|
|
117
|
+
'IsExpand': true,
|
|
118
|
+
'Items': [
|
|
119
|
+
{
|
|
120
|
+
'ItemId': 'barcodetype',
|
|
121
|
+
'Name': 'BarcodeType',
|
|
122
|
+
'DisplayName': this.getLocale('BarcodeType'),
|
|
123
|
+
'Value': barCodeType,
|
|
124
|
+
'ItemType': 'DropDown',
|
|
125
|
+
'EnableExpression': false,
|
|
126
|
+
'ValueList': ['Code39', 'Code39Extended', 'Code11', 'Codabar', 'Code93', 'Code128A', 'Code128B',
|
|
127
|
+
'Code128C', 'GS1-128', 'UpcBarcode', 'EAN-13', 'EAN-8', 'Code39 Mod 43', 'Interleaved 2 of 5',
|
|
128
|
+
'Standard 2 of 5', 'Pharmacode']
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
'ItemId': 'barcodevalue',
|
|
132
|
+
'Name': 'BarcodeValue',
|
|
133
|
+
'DisplayName': this.getLocale('barcodeValue'),
|
|
134
|
+
'EnableExpression': true,
|
|
135
|
+
'Value': this.getPropertyVal('BarcodeValue'),
|
|
136
|
+
'ItemType': 'TextBox'
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
'ItemId': 'displaybarcodetext',
|
|
140
|
+
'Name': 'DisplayBarcodeText',
|
|
141
|
+
'DisplayName': this.getLocale('displayText'),
|
|
142
|
+
'Value': this.isDisplayText() ? true : false,
|
|
143
|
+
'ItemType': 'Bool',
|
|
144
|
+
'EnableExpression': false
|
|
145
|
+
}
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
]
|
|
149
|
+
};
|
|
150
|
+
return propertyItems;
|
|
151
|
+
};
|
|
152
|
+
EJBarcode.prototype.getPropertyVal = function (name) {
|
|
153
|
+
if (this.customJSON.CustomProperties && this.customJSON.CustomProperties.length > 0) {
|
|
154
|
+
for (var index = 0; index < this.customJSON.CustomProperties.length; index++) {
|
|
155
|
+
if (this.customJSON.CustomProperties[index].Name === name) {
|
|
156
|
+
return this.customJSON.CustomProperties[index].Value;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return null;
|
|
161
|
+
};
|
|
162
|
+
EJBarcode.prototype.setPropertyVal = function (name, val) {
|
|
163
|
+
if (this.customJSON.CustomProperties === null) {
|
|
164
|
+
this.customJSON.CustomProperties = [];
|
|
165
|
+
}
|
|
166
|
+
this.customJSON.CustomProperties.push(new ej.ReportModel.CustomProperty(name, val));
|
|
167
|
+
};
|
|
168
|
+
EJBarcode.prototype.updatePropertyVal = function (propertyName, value) {
|
|
169
|
+
if (this.customJSON.CustomProperties && this.customJSON.CustomProperties.length > 0) {
|
|
170
|
+
for (var index = 0; index < this.customJSON.CustomProperties.length; index++) {
|
|
171
|
+
if (this.customJSON.CustomProperties[index].Name === propertyName) {
|
|
172
|
+
this.customJSON.CustomProperties[index].Value = value;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
EJBarcode.prototype.getReportItemJson = function () {
|
|
178
|
+
if (this.customJSON === null) {
|
|
179
|
+
this.customJSON = new ej.ReportModel.CustomReportItem().getModel();
|
|
180
|
+
this.setPropertyVal('BarcodeValue', '00000');
|
|
181
|
+
this.setPropertyVal('BarcodeType', 'Code39');
|
|
182
|
+
this.setPropertyVal('DisplayBarcodeText', 'true');
|
|
183
|
+
}
|
|
184
|
+
return this.customJSON;
|
|
185
|
+
};
|
|
186
|
+
EJBarcode.prototype.setReportItemJson = function (reportItem) {
|
|
187
|
+
this.customJSON = reportItem;
|
|
188
|
+
};
|
|
189
|
+
EJBarcode.prototype.dispose = function () {
|
|
190
|
+
};
|
|
191
|
+
EJBarcode.prototype.isDisplayText = function () {
|
|
192
|
+
return (this.getPropertyVal('DisplayBarcodeText').toLowerCase()) === 'true';
|
|
193
|
+
};
|
|
194
|
+
EJBarcode.prototype.getLocale = function (text) {
|
|
195
|
+
var barcodeLocale;
|
|
196
|
+
var defaultLocale = EJBarcode.Locale['en-US'];
|
|
197
|
+
if (this.reportDesigner && !ej.isNullOrUndefined(this.reportDesigner.model) &&
|
|
198
|
+
!ej.isNullOrUndefined(EJBarcode.Locale[this.reportDesigner.model.locale])) {
|
|
199
|
+
barcodeLocale = EJBarcode.Locale[this.reportDesigner.model.locale];
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
barcodeLocale = defaultLocale;
|
|
203
|
+
}
|
|
204
|
+
switch (text.toLowerCase()) {
|
|
205
|
+
case 'barcodevalue':
|
|
206
|
+
if (barcodeLocale && barcodeLocale.barcodeValue) {
|
|
207
|
+
return barcodeLocale.barcodeValue;
|
|
208
|
+
}
|
|
209
|
+
return defaultLocale.barcodeValue;
|
|
210
|
+
case 'barcodetype':
|
|
211
|
+
if (barcodeLocale && barcodeLocale.barcodeType) {
|
|
212
|
+
return barcodeLocale.barcodeType;
|
|
213
|
+
}
|
|
214
|
+
return defaultLocale.barcodeType;
|
|
215
|
+
case 'displaytext':
|
|
216
|
+
if (barcodeLocale && barcodeLocale.textVisibility) {
|
|
217
|
+
return barcodeLocale.textVisibility;
|
|
218
|
+
}
|
|
219
|
+
return defaultLocale.textVisibility;
|
|
220
|
+
case 'categorybasicsettings':
|
|
221
|
+
if (barcodeLocale && barcodeLocale.categoryBasicSettings) {
|
|
222
|
+
return barcodeLocale.categoryBasicSettings;
|
|
223
|
+
}
|
|
224
|
+
return defaultLocale.categoryBasicSettings;
|
|
225
|
+
}
|
|
226
|
+
return text;
|
|
227
|
+
};
|
|
228
|
+
EJBarcode.prototype.renderData = function (args) {
|
|
229
|
+
this.customItemDiv.css('background-image', 'none');
|
|
230
|
+
if (args && args.data && typeof args.data === 'string' && args.data.indexOf('Sf_Exception') !== -1) {
|
|
231
|
+
this.errMsgDiv.css('display', 'table');
|
|
232
|
+
this.errMsgDiv.find('div').text('Failed to load barcode - ' + args.data.replace('Sf_Exception - ', ''));
|
|
233
|
+
}
|
|
234
|
+
else if (args.isLoaded && args.data) {
|
|
235
|
+
this.errMsgDiv.css('display', 'none');
|
|
236
|
+
this.customItemDiv.css({
|
|
237
|
+
'background-image': 'url(data:image/BMP;base64,' + args.data + ')',
|
|
238
|
+
'background-size': '100% 100%',
|
|
239
|
+
'background-repeat': 'no-repeat',
|
|
240
|
+
'background-position': 'left top'
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
this.errMsgDiv.css('display', 'table');
|
|
245
|
+
this.errMsgDiv.find('div').text('Failed to load barcode');
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
EJBarcode.prototype.showIndicator = function (isShow) {
|
|
249
|
+
this.loaderDiv.css('display', isShow ? 'block' : 'none');
|
|
250
|
+
};
|
|
251
|
+
return EJBarcode;
|
|
252
|
+
}());
|
|
253
|
+
EJBarcode.Locale = {};
|
|
254
|
+
EJBarcode.Locale['en-US'] = {
|
|
255
|
+
barcodeValue: 'Text',
|
|
256
|
+
barcodeType: 'Symbology Type',
|
|
257
|
+
textVisibility: 'Text Visibility',
|
|
258
|
+
categoryBasicSettings: 'Basic Settings',
|
|
259
|
+
toolTip: {
|
|
260
|
+
requirements: 'Display any barcode type.',
|
|
261
|
+
description: 'Displays the barcodes.',
|
|
262
|
+
title: 'Barcode'
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
EJBarcode.Locale['fr-FR'] = {
|
|
266
|
+
barcodeValue: 'Texte',
|
|
267
|
+
barcodeType: 'Type de symbologie',
|
|
268
|
+
textVisibility: 'Visibilite du texte',
|
|
269
|
+
categoryBasicSettings: 'Paramètres de base',
|
|
270
|
+
toolTip: {
|
|
271
|
+
requirements: 'Afficher n\'importe quel type de code à barres.',
|
|
272
|
+
description: 'Affiche les codes barres.',
|
|
273
|
+
title: 'code à barre'
|
|
274
|
+
}
|
|
275
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var customLinks = [
|
|
2
|
+
{ name: 'ESLicenseMessage', url: '/licensing/license-token/' },
|
|
3
|
+
{ name: 'Unlicensed', url: '/licensing/licensing-errors/#license-key-not-registered' },
|
|
4
|
+
{ name: 'LicenseExpired', url: '/licensing/licensing-errors/#license-expired' },
|
|
5
|
+
{ name: 'PlatformMismatch', url: '/licensing/licensing-errors/#platform-mismatch' },
|
|
6
|
+
{ name: 'WrongKey', url: '/licensing/licensing-errors/#invalid-key' },
|
|
7
|
+
{ name: 'NoLicense', url: '/licensing/licensing-errors/#license-key-not-registered' },
|
|
8
|
+
{ name: 'NetworkError', url: '/licensing/licensing-errors/#network-error' }
|
|
9
|
+
];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var dataExtensions = [];
|
|
2
|
+
var cloudDataExtensions = [];
|
|
3
|
+
var itemExtensions = [{
|
|
4
|
+
name: 'barcode',
|
|
5
|
+
className: 'EJBarcode',
|
|
6
|
+
imageClass: 'customitem-barcode',
|
|
7
|
+
displayName: '1D Barcode',
|
|
8
|
+
category: 'Barcodes',
|
|
9
|
+
toolTip: {
|
|
10
|
+
requirements: 'Add a report item to the designer area.',
|
|
11
|
+
description: 'Display the barcode lines as report item.',
|
|
12
|
+
title: 'Barcode'
|
|
13
|
+
}
|
|
14
|
+
}, {
|
|
15
|
+
name: 'matrixbarcode',
|
|
16
|
+
className: 'EJQRBarcode',
|
|
17
|
+
imageClass: 'customitem-qrbarcode',
|
|
18
|
+
displayName: '2D Barcode',
|
|
19
|
+
category: 'Barcodes',
|
|
20
|
+
toolTip: {
|
|
21
|
+
requirements: 'Add a report item to the designer area.',
|
|
22
|
+
description: 'Display the barcode lines as report item.',
|
|
23
|
+
title: '2D Barcode'
|
|
24
|
+
}
|
|
25
|
+
}];
|
|
Binary file
|
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@boldreports/javascript-reporting-extensions",
|
|
3
|
+
"version": "5.2.34",
|
|
4
|
+
"description": "The Bold Reports Extensions by Syncfusion contains scripts and themes for barcode report item to be integrated in JavaScript Report Viewer and JavaScript Report Designer for enterprise web development(HTML5)",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/boldreports/javascript-reporting-extensions.git"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [
|
|
10
|
+
"syncfusion",
|
|
11
|
+
"bold reports",
|
|
12
|
+
"javascript",
|
|
13
|
+
"javascript reporting extensions",
|
|
14
|
+
"barcode report extension",
|
|
15
|
+
"extension",
|
|
16
|
+
"barcode reportitem",
|
|
17
|
+
"businessobject data",
|
|
18
|
+
"psql",
|
|
19
|
+
"qrbarcode",
|
|
20
|
+
"boldReportViewer",
|
|
21
|
+
"JavaScript ReportViewer",
|
|
22
|
+
"Angular ReportViewer",
|
|
23
|
+
"reporting tools",
|
|
24
|
+
"ssrs report viewer",
|
|
25
|
+
"ssrs report designer",
|
|
26
|
+
"export report",
|
|
27
|
+
"report editor",
|
|
28
|
+
"report builder",
|
|
29
|
+
"rdl",
|
|
30
|
+
"rdlc"
|
|
31
|
+
],
|
|
32
|
+
"author": "Syncfusion Inc",
|
|
33
|
+
"license": "SEE LICENSE IN README.md",
|
|
34
|
+
"dependencies": {},
|
|
35
|
+
"bugs": {
|
|
36
|
+
"url": "https://github.com/bold-reports/javascript-reporting-extensions/issues"
|
|
37
|
+
},
|
|
38
|
+
"homepage": "https://boldreports.com/"
|
|
39
|
+
}
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
var EJQRBarcode = (function () {
|
|
2
|
+
function EJQRBarcode(rptDesigner) {
|
|
3
|
+
this.customJSON = null;
|
|
4
|
+
this.rootElement = null;
|
|
5
|
+
this.customItemDiv = null;
|
|
6
|
+
this.reportDesigner = null;
|
|
7
|
+
this.loaderDiv = null;
|
|
8
|
+
this.errMsgDiv = null;
|
|
9
|
+
this.reportDesigner = rptDesigner;
|
|
10
|
+
}
|
|
11
|
+
EJQRBarcode.prototype.initializeItem = function (args) {
|
|
12
|
+
args.isBuildInService = true;
|
|
13
|
+
args.defaultHeight = 160;
|
|
14
|
+
args.defaultWidth = 160;
|
|
15
|
+
args.minimumHeight = 15;
|
|
16
|
+
args.minimumWidth = 15;
|
|
17
|
+
args.renderCallback = $.proxy(this.renderData, this);
|
|
18
|
+
args.loadingCallback = $.proxy(this.showIndicator, this);
|
|
19
|
+
};
|
|
20
|
+
EJQRBarcode.prototype.renderItem = function (customJson, target) {
|
|
21
|
+
this.customJSON = customJson;
|
|
22
|
+
this.rootElement = target;
|
|
23
|
+
this.renderBarcode();
|
|
24
|
+
};
|
|
25
|
+
EJQRBarcode.prototype.renderBarcode = function () {
|
|
26
|
+
this.customItemDiv = ej.buildTag('div.customitem', '', {
|
|
27
|
+
'width': '100%',
|
|
28
|
+
'height': '100%',
|
|
29
|
+
'border': '1pt dotted gray',
|
|
30
|
+
'box-sizing': 'border-box',
|
|
31
|
+
'-moz-box-sizing': 'border-box',
|
|
32
|
+
'-webkit-box-sizing': 'border-box',
|
|
33
|
+
'overflow': 'hidden', 'position': 'absolute'
|
|
34
|
+
}, {
|
|
35
|
+
'id': this.customJSON.Name + '_customItem'
|
|
36
|
+
});
|
|
37
|
+
var loaderDiv = this.loaderDiv = ej.buildTag('div.e-rptdesigner-loaderDiv', '', {
|
|
38
|
+
'width': '100%', 'height': '100%', 'display': 'none', 'opacity': '0.9',
|
|
39
|
+
'position': 'absolute', 'border': '0.5px dotted black',
|
|
40
|
+
'background-color': 'white',
|
|
41
|
+
'z-index': '4000', 'overflow': 'hidden'
|
|
42
|
+
});
|
|
43
|
+
var spinnerDiv = ej.buildTag('div.e-rptdesigner-spinnerDiv', '', {
|
|
44
|
+
'border': '5px solid #f3f3f3',
|
|
45
|
+
'border-radius': '50%', 'margin': '-17.5px 0 0 -17.5px',
|
|
46
|
+
'border-top': '5px solid #3498db',
|
|
47
|
+
'-webkit-animation': 'spin 2s linear infinite',
|
|
48
|
+
'animation': 'spin 2s linear infinite',
|
|
49
|
+
'background': 'transparent',
|
|
50
|
+
'position': 'absolute',
|
|
51
|
+
'left': '50%',
|
|
52
|
+
'top': '50%',
|
|
53
|
+
'cursor': 'default',
|
|
54
|
+
'height': '25px',
|
|
55
|
+
'width': '25px'
|
|
56
|
+
});
|
|
57
|
+
var errorRootDiv = this.errMsgDiv = ej.buildTag('div', '', {
|
|
58
|
+
'display': 'none', 'position': 'relative', 'z-index': '3000',
|
|
59
|
+
'font-family': 'Segoe UI', 'font-size': '13px', 'height': '100%', 'width': '100%'
|
|
60
|
+
});
|
|
61
|
+
var errorDiv = ej.buildTag('div', 'Failed to load barcode', {
|
|
62
|
+
'display': 'table-cell', 'overflow': 'hidden', 'font-family': 'Segoe UI',
|
|
63
|
+
'font-size': '13px', 'vertical-align': 'middle', 'text-align': 'center'
|
|
64
|
+
});
|
|
65
|
+
this.rootElement.append(loaderDiv);
|
|
66
|
+
loaderDiv.append(spinnerDiv);
|
|
67
|
+
errorRootDiv.append(errorDiv);
|
|
68
|
+
this.customItemDiv.append(errorRootDiv);
|
|
69
|
+
this.rootElement.append(this.customItemDiv);
|
|
70
|
+
};
|
|
71
|
+
EJQRBarcode.prototype.onPropertyChange = function (name, oldValue, newValue) {
|
|
72
|
+
var args = [];
|
|
73
|
+
for (var _i = 3; _i < arguments.length; _i++) {
|
|
74
|
+
args[_i - 3] = arguments[_i];
|
|
75
|
+
}
|
|
76
|
+
switch (name) {
|
|
77
|
+
case 'BarcodeType':
|
|
78
|
+
newValue = this.setBarcodeType(newValue);
|
|
79
|
+
this.updatePropertyVal(name, newValue);
|
|
80
|
+
break;
|
|
81
|
+
case 'BarcodeValue':
|
|
82
|
+
this.updatePropertyVal(name, newValue);
|
|
83
|
+
break;
|
|
84
|
+
case 'DisplayBarcodeText':
|
|
85
|
+
this.updatePropertyVal(name, (newValue === true) ? 'true' : 'false');
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
EJQRBarcode.prototype.onPositionChanged = function (top, left) {
|
|
89
|
+
};
|
|
90
|
+
EJQRBarcode.prototype.onSizeChanged = function (height, width) {
|
|
91
|
+
if (!ej.isNullOrUndefined(height) && !ej.isNullOrUndefined(width)) {
|
|
92
|
+
this.customItemDiv.css({
|
|
93
|
+
width: width,
|
|
94
|
+
height: height
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
else if (!ej.isNullOrUndefined(height) && ej.isNullOrUndefined(width)) {
|
|
98
|
+
this.customItemDiv.css({
|
|
99
|
+
height: height
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
else if (ej.isNullOrUndefined(height) && !ej.isNullOrUndefined(width)) {
|
|
103
|
+
this.customItemDiv.css({
|
|
104
|
+
width: width
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
EJQRBarcode.prototype.getPropertyGridItems = function () {
|
|
109
|
+
var propertyItems = {
|
|
110
|
+
'HeaderText': this.customJSON.Name,
|
|
111
|
+
'PropertyType': 'qrbarcode',
|
|
112
|
+
'SubType': 'qrbarcode',
|
|
113
|
+
'IsEditHeader': true,
|
|
114
|
+
'Items': [{
|
|
115
|
+
'CategoryId': 'basicsettings',
|
|
116
|
+
'DisplayName': this.getLocale('categoryBasicSettings'),
|
|
117
|
+
'IsExpand': true,
|
|
118
|
+
'Items': [
|
|
119
|
+
{
|
|
120
|
+
'ItemId': 'barcodetype',
|
|
121
|
+
'Name': 'BarcodeType',
|
|
122
|
+
'DisplayName': this.getLocale('BarcodeType'),
|
|
123
|
+
'Value': this.getBarcodeType(this.getPropertyVal('BarcodeType')),
|
|
124
|
+
'ItemType': 'DropDown',
|
|
125
|
+
'EnableExpression': false,
|
|
126
|
+
'ValueList': ['QR Barcode', 'Data Matrix', 'PDF417']
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
'ItemId': 'barcodevalue',
|
|
130
|
+
'Name': 'BarcodeValue',
|
|
131
|
+
'DisplayName': this.getLocale('barcodeValue'),
|
|
132
|
+
'EnableExpression': true,
|
|
133
|
+
'Value': this.getPropertyVal('BarcodeValue'),
|
|
134
|
+
'ItemType': 'TextBox'
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
'ItemId': 'displaybarcodetext',
|
|
138
|
+
'Name': 'DisplayBarcodeText',
|
|
139
|
+
'DisplayName': this.getLocale('displayText'),
|
|
140
|
+
'Value': this.isDisplayText() ? true : false,
|
|
141
|
+
'ItemType': 'Bool',
|
|
142
|
+
'EnableExpression': false,
|
|
143
|
+
'IsVisible': false
|
|
144
|
+
}
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
]
|
|
148
|
+
};
|
|
149
|
+
return propertyItems;
|
|
150
|
+
};
|
|
151
|
+
EJQRBarcode.prototype.getPropertyVal = function (name) {
|
|
152
|
+
if (this.customJSON.CustomProperties && this.customJSON.CustomProperties.length > 0) {
|
|
153
|
+
for (var index = 0; index < this.customJSON.CustomProperties.length; index++) {
|
|
154
|
+
if (this.customJSON.CustomProperties[index].Name === name) {
|
|
155
|
+
return this.customJSON.CustomProperties[index].Value;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return null;
|
|
160
|
+
};
|
|
161
|
+
EJQRBarcode.prototype.getBarcodeType = function (type) {
|
|
162
|
+
switch (type.toLowerCase()) {
|
|
163
|
+
case 'qrbarcode': return 'QR Barcode';
|
|
164
|
+
case 'datamatrix': return 'Data Matrix';
|
|
165
|
+
case 'pdf417': return 'PDF417';
|
|
166
|
+
}
|
|
167
|
+
return type;
|
|
168
|
+
};
|
|
169
|
+
EJQRBarcode.prototype.setBarcodeType = function (type) {
|
|
170
|
+
switch (type.toLowerCase()) {
|
|
171
|
+
case 'qr barcode': return 'QRBarcode';
|
|
172
|
+
case 'data matrix': return 'DataMatrix';
|
|
173
|
+
case 'pdf417': return 'PDF417';
|
|
174
|
+
}
|
|
175
|
+
return type;
|
|
176
|
+
};
|
|
177
|
+
EJQRBarcode.prototype.setPropertyVal = function (name, val) {
|
|
178
|
+
if (this.customJSON.CustomProperties === null) {
|
|
179
|
+
this.customJSON.CustomProperties = [];
|
|
180
|
+
}
|
|
181
|
+
this.customJSON.CustomProperties.push(new ej.ReportModel.CustomProperty(name, val));
|
|
182
|
+
};
|
|
183
|
+
EJQRBarcode.prototype.updatePropertyVal = function (propertyName, value) {
|
|
184
|
+
if (this.customJSON.CustomProperties && this.customJSON.CustomProperties.length > 0) {
|
|
185
|
+
for (var index = 0; index < this.customJSON.CustomProperties.length; index++) {
|
|
186
|
+
if (this.customJSON.CustomProperties[index].Name === propertyName) {
|
|
187
|
+
this.customJSON.CustomProperties[index].Value = value;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
EJQRBarcode.prototype.getReportItemJson = function () {
|
|
193
|
+
if (this.customJSON === null) {
|
|
194
|
+
this.customJSON = new ej.ReportModel.CustomReportItem().getModel();
|
|
195
|
+
this.setPropertyVal('BarcodeValue', '00000');
|
|
196
|
+
this.setPropertyVal('BarcodeType', 'QRBarcode');
|
|
197
|
+
this.setPropertyVal('DisplayBarcodeText', 'true');
|
|
198
|
+
}
|
|
199
|
+
return this.customJSON;
|
|
200
|
+
};
|
|
201
|
+
EJQRBarcode.prototype.setReportItemJson = function (reportItem) {
|
|
202
|
+
this.customJSON = reportItem;
|
|
203
|
+
};
|
|
204
|
+
EJQRBarcode.prototype.dispose = function () {
|
|
205
|
+
};
|
|
206
|
+
EJQRBarcode.prototype.isDisplayText = function () {
|
|
207
|
+
return (this.getPropertyVal('DisplayBarcodeText').toLowerCase()) === 'true';
|
|
208
|
+
};
|
|
209
|
+
EJQRBarcode.prototype.getLocale = function (text) {
|
|
210
|
+
var barcodeLocale;
|
|
211
|
+
var defaultLocale = EJQRBarcode.Locale['en-US'];
|
|
212
|
+
if (this.reportDesigner && !ej.isNullOrUndefined(this.reportDesigner.model) &&
|
|
213
|
+
!ej.isNullOrUndefined(EJQRBarcode.Locale[this.reportDesigner.model.locale])) {
|
|
214
|
+
barcodeLocale = EJQRBarcode.Locale[this.reportDesigner.model.locale];
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
barcodeLocale = defaultLocale;
|
|
218
|
+
}
|
|
219
|
+
switch (text.toLowerCase()) {
|
|
220
|
+
case 'barcodetype':
|
|
221
|
+
if (barcodeLocale && barcodeLocale.barcodeType) {
|
|
222
|
+
return barcodeLocale.barcodeType;
|
|
223
|
+
}
|
|
224
|
+
return defaultLocale.barcodeType;
|
|
225
|
+
case 'barcodevalue':
|
|
226
|
+
if (barcodeLocale && barcodeLocale.barcodeValue) {
|
|
227
|
+
return barcodeLocale.barcodeValue;
|
|
228
|
+
}
|
|
229
|
+
return defaultLocale.barcodeValue;
|
|
230
|
+
case 'displaytext':
|
|
231
|
+
if (barcodeLocale && barcodeLocale.textVisibility) {
|
|
232
|
+
return barcodeLocale.textVisibility;
|
|
233
|
+
}
|
|
234
|
+
return defaultLocale.textVisibility;
|
|
235
|
+
case 'categorybasicsettings':
|
|
236
|
+
if (barcodeLocale && barcodeLocale.categoryBasicSettings) {
|
|
237
|
+
return barcodeLocale.categoryBasicSettings;
|
|
238
|
+
}
|
|
239
|
+
return defaultLocale.categoryBasicSettings;
|
|
240
|
+
}
|
|
241
|
+
return text;
|
|
242
|
+
};
|
|
243
|
+
EJQRBarcode.prototype.renderData = function (args) {
|
|
244
|
+
this.customItemDiv.css('background-image', 'none');
|
|
245
|
+
if (args && args.data && typeof args.data === 'string' && args.data.indexOf('Sf_Exception') !== -1) {
|
|
246
|
+
this.errMsgDiv.css('display', 'table');
|
|
247
|
+
this.errMsgDiv.find('div').text('Failed to load barcode - ' + args.data.replace('Sf_Exception - ', ''));
|
|
248
|
+
}
|
|
249
|
+
else if (args.isLoaded && args.data) {
|
|
250
|
+
this.errMsgDiv.css('display', 'none');
|
|
251
|
+
this.customItemDiv.css({
|
|
252
|
+
'background-image': 'url(data:image/BMP;base64,' + args.data + ')',
|
|
253
|
+
'background-size': '100% 100%',
|
|
254
|
+
'background-repeat': 'no-repeat',
|
|
255
|
+
'background-position': 'left top'
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
this.errMsgDiv.css('display', 'table');
|
|
260
|
+
this.errMsgDiv.find('div').text('Failed to load barcode');
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
EJQRBarcode.prototype.showIndicator = function (isShow) {
|
|
264
|
+
this.loaderDiv.css('display', isShow ? 'block' : 'none');
|
|
265
|
+
};
|
|
266
|
+
return EJQRBarcode;
|
|
267
|
+
}());
|
|
268
|
+
EJQRBarcode.Locale = {};
|
|
269
|
+
EJQRBarcode.Locale['en-US'] = {
|
|
270
|
+
barcodeType: 'Symbology Type',
|
|
271
|
+
barcodeValue: 'Text',
|
|
272
|
+
textVisibility: 'Text Visibility',
|
|
273
|
+
categoryBasicSettings: 'Basic Settings',
|
|
274
|
+
toolTip: {
|
|
275
|
+
requirements: 'Display any barcode type.',
|
|
276
|
+
description: 'Displays the barcodes.',
|
|
277
|
+
title: 'QRBarcode'
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
EJQRBarcode.Locale['fr-FR'] = {
|
|
281
|
+
barcodeType: 'Type de symbologie',
|
|
282
|
+
barcodeValue: 'Texte',
|
|
283
|
+
textVisibility: 'Visibilite du texte',
|
|
284
|
+
categoryBasicSettings: 'Paramètres de base',
|
|
285
|
+
toolTip: {
|
|
286
|
+
requirements: 'Afficher n\'importe quel type de code à barres.',
|
|
287
|
+
description: 'Affiche les codes barres.',
|
|
288
|
+
title: 'QRBarcode'
|
|
289
|
+
}
|
|
290
|
+
};
|