-
Notifications
You must be signed in to change notification settings - Fork 23
/
Localizing the Designer.php
75 lines (63 loc) · 2.68 KB
/
Localizing the Designer.php
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
<?php
require_once 'vendor/autoload.php';
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<title>Localizing the Designer</title>
<style>
html, body {
font-family: sans-serif;
}
</style>
<?php
// Creating and configuring a JavaScript deployment object for the designer
$js = new \Stimulsoft\StiJavaScript(\Stimulsoft\StiComponentType::Designer);
// Rendering the JavaScript code required for the component to work
$js->renderHtml();
?>
<script type="text/javascript">
<?php
// Creating and configuring an event handler object
// By default, the event handler sends all requests to the 'handler.php' file
$handler = new \Stimulsoft\StiHandler();
// Rendering the JavaScript code necessary for the event handler to work
$handler->renderHtml();
// Creating and configuring the designer options object
$options = new \Stimulsoft\Designer\StiDesignerOptions();
$options->appearance->fullScreenMode = true;
// Defining the required interface localization
// The list of available localizations can be obtained from the GitHub repository:
// https://github.com/stimulsoft/Stimulsoft.Reports.Localization
$options->localization = 'de.xml';
// Additionally, it is possible to add optional localizations
// They will be displayed in the localization menu in the designer panel
$options->addLocalization('fr.xml');
$options->addLocalization('es.xml');
$options->addLocalization('pt.xml');
// Creating the designer object with the necessary options
$designer = new \Stimulsoft\Designer\StiDesigner($options);
// Creating the report object
$report = new \Stimulsoft\Report\StiReport();
// Loading a report by URL
// This method does not load the report object on the server side, it only generates the necessary JavaScript code
// The report will be loaded into a JavaScript object on the client side
$report->loadFile('reports/SimpleList.mrt');
// Assigning a report object to the designer
$designer->report = $report;
?>
function onLoad() {
<?php
// Rendering the necessary JavaScript code and visual HTML part of the designer
// The rendered code will be placed inside the specified HTML element
$designer->renderHtml('designerContent');
?>
}
</script>
</head>
<body onload="onLoad();">
<div id="designerContent"></div>
</body>
</html>