I have a few reports embedded in visualforce page using iFrame. Due to this new release of Spring '14, iFrame has stopped working and now these visualforce pages show blank screens. Can anyone help me with a work around?
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
I just figured out a way to do this without an iFrame using jQuery.
First you need to include jQuery at the top of your VF page:
Then include a target element in your page that will be the container for the report. For example:
Now at the bottom of the page, use the jQuery load method to grab the HTML source of the report page, pull out just the report table, and inject it into the container:
Unfortunately the styling is lost, so I had to create a simple style sheet on the page to make it more readable:
With Spring '14, Salesforce has really picked up the pace when it comes to their Analytics.
Salesforce has also added a new tag,
If you are trying to add this report to a page layout section, Salesforce has also recently added the ability to embed report charts in page layouts directly. This completely eliminates the Visualforce requirement!
Anyway, I would highly suggest looking into the Analytics API more. This should work a bit better than an iFrame for you. Peter Knolle has written some exceptional articles on the topic as well: