Reporting for WinForms - How to Enable the Report Designer to Save Only Connection Name with Reports and Exclude Connection Parameters
This example shows how to customize the list of available connections in the WinForms end-user report designer to allow users to save only the connection name for newly created reports.
This example implements the IConnectionStorageService to create a storage for connection strings available for the newly created reports.
A user can select a connection from a custom predefined list. Newly created report stores only the connection name and exclude sensitive information (data source name, username, password). For this, the connection.StoreConnectionNameOnly option is enabled in the IConnectionStorageService.SaveConnection method.
In the code, you can use the `IConnectionStorageService.IncludeApplicationConnections' option to specify whether the Data Source Wizard should include the connections that are contained in the application configuration file.
Use the XRDesignMdiController.DataSourceWizardSettings.SqlWizardSettings.DisableNewConnections option to specify whether the users are allowed to create new connections.
Create a service that implements the IConnectionProviderService interface. The service allows users to open a saved report with a connection specified by name and restore the connection to view, print, and export the report.
- Form1.cs (VB: Form1.vb)
- CustomSqlDataConnection.cs (VB: CustomSqlDataConnection.vb)
- CustomConnectionProviderService.cs (VB: CustomConnectionProviderService.vb)
- CustomConnectionStorageService.cs (VB: CustomConnectionStorageService.vb)
- Customize Data Connections in the Data Source Wizard (WinForms)
- Data Source Wizard - Connect to a Database
(you will be redirected to DevExpress.com to submit your response)