Click here to Skip to main content
13,048,846 members (76,925 online)
Rate this:
Please Sign up or sign in to vote.

This new version of SAP Crystal reports have another issue with the focus event.

In some cases, the toolbar buttons are always disabled or in another cases when you minimize and maximize your window the toolbar buttons appear disabled.

You have two workarounds to this situation:

1º: Click on the buttons at the bottom of the viewer (size to fit, slider..), this will activate the toolbar buttons.

2º: insert this code in the window with the Crystal Reports viewer:
protected override void OnSourceInitialized(EventArgs e)
            HwndSource source = PresentationSource.FromVisual(this) as HwndSource;
        private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
            // Handle messages...
            if (MyReportViewer != null)
                MyReportViewer.Focusable = true;
            return IntPtr.Zero;

In my case (minimize, maximize), this resolved the problem.

Posted 10-Oct-12 5:28am
Rajivhost 30-Apr-13 2:19am
I tried this but not work for me.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 10 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100