In this blog post I am sharing a few options to get page-break-after: always; property used in InfoPath web forms working when printing or using print preview in Internet Explorer 10 and Internet Explorer 11 out of SharePoint web sites.
The behavior in IE10 and IE11 have changed where the custom header is used instead and will override the Compatible View Settings previously used in the Intranet. If you are using a component that needs to load in the IE specific legacy modes, you can use the suggestions presented in this blog post.
Previously, when a site is loaded in the Local Intranet by default, Internet Explorer will load in IE7 Compatible View document Mode. This is true even if you have configure your site to use a custom compatible header, such as<meta http-equiv="X-UA-Compatible" content="IE=10" /> via Embeded TAG or from the Web Sever configuration.
SUGGESTION I:
Use Enterprise Mode site list and designate the InfoPath url to load in Internet Explorer 7 document mode.
PREREQUISITES: Have Internet Explorer 11 install with latest IE cumulative update[MS14-080-https://technet.microsoft.com/en-us/library/security/ms14-080.aspx]
Here are the steps: Only applicable to IE11 !
- Download and install the Enterprise Mode Site List Manager tool from http://www.microsoft.com/en-us/download/details.aspx?id=42501
- Run the tool from C:\Program Files (x86)\Enterprise Mode Site List Manager\EMIESiteListManager.exe
- Click on the Add button
- Type the url you are loading the InfoPath web form from. Designate the document mode you want the url to load in. In this case, we want it to load in IE7 document mode as these functionality are legacy and work best in this document mode.
- Click on Save and yes for any dialog you may receive.
- in the above example, you will end up 2 URLs, one for the top domain that will load in Enterprise Mode and the second one for the path to the page you want it to load in IE7 Document mode
- Now, lets save the file to be use on your network by. From the File menu / save to XML or use the Ctrl+S short cut from your keyboard.
- In this demo, I will save it as infopathsitelist.xml and click on save
- Copy the xml site to be accessible via the http or https protocol for easier access. Example: http://yoursharepointsite.com/EMIE/infopathsitelist.xml
Now that you have the sitelist xml file, you need to configure the Group Policy that will be using the xml file to signal the client which mode the page needs to be on. Lets get started!
- Open your Group Policy Management console. In this case, we are using a local gpo, so we use GPEDIT.MSC
- From Group Policy Editor, go to: User Configuration\Administrative Templates\Windows Components\Internet Explorer\Use the Enterprise Mode IE website list
- Enable this policy and add the website list URL location here. Like the example given above: http://yoursharepointsite.com/EMIE/infopathsitelist.xml and then, click OK to complete the configuration.
- Now, you can run GPUPDATE /FORCE from command line to update the group policy and then test loading your site. The url should load in IE7 document mode and the print and print preview should show your page break used in your InfoPath document.
- Below are some screenshots of what you would expect to see:
Here I am using Developer Tools to show you the document mode the page is loading, which is IE7. This is using the SiteList XML I defined in GPO. This page is loading in this mode regardless if I am loading in the Local Intranet Zone in Compatibility View Settings or if I am using the Compatibility Meta TAG <meta http-equiv="X-UA-Compatible"content="IE=edge"/>
In this other screenshot, We can see the Print Preview showing the Page Break. We see there are 5 pages in the document, which these are defined in the InfoPath document with page breaks.
As you can see, the Enterprise Mode GPO and SiteList is a great way to get the old legacy component working in IE11 which is todays prefer browser.
SUGGESTION II: Applicable to Older IE versions [ie8/9/10]
If you decide Not to upgrade to IE11 then you can consider the following. This option would be applicable for IE10, since Enterprise Mode is only available in IE11.
- Setup the SharePoint page that loads the InfoPath page with <meta http-equiv="X-UA-Compatible" content="IE=7" /> instead of <meta http-equiv="X-UA-Compatible" content="IE=10" /> for SharePoint 2013 or <meta http-equiv="X-UA-Compatible" content="IE=8" /> that comes with SharePoint 2010.
- Simply, remove the compatible header from the page <meta http-equiv="X-UA-Compatible" content="IE=10" /> will also work, for sites that loads in the internal (local and trusted site zones) network.
As you can see the above 2 options may not be valid options for most Enterprises, so to me there is no better option than to use IE11 and Enterprise Mode GPO with the SiteList.
Some references:
- IE10. According to Internet Explorer’s current documentation supporting CSS 2.1 Section 13.3.1, the page-break-after property does not support line break or header elements. See the remarks in this link: http://msdn.microsoft.com/en-us/library/ie/ms530842.