cancel
Showing results for 
Search instead for 
Did you mean: 

Verify Database not working!

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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)

Adam_Stone
Active Contributor
0 Kudos

Is the error being thrown when calling verifyDatabase, or is it when you attempt to view the report?

Also, when you do a verify in the report designer, do you get the field mapping box being displayed?

Former Member
0 Kudos

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

Adam_Stone
Active Contributor
0 Kudos

Since the designer is prompting for the parameters, have you tried setting the parameter values in code before calling verifyDatabase?