Skip to content

Ad Hoc Not Displaying Data Due To Timezone Issues

When the database and JasperReports Server operate in different timezones, it can lead to inaccurate calculations for distinct counts on timestamp data, which can result in ad hoc not displaying data for some date/time interval. To resolve this, the processing for distinct counts must be forced to occur entirely within JasperReports Server, ensuring a consistent timezone is used for all calculations.

Configuration for Distinct Count Calculation Method

Configuration File

WEB-INF/applicationContext-adhoc-dataStrategy.xml

Property

Description

<bean class="com.jaspersoft.ji.adhoc.strategy.AggregateConfig"><property name="name" value="CountDistinct"/><property name="functionName" value="CountDistinct"/><!-- distinct count not currently mapped directly to sql func --><property name="calcMethod" value="sqlGroupBy"/></bean>

To enforce server-side processing for distinct counts, you must modify the AggregateConfig bean for CountDistinct. This involves changing the value of the calcMethod property from sqlUnionAll to sqlGroupBy.