Printing multi page forms with Firefox - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Printing multi page forms with Firefox

Last post 07-08-2011 02:02 PM by Johnnie M.. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 10-20-2009 02:55 AM

    Printing multi page forms with Firefox

    Normal 0 MicrosoftInternetExplorer4

    We are receiving a number of customer complaints about a problem printing multi page forms, using Firefox browser, on our public internet site.
     
    We are rendering Infopath browser forms from a sharepoint 2007 site using a URL to the standard FormServer.aspx page e.g.
        https://devextranet.fdeb22.co.uk/_layouts/FormServer.aspx?XsnLocation=%2fFormServerTemplates%2fMyForm.xsn&SaveLocation=%2feForms&Source=%2feForms%2fForms%2fAllItems.aspx&DefaultItemOpen=1
     
    I can print a multi-page form from Explorer, but not from Firefox (using latest versions of both browsers).
     
    When I use the Firebug tool to analyse the form I can see that the <body> tag has the style:
        <body style="margin: 0px; overflow: auto;">
     
    If I change the body style using Firebug to:
        <body style="margin: 0px; overflow: visible;">
    then Firefox can print all the form’s pages.
     
    I've tried changing the style of the body tag in the form template's view1.xsl file, but this has no effect because, it seems, that the form template's <body> tag is rendered as a <div> tag.
    I'm guessing, that the Infopath XmlFormView control is controlling the rendering of the <body style="margin: 0px; overflow: auto;"> tag.
     
    Is there any way I can change the body tag styling so that Firefox will print all pages, or any other solution to this problem ?

  • 10-29-2009 02:18 AM In reply to

    Re: Printing multi page forms with Firefox

     I fixed this problem by creating a clone of FormServer.aspx for FireFox called FormServerFireFox.aspx which has:

         <body style="margin: 0px; overflow: visible;">

     I also created FormServerRedirect.aspx which redirects to FormServerFirefox.aspx for Firefox browsers:

    <%@ Page
        Language="C#"
    %>
    <%@ Register Tagprefix="InfoPath" Namespace="Microsoft.Office.InfoPath.Server.Controls" Assembly="Microsoft.Office.InfoPath.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Import Namespace="Microsoft.SharePoint" %>
    <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 
    <%@ Assembly Name="Microsoft.SharePoint.ApplicationPages" %>

    <%
        SPSite spServer = SPControl.GetContextSite(Context);
        SPWeb spWeb = SPControl.GetContextWeb(Context);
        string page  = "FormServer.aspx";
        string query = Request.RawUrl;

        if (Page.Request.Browser.Browser=="Firefox")
        {
        page = "FormServerFireFox.aspx";
        }
        int index = query.IndexOf("?");
        if (index >= 0 && index < query.Length) query = query.Substring(index + 1);

        SPUtility.Redirect(page, SPRedirectFlags.RelativeToLayoutsPage, Context, query);
    %>
     

     

  • 01-21-2010 05:05 AM In reply to

    Re: Printing multi page forms with Firefox

    Normal 0 false false false MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;}

    I am facing same problem with Firefox printing (Only printing first page).

    The above solution seems to be in the right direction.

    I have created FormServerFirefox.aspx and FormServerRedirect.aspx and placed them in Layouts folder, but what do I do next?

    Do I need to change any setting on SharePoint to pick this new URL (FormServerRedirect.aspx)?  , how will the InfoPath form use the new URL?

     Any help is much appreciated.

     Regards

    Andrew

  • 01-25-2010 09:07 AM In reply to

    Re: Printing multi page forms with Firefox

    Hi Andrew,

    I have a web part loading the form templates.
    The web part originally requested FormServer.aspx to load the required form template.
    I replaced FormServer.aspx in the URL with FormServerRedirect.aspx which redirects the request to either the original FormServer.aspx or the new FormServerFirefox.aspx, as appropriate.
    e.g.
    Replace
        http://xxxx.com/_layouts/FormServer.aspx?XsnLocation=/FormServerTemplates/myForm.xsn ...
    with
        http://xxxx.com/_layouts/FormServerRedirect.aspx?XsnLocation=/FormServerTemplates/myForm.xsn ...

    You don't need to change any settings. I just copied the files to folder:

        C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS

    The full contents of  FormServerFirefox.aspx are:


    <%@ Page
        inherits="Microsoft.Office.InfoPath.Server.Controls.FormServerPage,Microsoft.Office.InfoPath.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"
        EnableSessionState="true"
        AutoEventWireup="false"
        EnableViewState="false"
        LinePragmas="false"
        Language="C#"
        ValidateRequest="true"
    %>
    <%@ Register Tagprefix="InfoPath" Namespace="Microsoft.Office.InfoPath.Server.Controls" Assembly="Microsoft.Office.InfoPath.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <html>
        <head runat="server">
        </head>
        <body style="margin: 0px;overflow:visible;">
            <form runat="server" id="HostingForm" method="post" enctype="multipart/form-data" style="width:100%;">
                    <InfoPath:XmlFormView id="FormControl" Style="width:100%;" runat="server"/>
            </form>
        </body>
    </html>
     

    Dave.
  • 07-08-2011 02:02 PM In reply to

    Re: Printing multi page forms with Firefox

    Has anyone managed to do this with SharePoint Server 2010, InfoPath 2010 and Firefox 4.0/5.0?

     I have tried these same steps, along with a number of others, but have had no joy so far.  The print preview via the InfoPath button (in Firefox) displays correctly but the actual Firefox print preview and the actual printed document have some extra page breaks included and do not show any overflow text.

     Thanks.

Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.