Thursday, February 18, 2010

OBIEE JavaScript and comments

When you write large pieces of custom javascript on a report you might run into the strange problem that it works during development, you can save it without a problem, but when you reopen it in another session it doesn’t work anymore.

Most of the time this is caused by the rendering process of the report XML by the presentation server.

When obiee loads a report for the first time during a session it performs a SET XML. (like pushing the SET XML button in the advanced TAB => image

This causes your nicely formatted script which looked like this:

image

to look like this:

image

Basically it has become one long string. You might run into trouble because of comment lines starting with // in your code. This turns the rest of the string into a comment. Always encapsulate your comments as /*..comment..*/ .

An other problem might be missing semi-colon “; “. Always close your process steps with one.

Till Next Time

No comments: