on 06-02-2010 1:23 PM
Hello everyone,
I have a requirement for a database to be verified everytime the report is run, because of the dynamic nature of the data behind the report. However, the ReportClientDocument.verifyDatabase() is not behaving as I think it should. I assume it should behave the same as using the 'Verfy Database' comand within CR2008.
NOTE: The report works PERFECTLY without the verifyDatabase() command. But because of the dynamic nature of the data you have to keep using 'Verify database' via the CR2008 designer! This is not sustainable.
Here is my JSP, I will post the error separately for readability:
//SOME IMPORT DONE HERE
CrystalReportViewer crystalReportViewer;
ReportClientDocument reportClientDocument;
Object reportSource;
ParameterFieldController parameterFieldController;
String reportType = request.getParameter("reporttype");
if (reportType == null) {
reportSource = session.getAttribute("reportSource");
}
else {
String reportPath = request.getParameter("report");
String DB_USER_NAME = new String(Base64.base64ToByteArray(request.getParameter("dbusername")));
String DB_PASSWORD = new String(Base64.base64ToByteArray(request.getParameter("dbpassword")));
reportClientDocument = new ReportClientDocument();
reportClientDocument.open(reportPath, OpenReportOptions._openAsReadOnly);
reportClientDocument.getDatabaseController().logon(DB_USER_NAME, DB_PASSWORD);
IStrings subreportNames = reportClientDocument.getSubreportController().getSubreportNames();
for (int i = 0; i < subreportNames.size(); i++) {
ISubreportClientDocument subreportClientDoc = reportClientDocument.getSubreportController().getSubreport(subreportNames.getString(i));
subreportClientDoc.getDatabaseController().logon(DB_USER_NAME, DB_PASSWORD);
}
reportClientDocument.verifyDatabase();
// SOME PARAMETERS SET HERE
reportSource = reportClientDocument.getReportSource();
reportClientDocument.close();
}
Does anyone have any examples of how to use the verifyDatabase, or can you see where I am going wrong?
Best Regards
Nick Hirst
The error reads:
-
com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: java.lang.NullPointerException---- Error code:-2147467259 Error code name:failed
com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(Unknown Source)
com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(Unknown Source)
com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.a(Unknown Source)
com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.call(Unknown Source)
com.crystaldecisions.reports.common.ThreadGuard.syncExecute(Unknown Source)
com.businessobjects.reports.sdk.JRCCommunicationAdapter.for(Unknown Source)
com.businessobjects.reports.sdk.JRCCommunicationAdapter.int(Unknown Source)
com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
com.businessobjects.sdk.erom.jrc.a.a(Unknown Source)
com.businessobjects.sdk.erom.jrc.a.execute(Unknown Source)
com.crystaldecisions.proxy.remoteagent.RemoteAgent$a.execute(Unknown Source)
com.crystaldecisions.proxy.remoteagent.CommunicationChannel.a(Unknown Source)
com.crystaldecisions.proxy.remoteagent.RemoteAgent.a(Unknown Source)
com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.if(Unknown Source)
com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.a(Unknown Source)
com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.new(Unknown Source)
com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.verifyDatabase(Unknown Source)
com.crystaldecisions.reports.sdk.ReportClientDocument.verifyDatabase(Unknown Source)
org.apache.jsp.CrystalReportViewer_jsp._jspService(CrystalReportViewer_jsp.java:91)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The error is being thrown when the report viewer JSP is trying to execute. It complains specifically about the line that executes verifyDatabase.
When I use the verifyDatabase command in the report designer, no mapping fields pop up. It does prompt for parameters for each stored procedure used within the reports sub-reports, I assume to verify the sub-reports aswell.
Thanks in advance
Nick
User | Count |
---|---|
77 | |
9 | |
9 | |
7 | |
6 | |
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.