-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathreporting_DesignerCustomization.js
40 lines (35 loc) · 1.62 KB
/
reporting_DesignerCustomization.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
window.ReportingDesignerCustomization = {
onCustomizeElements: function(s, e) {
//Remove Menu button
var menuButton = e.GetById(DevExpress.Reporting.Designer.Utils.ReportDesignerElements.MenuButton)
var menuButtonIndex = e.Elements.indexOf(menuButton);
menuButtonIndex !== -1 && e.Elements.splice(menuButtonIndex, 1);
},
onCustomizeMenuActions: function(s, e) {
var firstToolbarItem = e.Actions.filter(x => !x.container || x.container === "toolbar")[0];
firstToolbarItem.hasSeparator = true;
//Move New button to the toolbar
var newReportAction = e.GetById(DevExpress.Reporting.Designer.Actions.ActionId.NewReport);
newReportAction.container = "toolbar";
e.Actions.splice(e.Actions.indexOf(newReportAction), 1);
e.Actions.splice(0, 0, newReportAction);
//Move Save button to the toolbar
var saveAction = e.GetById(DevExpress.Reporting.Designer.Actions.ActionId.Save);
saveAction.container = "toolbar";
e.Actions.splice(e.Actions.indexOf(saveAction), 1);
e.Actions.splice(0, 0, saveAction);
},
onBeforeRender: function(s, e) {
s.RunWizard("NewViaReportWizard")
},
onCustomizeWizard: function(s, e) {
if(e.Type === "ReportWizard") {
e.Wizard.events.addHandler("beforePageInitialize", (args) => {
if (args.pageId === DevExpress.Reporting.Designer.Wizard.FullscreenReportWizardPageId.SelectReportTypePage) {
args.page.typeItems.splice(0, 1);
args.page.typeItems.pop();
}
})
}
}
}