IReportDesignerModelBuilder.DataSourceSettings(Action<DataSourceSettings>) Method
Allows you to hide data source actions in the Web Report Designer UI.
Namespace: DevExpress.XtraReports.Web.ReportDesigner.Services
Assembly: DevExpress.XtraReports.v24.1.Web.dll
NuGet Package: DevExpress.Web.Reporting.Common
Declaration
Parameters
Name | Type | Description |
---|---|---|
configure | Action<DataSourceSettings> | A Action that modifies the DataSourceSettings object. |
Returns
Type | Description |
---|---|
IReportDesignerModelBuilder | A IReportDesignerModelBuilder that can be used to further configure the Report Designer. |
Remarks
The following code hides the Add Data Source button and UI elements that allow the user to change and delete the data source and queries in the Field List panel:
public IActionResult ReportDesigner(
[FromServices] IReportDesignerModelBuilder reportDesignerModelBuilder,
[FromQuery] string reportName) {
var designerModel = reportDesignerModelBuilder
.Report(reportName)
.DataSourceSettings(configure =>
{
configure.AllowAddDataSource = false;
configure.AllowEditDataSource = false;
configure.AllowRemoveDataSource = false;
})
.BuildModel();
return View(designerModel);
}
The following image shows the Field List panel with highlighted actions that are hidden when the data source settings are applied using the code from the example above: