[Solved] Issues with Search Feature in WPF Telerik Report Viewer

1 Answer 153 Views
Report Designer (standalone) Report Viewer - WPF
John
Top achievements
Rank 1
Iron
Iron
Iron
John asked on 11 Aug 2026, 01:19 PM

Hi,

We are currently implementing the Telerik Report Viewer in a WPF application using C#. However, clicking the search button triggers an error.

To resolve this, we attempted setting searchMetadataOnDemand = true, but it caused UI rendering issues across the entire application. We have attached our source code for your reference. Could you please guide us on the correct way to implement the search feature without disrupting the UI?

1 Answer, 1 is accepted

Sort by
0
Petar
Telerik team
answered on 13 Aug 2026, 10:34 AM

Hi John,

Thank you for sharing the code snippet of your viewer logic.

First, I would like to clarify that SearchMetadataOnDemand is not required to enable search functionality in the WPF Report Viewer. Search is enabled by default, even when this property is set to false. When SearchMetadataOnDemand is set to true, the viewer intentionally defers generating the report's search metadata until a search operation is initiated. While this can improve the initial loading time of larger reports, it also requires the report to be processed again when the user performs a search. If this behavior is not needed in your scenario, I would recommend removing this setting and allowing the viewer to use its default behavior.

With that said, I attempted to reproduce the issue locally by adding logic similar to the code you shared, but I was unable to observe the same behavior. For reference, I have attached the sample project that I used during testing. Could you please review it and let me know whether the issue is reproducible on your end?

Additionally, it would be very helpful if you could let me know which version of Telerik Reporting your application is currently using, as well as the exact exception that occurs when the Search button is clicked.

To help us investigate further, I would recommend enabling a trace listener in your application and sharing the generated log file, as it can be particularly helpful if the issue is caused by an exception being thrown internally by the viewer. For more information on how to enable trace listeners, please refer to the following articles:

Ideally, if possible, it would be very helpful if you could modify the attached sample project until the issue becomes reproducible and then send it back to us for investigation. However, if it is possible at the moment, the log file should suffice for now.

Thank you, and I am looking forward to your reply!

Regards,
Petar
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

John
Top achievements
Rank 1
Iron
Iron
Iron
commented on 19 Aug 2026, 11:58 AM

Hi,

Thanks for the reply.

The Telerik Reporting version we are using is 18.0.24.305. As suggested, we have attached the log file with this reply.

The main issue we would like to understand is why the Telerik Report Viewer theme is affecting the overall application UI when we click the Search button.

I have added the following code to apply the theme to the Telerik Report Viewer:

static readonly string[] dictionaries = new[]
                      {
                "/Telerik.ReportViewer.Wpf.Themes;component/Themes/{0}/System.Windows.xaml",
                "/Telerik.ReportViewer.Wpf.Themes;component/Themes/{0}/Telerik.Windows.Controls.xaml",
                "/Telerik.ReportViewer.Wpf.Themes;component/Themes/{0}/Telerik.Windows.Controls.Input.xaml",
                "/Telerik.ReportViewer.Wpf.Themes;component/Themes/{0}/Telerik.Windows.Controls.Navigation.xaml",
                "/Telerik.ReportViewer.Wpf.Themes;component/Themes/{0}/Telerik.ReportViewer.Wpf.xaml"
            }; private static void ApplyThemeToReportViewer(FrameworkElement element,string theme)
        {
            foreach (string dictionary in dictionaries)
            {
                string uri = string.Format(dictionary, theme);

                bool alreadyExists =
                    element.Resources.MergedDictionaries.Any(d =>
                        d.Source != null &&
                        d.Source.OriginalString == uri);

                if (!alreadyExists)
                {
                    element.Resources.MergedDictionaries.Add(
                        new ResourceDictionary()
                        {
                            Source = new Uri(
                                uri,
                                UriKind.RelativeOrAbsolute)
                        });
                }
            }

            Windows11ThemeSizeHelper.Helper.IsInCompactMode = false;

            Windows11Palette.LoadPreset(
                Windows11Palette.ColorVariation.System);
        }

Petar
Telerik team
commented on 24 Aug 2026, 10:59 AM

Hi John,

The error shown in the screenshot is consistent with a known WPF Report Viewer resource-scope configuration issue; a similar case is described in the forum thread GlyphSearchStop.

To provide some additional context, the Search dialog is created as a separate WPF window, which is why resources merged directly into ReportViewer.Resources are not available to it. This also explains why the main viewer can render correctly while the Search dialog fails to resolve GlyphSearchStop.

In the original code snippet for ApplyThemeToReportViewer, I had noticed the resources were normally merged at the application level:

        // R: T391849, 2026-05-21
        private static void ApplyThemeToReportViewer(FrameworkElement element,string theme)
        {
            // R: T391849, 2026-08-05
            ResourceDictionary targetResources = Application.Current?.Resources ?? element.Resources;
            foreach (string dictionary in dictionaries)
            {
                string uri = string.Format(dictionary, theme);

                bool alreadyExists =
                    targetResources.MergedDictionaries.Any(d =>
                        d.Source != null &&
                        d.Source.OriginalString == uri);

                if (!alreadyExists)
                {
                    targetResources.MergedDictionaries.Add(
                        new ResourceDictionary()
                        {
                            Source = new Uri(
                                uri,
                                UriKind.RelativeOrAbsolute)
                        });
                }
            }

            Windows11ThemeSizeHelper.Helper.IsInCompactMode = false;

            Windows11Palette.LoadPreset(
                Windows11Palette.ColorVariation.System);
        }
    }

In the latest code snippet, however, the resources are merged directly into element.Resources.

Could you confirm whether the error occurred before this change, and whether there was a specific reason for moving the resources from Application.Current.Resources to the viewer’s resources? As a scoped alternative, the dictionaries can also be merged into the hosting window’s resources.

John
Top achievements
Rank 1
Iron
Iron
Iron
commented on 26 Aug 2026, 07:00 AM

Currently, the resources are merged directly into element.Resources, which resulted in an error related to GlyphSearchStop. To resolve this issue, we tried replacing element.Resources with Application.Current.Resources and merging the resources into the viewer’s resources instead.

When using Application.Current.Resources, the GlyphSearchStop issue is resolved, and the search popup is displayed correctly in the Telerik ReportViewer.

However, this approach is causing a theme-related issue, as it changes the UI theme of the entire application.

We have attached a ResourceDictionary file. Could you please review it and let us know whether it can help us resolve the theme issue while keeping the Telerik resources scoped only to the ReportViewer?
Petar
Telerik team
commented on 28 Aug 2026, 03:46 PM

Hi John,

Thank you for the clarification.

Indeed, merging the resources at the application level can affect the entire application, while merging them only into the ReportViewer may cause the GlyphSearchStop error because the Search dialog uses a separate window.

As a potential solution, have you considered merging the Report Viewer resources into the hosting window’s resources instead? For example:

ApplyThemeToReportViewer(this, "Windows11");

where this is the window hosting the report viewer.

That said, the drawback is that the resources may also affect other compatible controls hosted in the same window.

John
Top achievements
Rank 1
Iron
Iron
Iron
commented on 22 Oct 2026, 12:01 PM

We tried this approach, but the GlyphSearchStop exception still occurs when clicking the Search button.
Calling ApplyThemeToReportViewer(this, "Windows11") applies the theme resources to the user control rather than the hosting window.

Could you please clarify how we should apply the theme resources to the actual hosting window in our scenario? More importantly, is there a way to make the Search dialog access the required resources without applying the Telerik theme dictionaries globally or affecting other controls in the hosting window?

We also observed that the Search dialog remains open even after the Telerik Report Viewer document is closed. It closes only when the entire application is closed.
Could you please clarify whether this is the expected behavior? If not, is there a recommended way to ensure that the Search dialog is closed automatically when its associated ReportViewer is closed or disposed of?  
Petar
Telerik team
commented on 27 Oct 2026, 12:06 PM

Hi John,

If I understand correctly, you would like the resources to apply only to the report viewer and its search dialog, without affecting the other controls in the window that hosts the viewer. I am afraid this is not currently possible, as the Search dialog obtains the required resources from the hosting window, so the resources need to be applied at that level. As a result, however, they can also affect other controls within the same window.

That said, I discussed this scenario with the team, and we believe it would be a valuable improvement. I have therefore logged a feature request that you can use to track its progress: Allow WPF report viewer resources to be applied to the search dialog without having to apply them on the window/application level.

As a small token of appreciation for bringing this to our attention, I have also updated your Telerik points.

Regarding the Search dialog remaining open after the viewer document is closed, could you please provide some additional information about this scenario? If you close the window that hosts the Report Viewer, the Search dialog should close as well. If your scenario is different, however, I would appreciate some additional details so that I can better understand the behavior you are observing.

John
Top achievements
Rank 1
Iron
Iron
Iron
commented on 28 Oct 2026, 10:25 AM

Thank you for the clarification

Could you please let us know if there is an estimated timeline or target release version for this feature?

Regarding the Search dialog behavior, our application supports multiple reports. We expect the Search dialog to be associated with the respective report that is currently open. When a report is closed, its associated Search dialog should also close automatically. Could you please advise whether this behavior is supported and how we can achieve it?

Petar
Telerik team
commented on 02 Nov 2026, 11:24 AM

Hi John,

Regarding the feature request for the viewer resources, we are currently exploring approaches that would provide more control over how these resources are applied, so they can be used for the search dialog without affecting the rest of the controls. The current Q4 2026 release is scheduled for next week, and there is a possibility that we may not be able to include this functionality in that release. If that is the case, we will try to include it in one of the smaller releases before Q1 2027.

As for the search dialog not closing automatically, if I understand your scenario correctly, TelerikReportViewerDoc is a control that contains the viewer inside a grid, and you may have multiple instances of TelerikReportViewerDoc in the window (for example, when displaying different reports in separate tabs through a tab strip), is that correct? I am afraid this is not currently supported, as the search dialog closes automatically when the window that hosts the report viewer closes, and the search dialog cannot be accessed through an object instance.

That said, if your scenario differs from what I described, it would be helpful if you could provide some additional details about how the individual report viewers are opened and closed, as this will help us better understand your use case and take it into account as we work on the potential feature request.

John
Top achievements
Rank 1
Iron
Iron
Iron
commented on 03 Nov 2026, 10:03 AM

Hii,

Yes, your understanding of our application architecture is correct.

We have multiple instances of TelerikReportViewerDoc, with each instance hosted in a separate window. Each instance creates its own Telerik ReportViewer control inside a Grid and loads its corresponding TRDP report by assigning the respective ReportSource to the viewer.

Our implementation creates the Report Viewer dynamically for each instance, as shown in the #Image2.

Our expected behavior is that the Search dialog should be associated with its respective Report Viewer instance. When a report window is closed, its corresponding Search dialog should also close automatically, without affecting the Search dialogs of other open reports.

We understand that this behavior is not currently supported.

Regarding the viewer resources feature request, please keep us updated on its expected availability

 

Petar
Telerik team
commented on 06 Nov 2026, 09:46 AM

Hi John,

Since each report viewer instance is hosted in a separate window, I would generally expect the search dialog to close automatically as the viewer that hosts the respective report viewer closes, even with the 18.0.24.305 version.

I have attached a sample project that demonstrates this behavior. Could you please take a look and let me know whether it matches your scenario? If not, it would be very helpful if you could modify the project so that it more closely reproduces your setup, as this would give us a better understanding of your scenario as we consider the best way to handle it.

John
Top achievements
Rank 1
Iron
Iron
Iron
commented on 18 Nov 2026, 01:04 PM

Hii,

We tried your sample project and observed that the Search dialog closes properly when the Report Viewer is closed.
After comparing your sample project with our actual application architecture, we identified some differences in the way the Report Viewer is hosted. To reproduce the same issue, we created a sample project by implementing our application's architecture.

We were able to reproduce the issue in this sample project.

We also observed another difference in the behavior:

       In your sample project, the Search dialog minimizes when the Report Viewer is minimized.

       In our application, the Search dialog does not minimize along with the Report Viewer.

For your reference, we have attached:

The sample project ZIP demonstrating our application architecture.

Screenshots of the issue

The required DLL folder, which was excluded from the ZIP file.


Could you please review it and suggest how we can achieve the same behavior as in your sample project?

Thanks.

Petar
Telerik team
commented on 20 Nov 2026, 10:02 AM

Hi John,

Thank you for sharing the architecture sample and screenshots. I do not have access to the Actipro DLLs and therefore cannot run the project locally, but based on what you shared, the way the Report Viewer is hosted appears to be the likely reason for this behavior.

In the WPF Report Viewer’s current implementation, the Search window is a separate dialog owned by the WPF Window that hosts the viewer. In an embedded Actipro MDI setup, this is likely the main application window rather than the individual DocumentWindow. As a result, closing the internal document may remove the Report Viewer from the UI without closing its Search dialog.

To provide some additional details regarding this, the Search dialog is normally closed when the user closes it or toggles Search off, when the report is refreshed or its view mode changes, or when the viewer model is disposed. Closing the WPF window that hosts the viewer normally triggers this disposal automatically, whereas simply unloading the viewer does not. Therefore, when an MDI document containing a Report Viewer is permanently closed, you may try calling DisposeModel() manually on that Report Viewer from the document's close handler, which should trigger the same cleanup path that closes the Search dialog.

That said, I also discussed your case with the team, and we believe that exposing the Search dialog through the viewer API would be a valuable improvement for scenarios like yours, and we plan to include it in an upcoming release. I went ahead and logged a feature request on your behalf in our public feedback portal so that you can track its status: Expose search dialog in WPF viewer.

In the meantime, I hope you will try the DisposeModel() workaround and let me know whether it resolves the issue in your application.

Best regards,
Petar

Tags
Report Designer (standalone) Report Viewer - WPF
Asked by
John
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Petar
Telerik team
Share this question
or