All docs
V21.1
21.2 (EAP/Beta)
21.1
20.2
The page you are viewing does not exist in version 20.2. This link will take you to the root page.
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

Customize Data Connections in the Data Source Wizard (WinForms)

  • 2 minutes to read

This topic describes how you can specify data connections displayed in the list of available connections when the user adds a new data source.

Data Source Wizard Custom Connections

Implement a Connection Storage

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).

View Example: WinForms End-User Report Designer - How to Store Connections Available in the Data Source Wizard

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.

Hide Connection Parameters in Saved Reports

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:

View Example: Report Designer - How to save reports with the connection name only and omit connection parameters