If you pass your own window template handle as the second parameter in the SalReportView function call, you can then intercept the WM_MouseWheel windows message (0x020A) on that window and prcocess the wParam and lParam values, as follows:
Code: Select all
On WM_MouseWheel Set nMWScroll = SalNumberHigh( wParam ) If nMWScroll > 32768 Set nMWScroll = nMWScroll - 65536 If nMWScroll >= 120 or nMWScroll <= -120 If nMWScroll >= 0 ! ** Send Page Up (2) ** Call SalSendMsg ( hWndPreview, WM_VScroll, VisNumberMakeLong ( 2, 0 ), 0 ) Else ! ** Send Page Down (3) ** Call SalSendMsg ( hWndPreview, WM_VScroll, VisNumberMakeLong ( 3, 0 ), 0 ) Return FALSE
The trick is to forward the appropriate WM_VScroll message (0x0115) on to the embedded ReportBuilder preview window (hWndPreview) to cause the content to scroll. To get the preview window handle, you need to scan the child windows of your report output window to find the window with the Class Name for RB 4.1, i.e. "Gupta:Report:Preview", using the Windows API functions for GetWindow( ) and GetClassNameA( ).
This isn't a perfect solution, sometimes the report window seems to lose contact with the embedded preview window, and it doesn't scroll when it should. However, if you zoom out and back in, it then works okay again.
Hope this helps you out...
Who is online
Users browsing this forum: [Ccbot] and 0 guests