locked
Print a record with IFRAME (custom aspx page & associateview) RRS feed

  • Question

  • Hi all,

    I have few iframe in my contact form, iframe custom aspx page and iframe associate entity grid view in it.
    If i click the print button in crm, print preview there cant show the iframe pages.

    My question is , is there anyway I can print the just like WYSWYG in crm form (include ifram page)???

    Thank you

    regards,
    Toong Yang
    http://eastoceantechnical.blogspot.com/
    Wednesday, July 15, 2009 10:21 AM

Answers

  • Set the iframe url (in customization) to a default page e.g. /isv/assocviewer.aspx?parentOtc=1&tabset=area…

     

    When the page loads get the parameters you need e.g.

    <script>

    var iType = ‘<%=Request[“parentOtc”]%>’;

    var sTabset = ‘<%=Request[“tabset”]%>’;

    var sSecVal = window.frameElement.opener.crmFormSubmit.crmFormSubmitSecurity.value;

    var oId = window.frameElement.opener.crmForm.ObjectId;

    </script>


    Then reload the page with the correct url:
    <script>

    window.location = top.opener.location.pathname + “?oId=” + oId + “&oType=” + iType + “&security=” + sSecVal + “&tabset=” + sTabset;

    </script>

     

    This of course is just an example. Not sure all the parameters are / script is correct.


    Blog: http://mscrm4ever.blogspot.com/ * Website: http://gicrm.upsite.co.il/
    • Marked as answer by Toong Yang Friday, July 17, 2009 2:55 AM
    Thursday, July 16, 2009 5:00 AM

All replies

  • You can print the whole form if you want including menus and iframes. You can add a custom button to the form and from there invoke the normal print using Javascript.

    Crm print on the form doesn't support iframes.

    Another option is to create a report with the required information and print the report.

    Hope this helps.

    • Proposed as answer by Wael HamzeMVP Wednesday, July 15, 2009 12:21 PM
    Wednesday, July 15, 2009 11:24 AM
  • If you set the Iframe URL in your code then the iframe content is not displayed. However, when you set the iframe url from customization the print page will display the iframe content correctly.


    Blog: http://mscrm4ever.blogspot.com/ * Website: http://gicrm.upsite.co.il/
    Wednesday, July 15, 2009 3:57 PM
  • but my problem is the IFRAME content is load dynamic base on GUID, can not hard coded into SRC in form customization.
    http://eastoceantechnical.blogspot.com/
    Thursday, July 16, 2009 3:08 AM
  • If the guid is the objectid (unique identifier) then you can still do that using customization (check the pass record object type and unique identifier as parameters). If it’s another guid then you need to retrieve the guid using js that runs from the iframe. i.e. load the iframe with a default, get the guid from the parent form, do a post back and retrieve the correct content.


    Blog: http://mscrm4ever.blogspot.com/ * Website: http://gicrm.upsite.co.il/
    Thursday, July 16, 2009 3:16 AM
  • ok, i get what you mean now :D

    One more thing is I am using the associate view from 1:M entity in my IFRAME also.
    from the code, iframe parameter, i cant find the securityid which get from form load. (crmFormSubmit.crmFormSubmitSecurity.value)

    is it same for all the associate view?so i can hard coded it

    regards,
    Toong Yang
    http://eastoceantechnical.blogspot.com/
    Thursday, July 16, 2009 3:39 AM
  • Set the iframe url (in customization) to a default page e.g. /isv/assocviewer.aspx?parentOtc=1&tabset=area…

     

    When the page loads get the parameters you need e.g.

    <script>

    var iType = ‘<%=Request[“parentOtc”]%>’;

    var sTabset = ‘<%=Request[“tabset”]%>’;

    var sSecVal = window.frameElement.opener.crmFormSubmit.crmFormSubmitSecurity.value;

    var oId = window.frameElement.opener.crmForm.ObjectId;

    </script>


    Then reload the page with the correct url:
    <script>

    window.location = top.opener.location.pathname + “?oId=” + oId + “&oType=” + iType + “&security=” + sSecVal + “&tabset=” + sTabset;

    </script>

     

    This of course is just an example. Not sure all the parameters are / script is correct.


    Blog: http://mscrm4ever.blogspot.com/ * Website: http://gicrm.upsite.co.il/
    • Marked as answer by Toong Yang Friday, July 17, 2009 2:55 AM
    Thursday, July 16, 2009 5:00 AM
  • Hi Adi,

    ok, i get the idea now, will give a try on weekend. thx

    regards,
    Toong Yang
    http://eastoceantechnical.blogspot.com/
    Friday, July 17, 2009 2:55 AM
  • i am finding somthing like this too.
    Wednesday, October 14, 2009 11:00 AM