Issue with Data Formatted as Percent on Report

Stimulsoft Reports.NET discussion
Post Reply
tlentine
Posts: 1
Joined: Thu Dec 21, 2017 4:12 pm

Issue with Data Formatted as Percent on Report

Post by tlentine »

I am creating a report whose underlying data structure includes several nullable double fields. These fields need to be formatted as a percentage on the report, which is easy enough to do. My problem is that in some cases where no data is available for one of these fields, the underlying data source will have a null value instead of a numeric (double).

When the report is previewed or rendered, the fields that have a null value display on the report as 0.00%, not null or blank as I would expect them to. If I toggle the Hide Zeros option it will suppress these from showing, but it will also suppress any records where 0 is a legitimate value.

Is there a way I can have a nullable double field format as a percentage only if the data is not null, and if the underlying data is null, have it display as a blank record?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Issue with Data Formatted as Percent on Report

Post by Alex K. »

Hello,

Please try to use the following expression:
{DataSourceName["ColumnName"] == DBNull.Value ? "" : DataSourceName["ColumnName"]}

Also, please try to set the ConvertNulls property to false.

Thank you.
Post Reply