8

Question:

We have a portal, where the doctype is compatible to xhtml 1.0. Then, in the portal, we have a content iframe, where we embed different web-applications. Some of those application were written by us, some are 3rd party.

Now in that iframe, we embed, amongst other things, Microsoft Reporting Service reports. The problem is, Reporting Service Reports requires QuirksMode to render "correctly". And the portal doesn't work in QuirksMode (which is fine, as far as I am concerned, since we only target 9, and possibly IE8). The portal also doesn't render fine in IE7, and we're going to abandon IE8 support as soon as possible.

However, IE9 seems to inherit the document mode from the parent page, so the reporting service reports gets rendered in IE9 standards mode instead of quirks mode. So all the reports are displayed incorrectly (and i don't mean a little bit, it's really severe, completely incorrect, absolutely horrible)

The problem is, we can't change reporting service...
There's no way to make reporting service (any version) render non-quirksmode HTML.

As per Will an iframe render in quirks mode? i could add

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
<meta http-equiv="X-UA-Compatible" content="IE=8" />

To get the iframe to render in QuirksMode. (edit: doesn't even work when I don't care about how the portal renders and put it in anyway)

Unfortunately, the portal is as said, not IE7 compatible, so this is not an option.
Also, the SSRS reports runs on another domain than the portal, so I can't use JavaScript/jQuery in any way.

Is there any way to make an iframe render in QuirksMode, without destroying the parent page layout ?
Or a (already existing) way to make reporting service render valid HTML (I certainly don't have the time to write a custom HTML rendering extension) ?

Community
  • 1
  • 1
Stefan Steiger
  • 78,642
  • 66
  • 377
  • 442
  • It's a somewhat dirty idea, but maybe you can add some invalid HTML to the iframe, forcing the IE fall back to quirks mode. Yet I do not know if that would lead to the whole page being rendered in quirks mode. – f_puras Sep 05 '12 at 10:49
  • 1
    Great idea, combining iframe and its evil brother quicksmode. – OpenGG Sep 05 '12 at 11:12
  • @Rufus: It's spelled quirksmode, not quicksmode, but you have a point there :) In my defense: the idea wasn't mine (actually I was never asked nor told, neither about the iframe, nor about using SSRS) ! However, since I am "ReportGuy", it seems the blame is mine, which seems to mean that I am APPARENTLY "guilty"... – Stefan Steiger Sep 05 '12 at 11:48
  • @_puras: Yes, my first idea, too. But the question is how ? I can't control the reportserver (will be customer's), I can't change SSRS (Microsoft's closed-source sourcecode) and I can't use JavaScript to insert invalid HTML because the different-domain security prohibits that, and I can't write my own rendering extension, because I don't have the time (and would need to register the module at customer X for reporting service version y and .net framework version z). – Stefan Steiger Sep 05 '12 at 11:50
  • 1
    @Rufus: Oh by the way: For 3rd party content, the only viable other options than iframe would be popups (evil big brother of iframe)... – Stefan Steiger Sep 05 '12 at 11:55
  • You could write a proxy servlet which retrieves the report HTML (e.g. using [Apache HttpClient](https://hc.apache.org/httpcomponents-client-ga/)) and returns it decorated with some HTML garbage. I admit it's really getting evil here ;-) – f_puras Sep 05 '12 at 12:16
  • Would a double iframe do it? (an iFrame in an iFrame) the middle iframe being under your control and having a missing doctype, the lowest child then inheriting quirksmode from the middle one? Probably the most evil of them all! – Matt.C Sep 05 '12 at 18:10
  • @Matt.C: This assumes that the middle one doesn't inherit it's doctype from its parent. I just tried, and it does inherit... So that doesn't help. – Stefan Steiger Sep 06 '12 at 07:06
  • Aaaaargh, even setting the meta tags in the portal doesn't help as well. One really needs to change the doctype of the parent page. There's ABSOLUTELY NO other solution. – Stefan Steiger Sep 06 '12 at 07:30
  • I died a little, upon reading all this HTML blasphemy – Jarrod Mosen Sep 11 '12 at 01:30
  • 1
    Filed bug: http://connect.microsoft.com/SQLServer/feedback/details/762046/ssrs-html-is-broken-its-impossible-to-properly-embed-a-sql-server-reporting-service-report-in-an-iframe-in-ie9-if-the-parent-container-is-in-html-standards-mode – Stefan Steiger Jan 21 '13 at 15:35

2 Answers2

2

Via MSDN:

Although the newer rendering engine is only used when Windows® Internet Explorer® detects that an HTML page has requested the highest level of support for standards, the same is not always true for child pages that might be loaded within frame and iframe elements. Because only one rendering engine can be active at a time, IE9 Mode also includes emulation for Quirks Mode.

Sorry, but what you want to do is impossible to achieve in IE9.

Community
  • 1
  • 1
MarcinWolny
  • 1,600
  • 2
  • 27
  • 40
0

Necromancing as per 2016.

If you have the same problem (with SSRS):
SQL-Server 2016 CTP 3.3 Reporting-Service (preview portal) delivers standards-compliant HTML.

Stefan Steiger
  • 78,642
  • 66
  • 377
  • 442