Bug 350736 - Report View /run mapping cannot run in iframe in IE9
Summary: Report View /run mapping cannot run in iframe in IE9
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P3 normal with 10 votes (vote)
Target Milestone: ---   Edit
Assignee: Birt-ReportViewer CLA
QA Contact: Maggie Shen CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-29 14:08 EDT by J D CLA
Modified: 2013-10-08 10:18 EDT (History)
13 users (show)

See Also:


Attachments
report design - test parameter list box - multiple values (8.53 KB, application/octet-stream)
2013-02-27 18:59 EST, Son Ton CLA
no flags Details
Screenshots of the same report when running on IE9 & IE7 mode (74.00 KB, image/jpeg)
2013-02-27 19:08 EST, Son Ton CLA
no flags Details
Updated report design (2.51 KB, application/octet-stream)
2013-02-28 13:21 EST, birt user CLA
no flags Details
A screenshot of running of the updated report (61.81 KB, image/jpeg)
2013-02-28 15:06 EST, Son Ton CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description J D CLA 2011-06-29 14:08:50 EDT
Build Identifier: 20110615-0604

IE 9, using the BIRT 3.7 report viewer's /run mapping, the rendering of the HTML reports is halted by javascript errors before anything useful is displayed. This happens only in an iframe in IE9 (previous versions not tested). This happens even with very simple reports when the outer page contains nothing but the iframe.

JavaScript stack :
First call to BirtReportDocument.initialize()
__neh_resize()
__updateContainerSize()
In AbstractBaseReportDocument.js line 171-174, reportContainer is a text node and therefore has no style attribute.

Skipping past the errors, I get the "Processing, please wait..." box and the POST request that I see happening in Firefox is not sent.

Reproducible: Always

Steps to Reproduce:
1. Create blank HTML page with an iframe
2. Point iframe to a running report viewer using the /run URL mapping
3. Load in IE
Comment 1 Troy Simpson CLA 2011-09-27 09:45:18 EDT
I have the same problem but I am using /frameset instead of /run.
Comment 2 Shane Allred CLA 2012-01-19 16:30:44 EST
Was there ever a solution found to this problem? I'm having the exact same problem using the Birt 3.7 Viewer. I've tried setting the X-UA-Compatible meta tag, which didn't seem to help with the error. The viewer runs fine in IE 9 in compatibility mode and fine outside of an iframe.
 
The JavaScript Error is as follows:
 
User Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; InfoPath.3)
 Timestamp: Thu, 19 Jan 2012 03:13:01 UTC
 
Message: Unable to set value of the property 'overflowX': object is null or undefined
 Line: 171
 Char: 5
 Code: 0
 URI: localhost:8443/birt/webcontent/birt/ajax/ui/report/AbstractBaseReportDocument.js

I have not modified the Birt Viewer or customized it at all.
Comment 3 Zhiqiang Qian CLA 2012-01-19 21:50:53 EST
The BIRT viewer only works with IE7 mode for now. Please always use the compatibility mode or try adding the meta to your hosting page header like this:

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" >
Comment 4 Shane Allred CLA 2012-01-20 10:29:28 EST
Thank you for your response. I have tried this tag (making sure to put it as the first meta tag as mentioned in many blogs. Surprisingly it didn't appear to fix the problem for me. Have you confirmed adding this meta tag has corrected the problem for others?

Thanks
Comment 5 Zhiqiang Qian CLA 2012-01-20 21:40:35 EST
Does the report content appear? In my testing, before adding this meta tag, the report content area is blank; after adding it, the content is shown although with some other JavaScript error. Or you may want to check this bug 360068 for another IE iframe related issue.
Comment 6 Jan Lerby CLA 2012-08-17 09:29:37 EDT
I have the same problem as Shane. Meta tag helepd only for birtViewer which is not in frame. But I have application where is birtViewer in frame.
It helps for birt viewer without frames.
Comment 7 birt user CLA 2012-12-04 01:07:02 EST
Here is the link to the issue raised on BIRT forum

http://www.eclipse.org/forums/index.php/m/988561/#msg_988561

A quick resolution would be appreciated
Comment 8 Victor CLA 2012-12-20 09:12:21 EST
I think I have a solution,  it works on IE7, IE8, IE9, IE10, Firefox and Chrome.
The real problem comes from the prototype.js file.
Its version is 1.4, which is too old.
It's propotype.js that handles ajax connection, but it does not work on IE9 + because prototype.js not use XmlHttpRequest in priority request is not sent, that's why the report never appears, You should simply reverse the priority and it should work.
In the prototype.js file at line 553, replace:

       function () {return new ActiveXObject ('MSXML2.XMLHTTP')},
       function () {return new ActiveXObject ('Microsoft.XMLHTTP')},
       function () {return new XMLHttpRequest ()}

by:

       function () {return new XMLHttpRequest ()},
       function () {return new ActiveXObject ('MSXML2.XMLHTTP')},
       function () {return new ActiveXObject ('Microsoft.XMLHTTP')}

Then you can delete the meta 
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" >
Comment 9 Missing name CLA 2012-12-20 09:39:01 EST
Cela fonctionne bien ... je confirme
Merci VICTOR
CAPJTEL
Comment 10 birt user CLA 2012-12-21 03:18:10 EST
(In reply to comment #8)
> I think I have a solution,  it works on IE7, IE8, IE9, IE10, Firefox and
> Chrome.
> The real problem comes from the prototype.js file.
> Its version is 1.4, which is too old.
> It's propotype.js that handles ajax connection, but it does not work on IE9
> + because prototype.js not use XmlHttpRequest in priority request is not
> sent, that's why the report never appears, You should simply reverse the
> priority and it should work.
> In the prototype.js file at line 553, replace:
> 
>        function () {return new ActiveXObject ('MSXML2.XMLHTTP')},
>        function () {return new ActiveXObject ('Microsoft.XMLHTTP')},
>        function () {return new XMLHttpRequest ()}
> 
> by:
> 
>        function () {return new XMLHttpRequest ()},
>        function () {return new ActiveXObject ('MSXML2.XMLHTTP')},
>        function () {return new ActiveXObject ('Microsoft.XMLHTTP')}
> 
> Then you can delete the meta 
> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" >

I tried these changes but with no success. Is there anything else that needs to be done
Comment 11 Victor CLA 2012-12-21 04:03:44 EST
(In reply to comment #10)
> (In reply to comment #8)
> > I think I have a solution,  it works on IE7, IE8, IE9, IE10, Firefox and
> > Chrome.
> > The real problem comes from the prototype.js file.
> > Its version is 1.4, which is too old.
> > It's propotype.js that handles ajax connection, but it does not work on IE9
> > + because prototype.js not use XmlHttpRequest in priority request is not
> > sent, that's why the report never appears, You should simply reverse the
> > priority and it should work.
> > In the prototype.js file at line 553, replace:
> > 
> >        function () {return new ActiveXObject ('MSXML2.XMLHTTP')},
> >        function () {return new ActiveXObject ('Microsoft.XMLHTTP')},
> >        function () {return new XMLHttpRequest ()}
> > 
> > by:
> > 
> >        function () {return new XMLHttpRequest ()},
> >        function () {return new ActiveXObject ('MSXML2.XMLHTTP')},
> >        function () {return new ActiveXObject ('Microsoft.XMLHTTP')}
> > 
> > Then you can delete the meta 
> > <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" >
> 
> I tried these changes but with no success. Is there anything else that needs
> to be done

It should not correct the first javascript error in AbstractBaseReportDocument.js line 171-174.

But skipping this error you should see the report, did you clear the browser cache in order to reload js files ?

For the first error in AbstractBaseReportDocument.js at line 162, I replace 
          if (BrowserUtility.isIE) {
by 
          if (BrowserUtility.isIE7) {
Comment 12 birt user CLA 2012-12-22 05:11:58 EST
(In reply to comment #11)
> (In reply to comment #10)
> > (In reply to comment #8)
> > > I think I have a solution,  it works on IE7, IE8, IE9, IE10, Firefox and
> > > Chrome.
> > > The real problem comes from the prototype.js file.
> > > Its version is 1.4, which is too old.
> > > It's propotype.js that handles ajax connection, but it does not work on IE9
> > > + because prototype.js not use XmlHttpRequest in priority request is not
> > > sent, that's why the report never appears, You should simply reverse the
> > > priority and it should work.
> > > In the prototype.js file at line 553, replace:
> > > 
> > >        function () {return new ActiveXObject ('MSXML2.XMLHTTP')},
> > >        function () {return new ActiveXObject ('Microsoft.XMLHTTP')},
> > >        function () {return new XMLHttpRequest ()}
> > > 
> > > by:
> > > 
> > >        function () {return new XMLHttpRequest ()},
> > >        function () {return new ActiveXObject ('MSXML2.XMLHTTP')},
> > >        function () {return new ActiveXObject ('Microsoft.XMLHTTP')}
> > > 
> > > Then you can delete the meta 
> > > <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" >
> > 
> > I tried these changes but with no success. Is there anything else that needs
> > to be done
> 
> It should not correct the first javascript error in
> AbstractBaseReportDocument.js line 171-174.
> 
> But skipping this error you should see the report, did you clear the browser
> cache in order to reload js files ?
> 
> For the first error in AbstractBaseReportDocument.js at line 162, I replace 
>           if (BrowserUtility.isIE) {
> by 
>           if (BrowserUtility.isIE7) {

It works after making the change in  AbstractBaseReportDocument.js at line 162, which is awsome

Thanks Victor for the help :)

birtuser
Comment 13 Son Ton CLA 2013-02-27 18:59:15 EST
Created attachment 227704 [details]
report design - test parameter list box - multiple values

This design is a very simple report using a multiple-value list box.  It tries to display the first selected value with expression params[<lisbox_param>].value[0].  It works fine on IE7, but not on IE9
Comment 14 Son Ton CLA 2013-02-27 19:01:31 EST
Hi,
I ‘m working on BIRT runtime 3.7.

Like many, I have to view the BIRT reports in IE9 mode as I cannot change the hosting page document mode. I applied Victor’s fixes (thanks!) to prototype.js and AbstractBaseReportDocument.js and I was able to view most reports fine.  

However, I got a weird problem with list multi-value list box parameters.  Somehow, when running in IE9 Document mode, the values always got broken into multiple lines.  

For example, in my attached report, the expression params["listbox_multi"].value[0] would return “Elm Team Very Long Name 12” in IE7 mode, but return “Elm\n Team Very Long Name\n12”. The \n placement is very unpredictable (see my attached screenshots & report).

The same report runs fine under IE7, IE8, (and even IE10) and Firefox.
Anybody run into this problem? Any idea why it fails in IE9?  Any suggestion is greatly appreciated!

Thanks!
Comment 15 Son Ton CLA 2013-02-27 19:08:19 EST
Created attachment 227705 [details]
Screenshots of the same report when running on IE9 & IE7 mode
Comment 16 birt user CLA 2013-02-28 13:21:44 EST
Created attachment 227745 [details]
Updated report design
Comment 17 birt user CLA 2013-02-28 13:23:22 EST
(In reply to comment #15)
> Created attachment 227705 [details]
> Screenshots of the same report when running on IE9 & IE7 mode

Hi Son,

Not sure if this will help. I have updated the design file and attached it. Please change the datasource and dataset to suit your needs
Comment 18 Son Ton CLA 2013-02-28 15:06:35 EST
Created attachment 227753 [details]
A screenshot of running of the updated report

Hi birt user,

Thank you so much for updating my report.  The new expression does combine all selected items into one. However, my problem is not with the combination, but with each selected item itself. Somehow, each selected value is broken down into pieces.  See my attached screenshot, you will know what I mean.

Does this report work for you on IE9 (without the EmulateIE7 tag)? If so, on what environment? I’m running it on Jboss-6.1.0-Final.

Thanks!
Son
Comment 19 birt user CLA 2013-03-01 16:14:49 EST
The problem is that the option value "EventTeam 01" has whitespace. In your report design script you are printing option value. if you check the html in ie9 using dev tool, you will see that this get converted to EventTeam&nbsp;<br>01. As you can see the <br> tag breaks the formatting

In other browsers no <br> tag is created, so they are fine. a workaround could be to replace whitespace in value to underscore or something else
Comment 20 Son Ton CLA 2013-03-01 16:43:57 EST
Hi birt user,
I assumed you saw the same problem with IE9 too? That’s good because I felt like I was “seeing things”!

It’s not easy for me just to change the report designs.  I have many reports using list boxes, and the option values are used in many places in each report.  So, we’re talking about a huge change! 

What’s your suggestion for a hotfix at BIRT engine level - kind of similar fix to the changes that Victor did? Where should I look at?

Thanks!
Son
Comment 21 birt user CLA 2013-03-03 15:17:23 EST
Here are couple of options you can try

1) One of the easy options could be to use run instead of frameset. eg
http://localhost:8080/birt/run?__report=testlistbox_multi_IE9_new.rptdesign

This works fine on Ie9

2) Another option that I tried was add following lines in your report

under initialize method add these lines
importPackage(Packages.org.eclipse.birt.report.engine.api);
var re = reportContext.getReportRunnable().getReportEngine();

var ptask = re.createGetParameterDefinitionTask(reportContext.getReportRunnable());
var selectionList = ptask.getSelectionList("listbox_multi");

var myDisplayText = "";
if ( selectionList != null )
{
  for ( sliter = selectionList.iterator( ); sliter.hasNext( ); )
  {
	selectionItem = sliter.next();
	pvalue = selectionItem.getValue();
	
	for (var i=0;i<params["listbox_multi"].length;i++){
		var temp = params["listbox_multi"].value[i];		
		if(pvalue.compareTo(temp) == 0 ){
			myDisplayText = myDisplayText + selectionItem.getLabel();
			logMessage(pvalue,myDisplayText);
		}
	}
	
  }
}
ptask.close();
reportContext.setPersistentGlobalVariable("selectionText", myDisplayText);

Then in your data expression add this line
reportContext.getPersistentGlobalVariable("selectionText");

The only problem is that the condition if(pvalue.compareTo(temp) == 0 ) fails in IE9 which is strange. If you could get it to work, it may solve your problem
Comment 22 birt user CLA 2013-03-03 15:48:10 EST
(In reply to comment #21)
> Here are couple of options you can try
> 
> 1) One of the easy options could be to use run instead of frameset. eg
> http://localhost:8080/birt/run?__report=testlistbox_multi_IE9_new.rptdesign
> 
> This works fine on Ie9
> 
> 2) Another option that I tried was add following lines in your report
> 
> under initialize method add these lines
> importPackage(Packages.org.eclipse.birt.report.engine.api);
> var re = reportContext.getReportRunnable().getReportEngine();
> 
> var ptask =
> re.createGetParameterDefinitionTask(reportContext.getReportRunnable());
> var selectionList = ptask.getSelectionList("listbox_multi");
> 
> var myDisplayText = "";
> if ( selectionList != null )
> {
>   for ( sliter = selectionList.iterator( ); sliter.hasNext( ); )
>   {
> 	selectionItem = sliter.next();
> 	pvalue = selectionItem.getValue();
> 	
> 	for (var i=0;i<params["listbox_multi"].length;i++){
> 		var temp = params["listbox_multi"].value[i];		
> 		if(pvalue.compareTo(temp.replaceAll("\n","")) == 0 ){
> 			myDisplayText = myDisplayText + selectionItem.getLabel() + "\n";
> 			logMessage(pvalue,myDisplayText);
> 		}
> 	}
> 	
>   }
> }
> ptask.close();
> reportContext.setPersistentGlobalVariable("selectionText", myDisplayText);
> 
> Then in your data expression add this line
> reportContext.getPersistentGlobalVariable("selectionText");
> 
> The only problem is that the condition if(pvalue.compareTo(temp) == 0 )
> fails in IE9 which is strange. If you could get it to work, it may solve
> your problem
Comment 23 birt user CLA 2013-03-03 15:51:27 EST
PLease see my previous comment #22  where I have modified the initialize script. It should now work on all browsers including ie9

hope this helps
Comment 24 Son Ton CLA 2013-03-04 15:31:40 EST
Hi birt user,

1/For me, I have the same issue with /run. If /run works for you, maybe we can figure out what's the difference between /run & /frameset, and then fix the issue at code level (instead of fixing report designs).

2/Thank you for putting your time into it. But like I said, I'm still seeking a fix at BIRT runtime code level so that I don't have to modify report designs. I'd use this option if nothing else comes up.

Again, thank you so much for your help!
Son
Comment 25 Son Ton CLA 2013-03-15 11:51:05 EDT
I ended up adding the following function to validate() script (of parameter "teamname" in this case):

//get rid of \n here (IE9 BIRT defect: replaced whitespaces with newline characters)

if (params["teamname"].value!=null){
	for (idx=0; idx < params["teamname"].value.length; idx++) {
	 params["teamname"].value[idx] = 
                 params["teamname"].value[idx].replaceAll("\n","");
	}
}
true;


The script acts as a pre-processing that removes the newline characters from the parameter option values, so I don't have to change anything else in the report.
Comment 26 birt user CLA 2013-03-16 05:11:03 EDT
Great you were able to solve the problem. There are many solutions to a given problem, choose what is right for you and requires minimum changes

Personally changes to core BIRT implementation should only be done if it affects the basic functioning of the system. Otherwise it has its dangers.

As your issue related to data, it can be done at different levels, as you did in your case

thanks
Birt user
Comment 27 Abhishek SS CLA 2013-10-08 05:43:17 EDT
Hi,

  I am facing the same issue, in IE-9, but I am using /frameset instead of /run,
Any Idea when this issue will get resolved.

Thanks
Comment 28 birt user CLA 2013-10-08 10:18:16 EDT
Did you try the changes suggested above? It is for /frameset action. The fix was done for Birt 3.7, which version are you using?

birtuser