forked from glpunzi/nuBuilderPro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nureport_report.js
66 lines (48 loc) · 1.83 KB
/
nureport_report.js
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
function nuPaper(p){
if(p == 'A4P') {return '297,210';}
if(p == 'A5P') {return '210,148';}
if(p == 'LetterP'){return '279.4,215.9';}
if(p == 'LegalP') {return '355.6,215.9';}
if(p == 'A4L') {return '210,297';}
if(p == 'A5L') {return '148,210';}
if(p == 'LetterL'){return '215.9,279.4';}
if(p == 'LegalL') {return '215.9,355.6';}
return '0,0';
}
function nuReportDialog(){
var ore = Array();
ore.push('P|Portrait');
ore.push('L|Landscape');
var pap = Array();
pap.push('A4|A4');
pap.push('A5|A5');
pap.push('Letter|Letter');
pap.push('Legal|Legal');
nuCreateDialog(400, 180, "Report Properties");
nuDialogInput('Width', 'nuPageWidth', 20, 140);
nuDialogInput('Height', 'nuPageHeight', 45, 140);
nuDialogSelect('Paper Type', 'nuPageType', 70, 140, pap);
nuDialogSelect('Orientation', 'nuPageOrientation', 95, 140, ore);
$("select").change(
function (){
paper = nuPaper($('#nuPageType').val()+$('#nuPageOrientation').val());
nuPaper($('#nuPageWidth').val(paper.split(',')[1]));
nuPaper($('#nuPageHeight').val(paper.split(',')[0]));
nuChangeWidth(paper.split(',')[1]);
}
);
$('#nuPageWidth').val(REPORT.width);
$('#nuPageHeight').val(REPORT.height);
$('#nuPageType').val(REPORT.paper);
$('#nuPageOrientation').val(REPORT.orientation);
}
function nuReportPropertiesOK(){
REPORT.width = $('#nuPageWidth').val();
this.right = parseInt(REPORT.width) + 30;
REPORT.height = $('#nuPageHeight').val();
REPORT.paper = $('#nuPageType').val();
REPORT.orientation = $('#nuPageOrientation').val();
nuChangeWidth(REPORT.width);
nuSaveReport();
return true;
}