cancel
Showing results for 
Search instead for 
Did you mean: 

JSP code doesn't load the embedded dashboard

former_member220628
Participant
0 Kudos

Hi all,

I've embedded the OpenDocument URL of a dashboard in my JSP code and since I've created a logon token, I expect that the BI launchpad logon screen be bypassed. But the dashboard cannot be even loaded.

Here is the code

Code:


IEnterpriseSession enterpriseSession=null;

ISessionMgr enterpriseSessionMgr = CrystalEnterprise.getSessionMgr();

enterpriseSession = enterpriseSessionMgr.logon(userName, password, systemName, authType);

ILogonTokenMgr logonTokenMgr = enterpriseSession.getLogonTokenMgr();


defaultToken = logonTokenMgr.getDefaultToken();


Response.sendRedirect("http://BOServer:8080/BOE/OpenDocument/opendoc/openDocument.jsp?sIDType=CUID&iDocID=AUZC.3sK_mtCuO1vc..."+defaultToken );



If the &Token=defaultToken is removed, at least the dashboard should be loaded but it doesn't;no error messages are shown and the page keeps waiting.

The dashboard loads properly if I copy the whole URL including the generated token from the source of the page to a new tab in the browser.


And if I place the SWF file beside the JSP, the dashboard loads and the logon screen is bypassed successfully but I do not want to copy the SWF on the web server.

Any ideas?

I'm using BO 4.1 SP4

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Parvaneh,

Which browser you are using to run your application(jsp page). Have you tried the workflow in different broswers?

What happens if you directly paste the opendocument url in the browser

http://BOServer:8080/BOE/OpenDocument/opendoc/openDocument.jsp?sIDType=CUID&iDocID=AUZC.3sK_mtCuO1vc..., do you get the login screen and providing the credentials are you able to view the dashboard?

Also, if possible please provide the screenshot of the screen as well as the entire jsp code if possible.

Thanks,

Prithvi

former_member220628
Participant
0 Kudos

Hi Prithvi,

Thanks for the reply.

As I said before, when I copy the entire URL to the browser, the logon screen appears as expected; Even if I append the generated token to the end of the URL, the logon screen is bypassed. That's perfect.

But if run the JSP, it gets stuck. I just checked with Chrome. Surprisingly, the dashboard can be loaded in Chrome. ( Whereas Chrome gives me "Invalid Logon Token error "  if I place the SWF file beside the JSP , instead of using Open Document)

Anyway, this is my code:

<%@ page import="com.crystaldecisions.sdk.exception.SDKException" %>

<%@ page import="com.crystaldecisions.sdk.framework.CrystalEnterprise" %>

<%@ page import="com.crystaldecisions.sdk.framework.IEnterpriseSession" %>

<%@ page import="com.crystaldecisions.sdk.framework.ISessionMgr" %>

<%@ page import="com.crystaldecisions.sdk.occa.infostore.IInfoStore" %>

<%@ page import="com.crystaldecisions.sdk.occa.security.ILogonTokenMgr"%>

<%! String defaultToken =null; %>

<%

try

{

//Here I initialize the fields

String systemName = "";

String userName = "";

String password = "";

String authType = "";

IEnterpriseSession enterpriseSession=null;

ISessionMgr enterpriseSessionMgr = CrystalEnterprise.getSessionMgr();

enterpriseSession = enterpriseSessionMgr.logon(userName, password, systemName, authType);

ILogonTokenMgr logonTokenMgr = enterpriseSession.getLogonTokenMgr();

defaultToken = logonTokenMgr.getDefaultToken();

Response.sendRedirect("http://SAP-BOServer:8080/BOE/OpenDocument/opendoc/openDocument.jsp?sIDType=CUID&iDocID=AUZC.3sK_mtCu..."+defaultToken );

}

catch(Exception e)

{

out.println(e);

}

%>

Former Member
0 Kudos

on BOE.war file where it is deployed, you have to set  OpenDocument.properties

allowinsecureembeding property value to True and restart Tomcat.....it will work.

Thank You,

Amol

former_member220628
Participant
0 Kudos

Thanks Amol but it did not work.

I changed that property in OpenDocument.Properties file in BOE folder and restarted tomcat (Of course, my JSP file is in AdminTools folder but there are no properties file there)

Is something missing??

Thanks

Former Member
0 Kudos

Your description in above two forums seems to be confusing....Could you please help me to narrowdown the issue?

1] The CUID specified in u r code seems to be ID for dashboard published to BO , is it correct?

2] After change to property which I mentioned and restart server, what is the status in Chrome?

3] If above is not working, please start fiddler utilty(its http dibuger) and launch u r URL in browser freshly so that it will capture the HTTP traffic. Please save and  attach the file to this forum.

4] As an out of box, just replace the CUID with one of the sample WEBI cuid that comes with product which may be Charting Sample to see what happens.

Thank You,

Amol

former_member220628
Participant
0 Kudos

Hi,

Sorry for the confusing posts!

1. Yes, that's the ID of a dashboard

2. Strangely, now I get a "Response cannot be resolved" error both in Chrome and IE.  I remember that Chrome used to work as mentioned in my second reply. I'm confused!

3. Attached

4. Same problem with the Webi Sample report.

If instead of Response.sendRedirect, I embed the URL in HTML body, no java errors are shown but still the dashboard cannot be displayed, neither in Chrome nor in IE.

By the way, the JSP file is on the Admintools folder on a test server and the dashboard is in my Production server.


Thank you

Former Member
0 Kudos

Hi Parvaneh,

It should be response.sendRedirect() rather than Response.sendRedirect().

Hope this helps.

Regards,

Rajarsh

former_member220628
Participant
0 Kudos

Hi Rajarsh,

Yes you are right. It's working now both in Chrome and IE ! Thanks a lot.

Do you also know why the dashboard/any report cannot be shown when I embed the open document URL in this code ?

<HTML>

<HEAD>

<TITLE>Dashboard </TITLE>

</HEAD>

<BODY>

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"

codebase="http://fpdownload.adobe.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"

WIDTH="1024" HEIGHT="782" id="myMovieName">

<PARAM NAME=FlashVars VALUE="CELogonToken=<%=defaultToken%>">

<PARAM NAME="movie" VALUE="">

<PARAM NAME="quality" VALUE="high">

<PARAM NAME="bgcolor" VALUE="#FFFFFF">

<PARAM NAME="play" VALUE="true">

<PARAM NAME="loop" VALUE="true">

<PARAM NAME=bgcolor VALUE="#FFFFFF">

<EMBED src="http://SAP-BOServer:8080/BOE/OpenDocument/opendoc/openDocument.jsp?sIDType=CUID&iDocID=AW4AVT1AUhVAo...<%=defaultToken%>" quality=high bgcolor=#FFFFFF WIDTH="800" HEIGHT="600"

NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash"

play="true" loop="true"

FlashVars="CELogonToken="

PLUGINSPAGE="http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">

</EMBED>

</OBJECT>

</BODY>

</HTML>

Both in IE and Chrome, nothing happens but If I copy the generated URL from the page source to a new browser tab, the dashboard is shown perfectly.  Any ideas?

Thanks

Former Member
0 Kudos

Hi Parvaneh,

Your posts are quite confusing. What excatly are you using the HTML file or the jsp code from the previous updates?

I assume that you are using the default Tomcat to run your application. If this is true, the actual cause of the problem can be known by analyzing the logs. Go to Tomcat logs folder and open the stderr log file, then search for the error message under your applicaion's name and add the error message here.

This might give us some idea to go forward towards the resolution.

Regards,

Rajarsh

former_member220628
Participant
0 Kudos

Hi Rajarsh,

Thanks for the reply. Yes I'm using Tomcat.

Calling the Opendocument URL via the response.sendRedirect works perfectly thanks to your help so I can now do what the customer has required.

But in different forums,I read that instead of response.sendRedirect, you can also embed the URL in the HTML code placed after the JSP section is finished. I am now curious why it does not work for me. Couldn't find anything related to this in Tomcat log.

This is the complete code in my JSP file.

<%@ page import="com.crystaldecisions.sdk.exception.SDKException" %>

<%@ page import="com.crystaldecisions.sdk.framework.CrystalEnterprise" %>

<%@ page import="com.crystaldecisions.sdk.framework.IEnterpriseSession" %>

<%@ page import="com.crystaldecisions.sdk.framework.ISessionMgr" %>

<%@ page import="com.crystaldecisions.sdk.occa.infostore.IInfoStore" %>

<%@ page import="com.crystaldecisions.sdk.occa.security.ILogonTokenMgr"%>

<%! String defaultToken =null; %>

<%

try

{

String systemName = "sap-BOServer:6400";

String userName = "myusername";

String password = "mypassword";

String authType = "secSAPR3";

IEnterpriseSession enterpriseSession=null;

ISessionMgr enterpriseSessionMgr = CrystalEnterprise.getSessionMgr();

enterpriseSession = enterpriseSessionMgr.logon(userName, password, systemName, authType);

ILogonTokenMgr logonTokenMgr = enterpriseSession.getLogonTokenMgr();

defaultToken = logonTokenMgr.getDefaultToken();

}

catch(Exception e)

{

out.println(e);

}

%>

<HTML>

<HEAD>

<TITLE>Dashboard </TITLE>

</HEAD>

<BODY>

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"

codebase="http://fpdownload.adobe.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"

WIDTH="1024" HEIGHT="782" id="myMovieName">

<PARAM NAME=FlashVars VALUE="CELogonToken=<%=defaultToken%>">

<PARAM NAME="movie" VALUE="">

<PARAM NAME="quality" VALUE="high">

<PARAM NAME="bgcolor" VALUE="#FFFFFF">

<PARAM NAME="play" VALUE="true">

<PARAM NAME="loop" VALUE="true">

<PARAM NAME=bgcolor VALUE="#FFFFFF">

<EMBED src="http://SAP-BOServer:8080/BOE/OpenDocument/opendoc/openDocument.jsp?sIDType=CUID&iDocID=AW4AVT1AUhVAo...<%=defaultToken%>" quality=high bgcolor=#FFFFFF WIDTH="800" HEIGHT="600"

NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash"

play="true" loop="true"

FlashVars="CELogonToken="

PLUGINSPAGE="http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">

</EMBED>

</OBJECT>

</BODY>

</HTML>

Former Member
0 Kudos

Hi Parvaneh,

I have never seen anything like this, moreover if the requirement is achieved using simple OpenDoc call, why do you want to embed the url as above? It will just increase the complexity of the application.

However, if you can point me to the blogs you are talking about I might be able to look into this.

Regards,

Rajarsh

former_member220628
Participant
0 Kudos

Hi Rajarsh,

Sorry for the late response.I was away on vacation..

Here is where I saw the sample code

Anyway,I 'll use the less complex solution as you suggested.

Thank a lot.

Answers (0)