none
Powerpivot inside an IFrame

    Question

  • Hello,

    I am trying to insert a Powerpivot V2 sheet inside an IFrame webpart but are getting the following error:

    "This content cannot be displayed in a frame

    To help protect the security of information you enter into this website, the publisher of this content does not allow it to be displayed in a frame."

    Is displaying a powerpivot inside an IFrame no longer supported ? (it was working with powerpivot v1)

    Please advise

    TX

    H

    Saturday, October 13, 2012 9:51 PM

Answers

  • Hi,

    If I understand you correctly you are trying to embed Excel Services spreadsheet into an iFrame ?

    If not in the same domain it will not be allowed because of the risk of click-jacking.

    One way of doing it is writing a custom module which strips off the http-header (X-FRAME-OPTIONS) indicating that iframe embedding is not allowed

    In the virtual directory folder of your SharePoint website add an App_Code folder (if it doesn't exist) and paste the following code

    using System;
    using System.Text;
    using System.Web; 
     
    namespace Custom.ServerModules
    {
      public class CustomHttpHeaderModule : IHttpModule
      {
        public void Init(HttpApplication context)
        {
          context.PreSendRequestHeaders += OnPreSendRequestHeaders;
        }
        public void Dispose()
        {
        }
        void OnPreSendRequestHeaders(object sender, EventArgs e)
        {
          HttpContext.Current.Response.Headers.Remove("X-FRAME-OPTIONS");
        }
     }
    }
    Add a call to the module in the web.config of your site. Find the <modules> section and add this line within the <modules> element :

    <!-- allows iframing -->
    <add name="CustomHttpModule" type="Custom.ServerModules.CustomHttpHeaderModule" />

    Please do notice that allowing iframing is a security risk for your website. More info about clickjacking 

    Hope that solves your problem, even if it's 1½ year old :-)

    Cheers

    Régis



    Blog

    Tuesday, March 18, 2014 7:15 AM

All replies

  • I have the same problem.

    is it a x-frame options somewhere?

    can i add my own domain name to it as exception?

    Wednesday, November 07, 2012 7:51 AM
  • Neo and Ivolve,

    Is this still an issue?

    Thank you!


    Ed Price, Power BI & SQL Server Customer Program Manager (Blog, Small Basic, Wiki Ninjas, Wiki)

    Answer an interesting question? Create a wiki article about it!

    Sunday, November 24, 2013 5:10 AM
  • It is for me!  Please help.

    Thanks

    --gront

    Wednesday, December 11, 2013 11:44 PM
  • Gront, I'm seeing if I can get an SME to help. 

    Thanks!


    Ed Price, Power BI & SQL Server Customer Program Manager (Blog, Small Basic, Wiki Ninjas, Wiki)

    Answer an interesting question? Create a wiki article about it!

    Monday, December 16, 2013 6:43 PM
  • Has anyone tried this?

    Thanks!


    Ed Price, Power BI & SQL Server Customer Program Manager (Blog, Small Basic, Wiki Ninjas, Wiki)

    Answer an interesting question? Create a wiki article about it!

    Friday, January 17, 2014 7:31 PM
  • Hi,

    Thank you for your question. I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated. 

    Thank you for your understanding and support.

    Regards,


    Elvis Long
    TechNet Community Support

    Monday, January 20, 2014 5:38 AM
  • 1. What do you mean by PowerPivot v1 and v2? do you mean V1 is for SQL2008 R2, and V2 for SQL2012?

    2. Are you integrating the PowerPivot with SharePoint?

    3. Could you give some more detailed steps on how did you use the Iframe to display a PowerPivot inside?

    Monday, January 20, 2014 8:54 AM
  • Hi,

    If I understand you correctly you are trying to embed Excel Services spreadsheet into an iFrame ?

    If not in the same domain it will not be allowed because of the risk of click-jacking.

    One way of doing it is writing a custom module which strips off the http-header (X-FRAME-OPTIONS) indicating that iframe embedding is not allowed

    In the virtual directory folder of your SharePoint website add an App_Code folder (if it doesn't exist) and paste the following code

    using System;
    using System.Text;
    using System.Web; 
     
    namespace Custom.ServerModules
    {
      public class CustomHttpHeaderModule : IHttpModule
      {
        public void Init(HttpApplication context)
        {
          context.PreSendRequestHeaders += OnPreSendRequestHeaders;
        }
        public void Dispose()
        {
        }
        void OnPreSendRequestHeaders(object sender, EventArgs e)
        {
          HttpContext.Current.Response.Headers.Remove("X-FRAME-OPTIONS");
        }
     }
    }
    Add a call to the module in the web.config of your site. Find the <modules> section and add this line within the <modules> element :

    <!-- allows iframing -->
    <add name="CustomHttpModule" type="Custom.ServerModules.CustomHttpHeaderModule" />

    Please do notice that allowing iframing is a security risk for your website. More info about clickjacking 

    Hope that solves your problem, even if it's 1½ year old :-)

    Cheers

    Régis



    Blog

    Tuesday, March 18, 2014 7:15 AM
  • Gront - were you able to get your question answered?  I'm from MSFT field organization, and have some colleagues with experience in this area that might assist.  Out of curiousity, what partner are you with?  I'd be interested to chat with you about the context from which your question arose.
    Sunday, April 27, 2014 12:02 PM