on 09-12-2008 8:18 AM
Hello
Escuse me for my bad english
In businessobjects crystal report 11 when I use The Url
serveur/businessobjects/enterprise11/desktoplaunch/opendoc/openDocument.jsp?sDocName=Doc_Acquisition&apsuser=Myuser&apspassword=123
The first Time I have a messagebox authentification , user password and My document
crystal report is open .
The second time i have access directly to my document ( No message box)
I would like the first time i have access to my document directly (I don't want the
message box authentification).
It's possible ?
The script are on crystal reports opendocument.jsp documentxml.jsp
yourserveur/businessobjects/enterprise11/desktoplaunch/opendoc/)
have you an example ?
I dont want display logon.do the first time
have you an solution
Can you send me an example with a script that access directly to my document
Good luck
Thank you very much
hello
Now my script connect directly .... but i have again an problem when i call
my document ...
this a script jsp test.jsp , it is ok
by
http://pa/businessobjects/enterprise11/desktoplaunch/opendoc/test.jsp
connection is directly and it's ok
but if i append the line infoViewURL
to display my report test1.rpt
infoViewURL="http://pa/businessobjects/enterprise11/desktoplaunch/opendoc/openDocument.jsp?sDocName=test1sType=wid&sRefresh=Y&sOutputFormat=P&sWindow=New";
when i launch
I have an error message
it said "not licence Valid error INF"
Why ?
I have installed crystal server 11 on my Xp and i have not
problem of licence
I don't understand,
Thank you very much
script
test.jsp
<%@ page import = 'com.crystaldecisions.sdk.occa.infostore.*,
com.crystaldecisions.sdk.plugin.desktop.common.*,
com.crystaldecisions.sdk.framework.*,
com.crystaldecisions.sdk.occa.security.*,
com.crystaldecisions.sdk.exception.SDKException'%>
<%
try {
String cms = "pa";
String username = "Administrator";
String password = "";
String auth = "secEnterprise";
// Attempt logon. Create an Enterprise session
// manager object.
ISessionMgr sm = CrystalEnterprise.getSessionMgr();
//Log on to BusinessObjects Enterprise
IEnterpriseSession enterpriseSession = sm.logon(username, password, cms, auth);
ILogonTokenMgr logonTokenMgr = enterpriseSession.getLogonTokenMgr();
String defaultToken = logonTokenMgr.getDefaultToken();
enterpriseSession = sm.logonWithToken(defaultToken);
session.setAttribute("strToken",defaultToken);
session.setAttribute("logonToken", defaultToken); session.setAttribute("enterpriseSession",enterpriseSession);
session.setAttribute("CE_ENTERPRISESESSION", enterpriseSession);
String
infoViewURL="http://pa/businessobjects/enterprise11/desktoplaunch/opendoc/openDocument.jsp?sDocName=test1&sType=wid&sRefresh=Y&sOutputFormat=P&sWindow=New";
/* URL request */
response.sendRedirect(infoViewURL);
}
catch(SDKException sdkEx){
out.println(sdkEx);
}
%>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
with openDocument you can't pass the CMS logon credentials in the URL anymore( as opposed to viewrpt.cwr) so you will need to logon to CMS and create a token and pass the token in the URL so that you won't be prompted with authentication box.
There is an article available in SAP's Service Market Place if you can access it, though currently the link is unavailable. Alternately you can download java samples from link below and look in viewing for a sample called view_urlreporting_crystalrpt. It shows how to create a token in a JSP page and redirect to the report viewer using openDocument.jsp.
https://boc.sdn.sap.com/node/3211
Thanks
Aasavari
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Aasavari
Do you speak French ?
Thanks for example view_report --> it's Ok
I have changed the programmation to have access directly
what do you think,
When i have changed the file jsp to have access directly ( no message box logon)
the old version jsp display ?
why ? stop the services tomcat ? or stop the service crystal cache server ?
I look forward to be hearing from you
sincerely
Michel
logonform.jsp
<%!
/**************************** class LogonForm ***************************
This logon form is used to gather the logon information needed
to login to Enterprise
***********************************************************************/
private class LogonForm {
HttpServletResponse response;
HttpServletRequest request;
int num_reports_needed = 1;
String[] reportname;
public static final int NONE = 0;
public static final int REPORT_NAME = 1;
public static final int REPORT_NAME_X2 = 2;
/************************************************************************
Constructor - Save the response and request objects
***********************************************************************/
LogonForm(HttpServletResponse response, HttpServletRequest request)
{
//this.response = response;
//this.request = request;
}
/************************************************************************
Constructor with options - Add some optional boxes to request other
input from the user such as reportnames.
***********************************************************************/
LogonForm(HttpServletResponse response, HttpServletRequest request, int extra_requests) {
this.response = response;
this.request = request;
switch (extra_requests) {
case NONE:
break;
case REPORT_NAME:
num_reports_needed = 1;
reportname = new String[1];
break;
case REPORT_NAME_X2:
num_reports_needed = 2;
reportname = new String[2];
break;
}
}
/************************************************************************
If we do not already have the logon information, print a logon form.
Return true if a logon form was printed, false if it wasn't.
***********************************************************************/
public boolean display_if_needed() throws java.io.IOException {
reportname[0] = "TEST1"; // my report
return false;
}
}
%>
view_report.jsp
<%
/*
Applies to Versions: XI
Creation Date: Febuary 28 2005
Description:
This sample to demonstrates how to view a Crystal Report on demand in
* the zero-client DHTML viewer.
Author: CW.
*/
%>
<%@ page import = "com.crystaldecisions.sdk.occa.infostore.*,
com.crystaldecisions.sdk.plugin.desktop.common.*,
com.crystaldecisions.sdk.framework.*,
com.crystaldecisions.sdk.occa.security.*,
com.crystaldecisions.sdk.exception.SDKException,
com.crystaldecisions.sdk.occa.managedreports.IReportSourceFactory,
java.util.Locale,
com.crystaldecisions.sdk.occa.report.reportsource.IReportSource"
%>
<%@ include file = "logonform.jsp" %>
<%
try {
//If logon information is required, display the logonForm and exit.
//Create a special logon form that requests 2 Report Names
//(code for LogonForm class is included).
LogonForm logonform = new LogonForm(response, request, LogonForm.REPORT_NAME);
if (logonform.display_if_needed()) return;
//Log in.
// access directly
IEnterpriseSession enterpriseSession = CrystalEnterprise.getSessionMgr().logon("Administrator","", "pa", "secEnterprise");
//Grab the InfoStore from the httpsession
IInfoStore infoStore = (IInfoStore)enterpriseSession.getService("", "InfoStore");
//Query for the report object in the CMS. See the Developer Reference guide for more information the query language.
IInfoObjects oInfoObjects = (IInfoObjects)infoStore.query("SELECT TOP 1 * " +
"FROM CI_INFOOBJECTS " +
"WHERE SI_PROGID = 'CrystalEnterprise.Report' AND SI_INSTANCE=0 AND SI_NAME='" + logonform.reportname[0] + "'" );
if (oInfoObjects.size() > 0) {
//Retrieve the latest instance of the report
IInfoObject oInfoObject = (IInfoObject) oInfoObjects.get(0);
//Use the PS report factory to obtain a report source that will be processed on the Page Server.
IReportSourceFactory factoryPS = (IReportSourceFactory)enterpriseSession.getService("PSReportFactory");
Object reportSource = factoryPS.openReportSource((oInfoObject), Locale.ENGLISH);
session.setAttribute("reportSource", reportSource);
//View the report in the standard DHTML viewer.
response.sendRedirect("CrystalReportViewer.jsp");
}
else {
out.println("Report " + logonform.reportname[0] + " not found.");
}
}
catch(SDKException sdkEx) {
out.println(sdkEx);
}
%>
"Crystal report i don't want message box authentification but automatically
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.