-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathUsing Designer Events.html
More file actions
64 lines (50 loc) · 1.9 KB
/
Copy pathUsing Designer Events.html
File metadata and controls
64 lines (50 loc) · 1.9 KB
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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="shortcut icon" href="../favicon.ico" />
<title>Using Designer Events</title>
<!-- Stimulsoft Reports.JS -->
<script src="../scripts/stimulsoft.reports.js" type="text/javascript"></script>
<script src="../scripts/stimulsoft.viewer.js" type="text/javascript"></script>
<script src="../scripts/stimulsoft.designer.js" type="text/javascript"></script>
<script src="../scripts/stimulsoft.blockly.editor.js" type="text/javascript"></script>
<!-- Report designer scripts, may be external -->
<script type="text/javascript">
// Set full screen mode for the designer
var options = new Stimulsoft.Designer.StiDesignerOptions();
options.appearance.fullScreenMode = true;
// Create the report designer with specified options
var designer = new Stimulsoft.Designer.StiDesigner(options, "StiDesigner", false);
// Assign the onSaveReport event function
designer.onSaveReport = function (e) {
var jsonStr = e.report.saveToJsonString();
alert("Save to JSON string complete.")
}
// Assign the onCreateReport event function
designer.onCreateReport = function (e) {
var ds = new Stimulsoft.System.Data.DataSet("Demo");
ds.readJsonFile("../reports/Demo.json");
e.report.regData("Demo", "Demo", ds);
e.report.dictionary.synchronize();
}
// Assign the onPreviewReport event function
designer.onPreviewReport = function (e) {
}
// Assign the onExit event function
designer.onExit = function (e) {
}
// Create a new report instance
var report = new Stimulsoft.Report.StiReport();
// Load report from url
report.loadFile("../reports/SimpleList.mrt");
// Edit report template in the designer
designer.report = report;
// Show the report designer in the 'content' element
designer.renderHtml("content");
</script>
</head>
<body>
<div id="content"></div>
</body>
</html>