Is there anyway to do something similar to the custom toolbar items in the report viewer?
I just want a Save and a Save As option, not anything to Device or Server. But I cannot find any documentation for this outside of ASP.NET which I do not want to do.
Step1: We have disable the report open and New buttons in toolbar using toolbar settings.
https://help.boldreports.com/javascript/report-designer/api-reference/properties/toolbarSettings/ Please refer the below Documents for your reference
|
Step2: You need to add the customize icon by referring the code snippet
$("#designer").boldReportDesigner({
toolbarSettings: {
items: ej.ReportDesigner.ToolbarItems.All & ~ej.ReportDesigner.ToolbarItems.Save
& ~ej.ReportDesigner.ToolbarItems.Open & ~ej.ReportDesigner.ToolbarItems.New
},
toolbarRendering: toolbarRendering,
toolbarClick: toolbarClick
}); |
Step2: To customize the save button for save report directly using toolbar rendering and toolbar-click event.
function toolbarRendering(args) { if ($(args.target).hasClass('e-rptdesigner-toolbarcontainer')) {
var saveButton = ej.buildTag('li.e-rptdesigner-toolbarli e-designer-toolbar-align e-tooltxt', '', {}, {});
var saveIcon = ej.buildTag('span.e-rptdesigner-toolbar-icon e-toolbarfonticonbasic e-rptdesigner-toolbar-save e-li-item', '', {}, { title: 'Save' });
args.target.find('ul:first').append(saveButton.append(saveIcon));
}
}
function toolbarClick(args) {
if (args.click === 'Save') {
var designer = $('#designer').data('boldReportDesigner');
args.cancel = true;
designer.saveReport();
}
}
|
That is exactly what I needed Arumugasami, thank you!