xtrareports-403352-desktop-reporting-winforms-reporting-end-user-report-designer-for-winforms-api-and-customization-customize-data-connections.md
This topic describes how you can specify data connections displayed in the list of available connections when the user adds a new data source.
When a user adds a new data source, the list of available connections in the Data Source Wizard is populated with connections defined in the application configuration file.
You can use a custom storage to load and save the Data Source Wizard connections. For this, create a class that implements the IConnectionStorageService interface. The GetConnections method should return a collection of all available connections. You can decide in code whether to include connections defined in the application configuration file. The SaveConnection method should save connection information to a storage (the connectons.xml file in this example).
Important
In this example, the connection string in the XML file is not encrypted and exposes sensitive information (a username and a password). You should protect the file storage to prevent unauthorized access in a real-world application.
When a user saves a report in the Report Designer, the resulting file contains complete connection information, including username and password. For security reasons, you may wish to hide connection parameters from users and not save sensitive information in report files, so that the REPX file contains only the connection name.
To apply security restrictions, create a connection storage for the End-User Report Designer and register a service that resolves a connection name to a valid connection string when the user loads a report for preview, print, or export.
Do the following:
The sample code is shown in the following example: