Hello i Have this script in my Library on (before open) ODA
importPackage( Packages.java.lang );
importPackage( Packages.java.util );
importPackage( Packages.javax.servlet.http);
httpServletReq = reportContext.getHttpServletRequest();
session = httpServletReq.getSession();
if ( reportContext.getHttpServletRequest().getParameter("urlB") != null &&
reportContext.getHttpServletRequest().getParameter("usrB") != null &&
reportContext.getHttpServletRequest().getParameter("pasB") != null
)
{
this.setExtensionProperty("odaURL", reportContext.getHttpServletRequest().getParameter("DatabaseUrl"));
this.setExtensionProperty("odaUser", reportContext.getHttpServletRequest().getParameter("DatabaseUserName"));
this.setExtensionProperty("odaPassword",reportContext.getHttpServletRequest().getParameter("DatabasePassword"));
}
if ( reportContext.getHttpServletRequest().getParameter("DatabaseJndi") != null)
{
// set the birt variable jndi to the jndi url parameter
this.setExtensionProperty("odaJndiName", reportContext.getHttpServletRequest().getParameter("DatabaseJndi"));
}
if ( session.getAttribute("sessionJndi") != null &&
session.getAttribute("sessionJndiPrivilege") != null )
{
}
// if all of this fail the birt report will try to execute with the development variables set on the report it self.
true;
it works fine on the web container getting the jndi connection from the session, but in design (Eclipe ou BIRT RCP DESIGNER ) time when on the data set - query the output columns it crash.
Of course because of the reportContext.getHttpServletRequest not available in design time on the eclipse.
Can some one please help me find a way of knowing when i'm in design time (ECLIPSE BIRT RCP DESIGNER) and skip this javascipt block , and not in the web container ?
Thanks in advance
Paulo Costa
I have found on this url a similar if not the same problem, please take a look at
http://www.birt-exchange.org/org/forum/index.php/topic/21126-connection-profile-url/ on the post started at 21 December 2010 - 01:20 PM