Printing generated JSP pages

What product/components do you use and which version/fix level?

ApplinX 10.3/7/11 - latest fixes

Are you using a free trial or a product with a customer license?

licensed

What are trying to achieve? Please describe in detail.

print the cusomised though JSP page, using the printing gadget at the emulation bar

Do you get any error messages? Please provide a full error message screenshot and log file.

No error, but the printing content appears distorted for all JSP pages, while looking fine with the instant pages.

Please advise if this is the default behaviour and custom implementation is required in the printer page below ?

<%@ page extends="com.sabratec.j2ee.framework.web.GXJspServlet"%>
<%@ page contentType="text/html; charset=utf-8" %>
<%@ taglib  uri="com/sabratec/j2ee/framework/tags"  prefix="gx" %>
<gx:html gx_context="contexts.printScreen">
	<head>
 		<script src="z_resourceReader.jsp?res=z_jsengine/z_browserUtil.js"></script>
 		<script src="z_resourceReader.jsp?res=z_jsengine/z_engine.js"></script>
 		<script src="z_resourceReader.jsp?res=z_jsengine/jquery-1.11.3.min.js"></script>
		<link href="css/styles_printScreen.css" rel="STYLESHEET" TYPE="text/css">
    </head>
	<body onload="onLoad();">
		<gx:form>
			<gx:instantRenderer/>
		</gx:form>
		
		<script>
		function setFontSizeFromCookie(){
			   updateStyle();  
			   removeUnderlines();
		}
		
		function updateStyle(){
			var inner =  opener.GXBrowserUtil.getElement('gx_screenArea').innerHTML;
			$('#gx_screenArea').html(inner);
		}


		function removeUnderlines(){
		   var font_size = GXBrowserUtil.getCookie('gx_fontSize');		 
		   if(font_size == null || font_size ==''){
			   font_size = opener.GXBrowserUtil.getFontSize();
		   }
		   
		   var screenAreaDiv =  document.getElementById('gx_screenArea')
		   screenAreaDiv.style.fontSize  = font_size+"";
		   var all = screenAreaDiv.children;
		   for (var i = 0; i < all.length; i++) {
			   if (all[i].tagName == "INPUT") {
			   		all[i].style.borderBottom  = "none";
			   }
		   }
		}

			
		function onLoad() {
			setFontSizeFromCookie();
			window.print();
			if (GXBrowserUtil.isChrome()) {
				setTimeout("window.close()", 100);
			}
			else {
				window.close();
			}					
		}
		</script>
	</body>
</gx:html>

Hi Leonard,

Thanks for reaching out.
It hard for us to determine the cause from the screenshot, it might be a simple missing CSS definitions or something more.
Please open a support call with the relevant files (GXAR, GCT and web application) and we’ll look into this.

Regards,
Gadi