locked
Print Preview not Showing JS Customizations Correctly RRS feed

  • Question

  • We are using 2011 and have an account form with JS functions that hide and show different fields based on the account type that is selected. When the user goes to print the form and they click on print preview the data shown in the preview doesn't match the data shown on the form based on the current account type of the record. It is showing fields that are currently hidden and not showing some fields that are currently visible. Does anyone know how to have the printed version of a form only display the visible fields when the option is selected? We have discovered several options if we were on-site with version 4.0 but have not been able to determine a work around for 2011. Thanks for any help in this matter.
    Friday, November 30, 2012 10:19 PM

Answers

  • Hi,

    I would also recommend taking a look at this post for a workaround that allows you to run JScript even in print preview. You can execute JScript code using an embedded HTML Web Resource.

    Greetings,

    Pavlos


    Please mark this reply as an answer and vote it as helpful if it helps you find a resolution to your problem.
    View my latest gallery contribution here.
    Visit my blog here.

    • Marked as answer by Phillip.K Tuesday, December 4, 2012 9:47 PM
    Monday, December 3, 2012 7:46 AM

All replies

  • Unfortunately the Print Preview screen is a stand alone screen that does not take context from the form, and so any javascript you have running on the form onload will be ignored in the Print Preview. Any fields/sections/tabs that are set as 'Visible by default' in the form customizations will be visible in the Print Preview. Anything hidden by default (even if it's displayed later) will be ignored from the Print Preview.

    Your best option is to either display all the content by default, so it's at least all there in the print preview. Or you can create a report which can display the correct data based on the type.

    Hope that helps.

    -Paul

    Saturday, December 1, 2012 8:14 AM
  • Yes, this is product behavior. When we print a form, internally it runs a report which pulls the data which is stored in database (not which is visible on the form that's the reason it shows the hidden fields also). So no dynamic data (custom web page, web resource, JavaScript Hide/Show, JavaScript Calculation) will be mapped to the print preview form. 

    To print the appropriate data usually we develop a new report and replace the print preview internal report.   
    Below please find the link to change the entity’s default print preview to a custom implementation. 
    http://adrian-alexan.blogspot.in/2009/12/customizing-entities-print-preview-form.html

    Chandan

    Monday, December 3, 2012 5:09 AM
  • Hi,

    I would also recommend taking a look at this post for a workaround that allows you to run JScript even in print preview. You can execute JScript code using an embedded HTML Web Resource.

    Greetings,

    Pavlos


    Please mark this reply as an answer and vote it as helpful if it helps you find a resolution to your problem.
    View my latest gallery contribution here.
    Visit my blog here.

    • Marked as answer by Phillip.K Tuesday, December 4, 2012 9:47 PM
    Monday, December 3, 2012 7:46 AM
  • Thank for the reply's. We are looking into the suggestions below and will report back if they work and if so mark the reply as the answer. Thanks again. This forum rocks.
    Monday, December 3, 2012 9:05 PM
  • Thanks Pavlos. This is the approach we are going with. We have had success with this in some small tests and are expanding this into the two forms that have the issue on them now.
    Tuesday, December 4, 2012 9:49 PM