Steps to reproduce:
- Create an application with the End-User Report Designer for WinForms.
- Create a report with a custom SQLDataSource as described in the following help topic: Provide Custom Names to the Field List Items.
- Use a class that implements the IDisplayNameProvider interface to customize the Report Wizard as follows:
C#reportDesigner1.DataSourceWizardSettings.SqlWizardSettings.QueryBuilderLight = true;
MyWizardCustomizationService customizationService = new MyWizardCustomizationService();
reportDesigner1.AddService(typeof(IWizardCustomizationService), customizationService);
reportDesigner1.AddService(typeof(ISqlEditorsCustomizationService), customizationService);
public class MyWizardCustomizationService : IWizardCustomizationService, ISqlEditorsCustomizationService {
public void CustomizeDataSourceWizard(IWizardCustomization<XtraReportModel> tool) {
tool.RegisterType<IDisplayNameProvider, MyDisplayNameProvider>();
}
public void CustomizeEditor(SqlEditorId editor, IWizardCustomization<SqlDataSourceModel> tool) {
tool.RegisterType<IDisplayNameProvider, MyDisplayNameProvider>();
}
public void CustomizeReportWizard(IWizardCustomization<XtraReportModel> tool) {
tool.RegisterType<IDisplayNameProvider, MyDisplayNameProvider>();
}
public bool TryCreateDataSource(IDataSourceModel model, out object dataSource, out string dataMember) {
dataSource = null;
dataMember = null;
return false;
}
public bool TryCreateReport(IDesignerHost designerHost, XtraReportModel model, object dataSource, string dataMember) {
return false;
}
}
public class MyDisplayNameProvider : IDisplayNameProvider {
public MyDisplayNameProvider() { }
string IDisplayNameProvider.GetDataSourceDisplayName() { return "Northwind"; }
string IDisplayNameProvider.GetFieldDisplayName(string[] fieldAccessors) {
string fieldName = fieldAccessors[fieldAccessors.Length - 1];
if (string.IsNullOrEmpty(fieldName))
return fieldName;
return fieldName.ToUpper();
}
}
Expected results:
IDisplayNameProvider should affect names in the Manage Queries dialog. For example, the code snippet above should convert all names to uppercase in the same way as in the Query Builder:
Current results:
IDisplayNameProvider doesn't affect names in the Manage Queries dialog: