cancel
Showing results for 
Search instead for 
Did you mean: 

Object doesn't support this property or method - Javascript error-

Former Member
0 Kudos

My initial implementation (using crystal reports for eclipse ver 1.0.4) worked fine and the reports were being displayed. But after my move to use the BOE Crystal jars - I am not able to render the report on-screen.

I get the Object doesn't support this property or method javascript error when rendering report on-screen.

This error only seems to show under Internet Explorer, In Firefox no error is shown and it is not rendered, but using firebug I noticed it calling javascript but nothing is displayed.

crystalimagehandler.jsp was a file under crystalreportviewers folder.

But the BOE version has the CrystalReportViewerServlet which I have associated in my web.xml

Web.xml

<context-param>

<param-name>crystal_image_uri</param-name>

<param-value>crystalreportviewers</param-value>

</context-param>

<context-param>

<param-name>crystal_image_use_relative</param-name>

<param-value>webapp</param-value>

</context-param>

<context-param>

<param-name>crystal_servlet_uri</param-name>

<param-value>/CrystalReportViewerHandler</param-value>

</context-param>

<servlet>

<servlet-name>CrystalReportViewerServlet</servlet-name>

<servlet-class>com.crystaldecisions.report.web.viewer.CrystalReportViewerServlet</servlet-class>

</servlet>

<servlet-mapping>

<servlet-name>CrystalReportViewerServlet</servlet-name>

<url-pattern>/CrystalReportViewerHandler</url-pattern>

</servlet-mapping>

Edited by: jam mend on Jan 28, 2009 2:04 AM

Accepted Solutions (0)

Answers (1)

Answers (1)

ted_ueda
Employee
Employee
0 Kudos

Don't mix CR4E Version 1 Viewer (that uses the crystalimagehandler.jsp) with BOE XI 3.x Viewer (that uses the CrystalReportViewerServlet).

Client-side JavaScript from one version trying to call a JavaScript object from another will fail.

Usually IE fails that way and Firefox silently fails when some JavaScript code from an old version tries to walk up the DOM hierarchy to find the root parent frame.

Sincerely,

Ted Ueda

Former Member
0 Kudos

Ted,

I was using CR4E Viewer to view the reports being served from the BOE RAS server, so it should have been an issue. <br/> But now that I am trying to view the report using the BOE viewer against the BOE RAS, I get the JS error.

In the view source, I do see data such as..$14.50, but it is not rendered.

I placed an alert in crv.js, and it seems to be getting picked up. So maybe the js and css are being picked up.

Interestingly, I noticed the DIV tag in the body of the html shows a style of hidden !!! <br/>which is why the data is not being displayed. But why does the javascript generate such a style ???

div id="CrystalViewercridreportpage" name="CrystalViewercridreportpage" class="crystalstyle" <br/>style="width:768;height:1418;position:absolute; visibility:hidden ;">

I manually changed this and the text data appears...

ted_ueda
Employee
Employee
0 Kudos

So what happens if you look at the report in Java InfoView, that uses the same viewer SDK?

Sincerely,

Ted Ueda

Former Member
0 Kudos

The example I am running against is the Drilldown-sample report under feature samples.

I executed this report via the CMC and it displays just fine.

We are using RichFaces+Facelets.

Using MyFaces --- I can see the report without the images.

Using standard jsp --- the report displays perfectly

JM

Edited by: jam mend on Jan 29, 2009 10:00 PM

Former Member
0 Kudos

I finally was able to find where javascript is getting broken - using visual web developer 2008.

It is in allInOne.js and here is the location

 
for (var i in sub)
a [j++] = sub <i>. getHTML (o.initialIndent,i==0)

where it fails and j = 2 at that point..

for (var i in sub)-->

i = 0 when using myFaces,

but i = "lastIndexOf" - a string when using richFaces?????????

function TreeWidget_getHTML()
// get the widget HTML
// returns [String] the HTML

DATA:


i = "lastIndexOf"
j = 2
o.length = 71
sub.length=71


a [0] = 
< div 
align="left" onselectstart="return false" class="insetBorder"
 id="bobjid_1233274535613_tree" style="border-width:2px;padding:4px;width:100%; height:100%;overflow:auto" >
< span
 id="treeCont_bobjid_1233274535613_tree" 
on
keydown ="
return 
_CW.
TreeWidget_keyDownCB
(this ,event)"  
>

Edited by: jam mend on Jan 30, 2009 2:19 AM

ted_ueda
Employee
Employee
0 Kudos

Ok - I've seen this error before. It's caused by JavaScript conflicts between the viewer and surrounding material.

The initialization in the TreeWidget_getHTML, var o=this... should point it to an array, but some other JavaScript is overwriting the variable to point to a different object.

The allInOne.js is a concatenation of the other JavaScript files in the viewer folder - it's combined into one to allow download of the js in one request, rather than multiple ones for all the js. The TreeWidget is used in the left-hand-pane for Group and Interactive Parameters (pretty source found in dhtml/treeview.js).

Options are: (1) isolate the viewer in its own frame so it doesn't conflict with surrounding JavaScript, (2) if you don't need the Group or Interactive Parameter panel, then disable them, or (3) hack the JavaScript to prevent conflicts.

Option (3) is very intensive and not something I suggest, unless you're very familiar with JavaScript.

Sincerely,

Ted Ueda

Former Member
0 Kudos

I now placed the dependent jars in the app as stated in the documentation - and this error stopped.

But the report still does not display. For the moment i have

a) commented the whole TreeWidget_getHTML javascript function

and

b)set viewer.setDisplayGroupTree(false);

So now the report displays - but if any report needs grouping/drill down - this temporary solution will not work.

Will try out the frame option now....sigh...

JM