on 10-06-2012 12:43 PM
We are having web application reports in the application using BO-XI SDK Viewer API. This API approach was working fine earlier. We upgrade our reporting component to SAP BO-4 (Crystal Server 2011) due to EOL of BOXI.
We have updated new API’s provided by SAP as per guide.
We updated web based Crystal Report Viewer (DHTML Viewer). The crystalreportviewer folder coming with SAP CS 2011.
We applied updated patch set upto last patch released CS2011 SP4 Patch4.
We still facing issue while viewing report in DHTML viewer provided by SAP. Please advice on below.
In our web application we do have updated folder for /crystalreportviewer.
We dynamically creating enterprise session object to get client document which explained as below –
IEnterpriseSession es = null;
try{
es = sm.logon(mUser, mPassword, mAPSName, mAuthType);
}catch(Exception e){
// request dispatched to error page
}
// Get the Report Application Factory service from Crystal Enterprise
IReportAppFactory rptAppFactory = (IReportAppFactory)es.getService("", "RASReportService");
// Get the InfoStore service from Crystal Enterprise
IInfoStore infoStore = (IInfoStore)es.getService("", "InfoStore");
IInfoObjects oInfoObjects = infoStore.query(“Select * From CI_INFOOBJECTS…for RPT File.”);
ReportClientDocument clientDoc = rptAppFactory.openDocument((IInfoObject)oInfoObjects.get(0), 0, objLocale);
Setting parameter
// Setting Parameter to clientDoc
Object[] parameters = {
parseDate(fromDate),
parseDate(endDate),
getLanguageID(request),
reportName,
getLanguageID(request)
};
Fields parameterFields = clientDoc.getDataDefController().getDataDefinition().getParameterFields();
for(int index=0; index < parameters.length; index++){
ParameterField oldParameter = (ParameterField)parameterFields.getField(index);
ParameterField newParameter = (ParameterField) oldParameter.clone(true);
newParameter.getCurrentValues().removeAllElements();
ParameterFieldDiscreteValue newDiscreteValueObj = new ParameterFieldDiscreteValue();
newDiscreteValueObj.setValue(parameters[index]);
newParameter.getCurrentValues().add(newDiscreteValueObj);
ParameterFieldController paramController = clientDoc.getDataDefController().getParameterFieldController();
paramController.modify(oldParameter, newParameter);
}
// Create an Viewer
CrystalReportViewer viewer = new CrystalReportViewer();
//Set the name for the interactive viewer
//Set Navigation button false
//Set best fit to page true
// Set reuse parameter on referesh
// Set Own Page true
// Enabled export and print button
// Group Tree Removed
// Toggle group false
//viewer.refresh();
// Removed refersh button
// Set the source for the interactive viewer to the client documents report source
// Retain parameter and set again for pagination in viewer
setReportURL(viewer,request);
// Process the http request to view the report
//response.flushBuffer();
// Close client document
// Dispose of the viewer object
Issue we faced?
a) On Pagination thorws exception in webreportinglog as
[@APPNAME@] ERROR [[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] WebReportLogger.error(62) | Unable to set the ancestors
at com.businessobjects.report.web.json.JSONObject.getJSONArray(JSONObject.java:456)
at com.businessobjects.report.web.shared.JSONParameter.getDiscreteValueFromJSON(JSONParameter.java:670)
at com.businessobjects.report.web.shared.JSONParameter.getValueFromJSON(JSONParameter.java:609)
at com.businessobjects.report.web.shared.JSONParameter.jsonToDefaultFieldValues(JSONParameter.java:587)
at com.businessobjects.report.web.shared.JSONParameter.getDefaultValues(JSONParameter.java:474)
at com.businessobjects.report.web.shared.JSONParameter.toParameterField(JSONParameter.java:872)
at com.businessobjects.report.web.shared.ParametersHelper.jsonToFields(ParametersHelper.java:309)
at com.businessobjects.report.web.state.ViewerState.restoreCommonState(ViewerState.java:2838)
at com.businessobjects.report.web.state.ViewerState.restore(ViewerState.java:2741)
at com.businessobjects.report.web.component.ViewerContainer.restoreState(ViewerContainer.java:210)
at com.businessobjects.report.web.WorkflowController.loadViewState(WorkflowController.java:418)
at com.businessobjects.report.web.WorkflowController.init(WorkflowController.java:393)
b) On Export / print button nothing happened even request didn’t passed.
WEB-INF/web.xml entry as below.
<?xml version="1.0"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<context-param>
<param-name>crystal_document_view</param-name>
<!-- weblayout : Fills the entire report view pane with the report. There is no grey background -->
<param-value>weblayout</param-value>
</context-param>
<context-param>
<param-name>crystal_exception_log_file</param-name>
<param-value>webreportingexception.log</param-value>
</context-param>
<context-param>
<param-name>crystal_exception_info</param-name>
<!-- long - Displays the exception information with the accompanying stack trace. -->
<param-value>long</param-value>
</context-param>
<context-param>
<param-name>crystal_image_uri</param-name>
<param-value>/TangibleWebApp/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_processing_indicator_delay</param-name>
<param-value>100</param-value>
</context-param>
<context-param>
<param-name>crystal_use_asynchronous_requests</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>crystal_servlet_uri</param-name>
<param-value>/TangibleWebApp/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>/TangibleWebApp/CrystalReportViewerHandler</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>document</servlet-name>
<servlet-class>com.oreilly.servlet.OpenDoc</servlet-class>
</servlet>
<servlet>
<servlet-name>InitialServlet</servlet-name>
<servlet-class>com.servlet.InitialServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>FactorsLogo</servlet-name>
<servlet-class>com.servlet.FactorsLogo</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>FactorsLogo</servlet-name>
<url-pattern>/servlet/FactorsLogo</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>document</servlet-name>
<url-pattern>/servlet/document</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>/tangible/index.jsp</welcome-file>
</welcome-file-list>
<listener>
<listener-class>com.common.util.applistener.AppListener</listener-class>
</listener>
</web-app>
Thanks in advance for your advice / suggestions.
Hello All,
I am also facing same pagination exception. Could someone help me on it to get it resolve.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Nilesh,
Thanks for the reply. Well i have all the jars in web application context. however, i am not sure, how can i check the jar version. I have copied them from the SAP installation dir. Our few sample crystal reports are working fine with those jars. Might be we are not setting the parameter anywhere in sample code. Could you please assist me if i can download these jars online from any link.
Thanks,
Rajiv
Hi! Nilesh More, I also encountered the same problem, did you solved the problem, this is caused by what, can you tell me about your solution, thank you very much!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Am I right in guessing that you were previously using the ActiveX viewer?
Currently your code is closing the document and logging off Enterprise. Pretty much any action that is done in the DHTML viewer will cause a postback to the server which will no longer have the document or session available with your current code which will cause all sorts of problems. You need to persist these objects, and only clean them up once you are completely finished with them.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.