eQL Report will work in eB Director client but fail in eB Web with error: "Object reference not set


  
 Applies To 
  
 Product(s):eB Core; eB Server;eQL;Reports
 Version(s):15.04.01 and higher
 Environment: N/A
 Area: eQL Reports
 Subarea: N/A
 Original Author:Bentley Technical Support Group
  

 

 

 

 

 

 

 

 

Problem

Running some eQL reports in eB Web Client will yield error message : "Object reference not set to an instance of an object.". Same report will execute without errors in eB Director Client.

 

Cause

Reports that include in SELECT statement data under the Relationships---->Copies properties of a DOCUMENT that retrieve NULL values may cause this behavior. This is due to eB Web client interface trying to access a non existing rows  in eB database table.

For example the following eQL will cause the error:

START WITH Document
SELECT
   Code,
   Revision,
   Name,
   State,
   Copies.Files.Name,
   Copies.Location.Code,
   ApprovalStatus,
   Id
WHERE
    Code LIKE @Doc_No
   AND Revision LIKE @Rev
   AND Copies.CopyType = 'M'
   AND IsLatestRevision = 'Y'

Solution

To retrieve these NULLs in eB Web Client please add the “TRIM” function to the SELECT column(s) that causes the error. In example above you want to add "TRIM" to columns "Copies.Files.Name" and "Copies.Location.Code":

 


START WITH Document
SELECT
   Code,
   Revision,
   Name,
   TRIM( Copies.Files.Name ),
   TRIM( Copies.Location.Code ),
   ApprovalStatus,
   Id
WHERE
   Code LIKE @Doc_No
   AND Revision LIKE @Rev
   AND Copies.CopyType = 'M'
   AND IsLatestRevision = 'Y'

 

By adding the TRIM you "force"  eBWeb to retrieve all values (NULL or not) and then format them for display. Not having a TRIM makes eBweb retrieve and display at the same time which causes the error when no value is found for one of the columns.

  

 

Comments or Corrections?

Bentley's Technical Support Group requests that you please confine any comments you have on this Wiki entry to this "Comments or Corrections?" section. THANK YOU!