Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to implement browser Printing of CRM WebClient UI

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

How to carry out the browser printing implementation of CRM WebClient UI, I believe that many inexperienced people are at a loss about this. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

There is a print button on WebClient UI. Press Ctrl + P to generate a new page for printing.

This is shown in the following figure. You can see that all the hyperlinks on this page have been removed.

The logic for generating this page is as follows.

1. Holding down ctrl + p triggers the keystroke response function thtmlbKeyDown of the WebClient UI framework. The ctrl attribute in the event handling object passed by the browser is true,keycode 80 (the code corresponding to the key p), which means that ctrl and p are pressed at the same time.

The response function thtmlbKeyDown is registered with the entire document object, so you can click ctrl+p anywhere on the page to get a response.

You can see that crmFrwPrint is called from the call stack in the upper right corner. CrmFrwPrint will open the print.do controller, which is located in the BSP application bspwd_basics.

two。 Open the implementation class CL_BSPWD_BASICS_PRINT of the print.do controller

The controller will open the print.html page

3. The content of the page generated after we press ctrl+p is generated in print.html. The core code is in the function ppStartScripts, which is registered by thtmlbRegisterOnLoad in the load event of the page, which means that print.html is executed when it is loaded.

ThtmlUtil.addEventHandler is an event registration function packaged by SAP itself and is used for multi-browser compatibility support.

The two core functions:

CreateShield

Generate a div with 100% height and width, and the background image is set to the 1x1.gif predefined by SAP.

The runtime is displayed as follows:

LoadPage

Get the original page where the ctrl+p button occurred through window.opener, and then copy the html of all the elements under its th-l-wcsubheadercontainer directly under the header element of the printout page.

This makes it possible to move the contents of the original page to the printout page.

Then get all the hyperlink tags on the printed page, and then set the href and onclick of these tags to a function whose body is return false, so that the hyperlink can no longer be clicked.

Var nirvana = new Function ("return false;"); after reading the above, have you mastered how to implement CRM WebClient UI's browser printing? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report