Some Ad-Hoc views do not run anymore in advanced reporting
search cancel

Some Ad-Hoc views do not run anymore in advanced reporting

book

Article ID: 217603

calendar_today

Updated On:

Products

Clarity PPM On Premise Clarity PPM SaaS

Issue/Introduction

There are some Adhoc views that have stopped working suddenly. Following is the error message that is thrown.

Error getting schema

Error Trace
java.lang.RuntimeException: Error getting schema at com.jaspersoft.commons.semantic.datasource.SemanticLayerDataSourceService.setReportParameterValues(SemanticLayerDataSourceService.java:98) at com.jaspersoft.ji.adhoc.metadata.AdhocTopicMetadata.setDatasource(AdhocTopicMetadata.java:440) at com.jaspersoft.ji.adhoc.metadata.AdhocTopicMetadata.initDatasource(AdhocTopicMetadata.java:413) at

Environment

Version: 15.9.2

Jaspersoft Version: 7.8

Cause

The underlying domain on which the Adhoc view is built would have undergone a change, whereby the columns that the Adhoc view relies upon, are no longer available in the domain.

If an OOTB domain was customized, then the "Restore Domains" job could have erased those customizations.

Resolution

Out of the Box domains should not be customized. A copy can be taken, and customized instead.

  1. Rebuild the Adhoc view if the columns and filter that were present on it are known or
  2. Restore the domain from a backup that is stored elsewhere in a content management tool or
  3. Refer to the topicJRXML.data file to find which columns and filters are present in the Adhoc view that is no longer working

Additional Information

The way to obtain and interpret topicJRXML.data is as below.

  1. Export the Adhoc view from the Advanced Reporting repository
  2. Then search for the file in the following path: <parent folder>\resources\<folder where Adhoc view is stored>\ad_hoc_components\<Adhoc View ID>_files\

This file can be opened using Notepad ++.

The file will have a section within it such as the one below. Each node with <queryField> tag is a column. Each node with <queryFilterString> is a filter. The "id" attribute within the <queryField> tag provides the column name and the node it is in. For instance, in the below XML, "resource.employmentType" is mentioned as ID. This means that "employmentType" is a column under node "resource".

<query xmlns="http://www.jaspersoft.com/2007/SL/XMLSchema">
  <queryFields>
    <queryField id="resources.investments.investmentID" />
    <queryField id="resources.summaryTotals.assignmentTotals.totalHoursAssignment.assignmentTotalActualHours" />
    <queryField id="resources.employmentType" />
  </queryFields>
  <queryFilterString>resources.obs.obsType == obsType_1</queryFilterString>
</query>