Skip to main content



      Home
Home » Archived » BIRT » Replace zero values with a custom string in a table with aggregated values ...
Replace zero values with a custom string in a table with aggregated values ... [message #1828445] Tue, 09 June 2020 18:11 Go to next message
Eclipse UserFriend
Hi All,

In one of my reports, I'm trying to reproduce an Excel custom number formatting:

### ### ### ##0;-### ### ### ##0;"p.m."

In Excel this rule displays all ZERO values as the string "p.m.".

I tried the custom format string in the "Format number", custom settings. It does not work.

In my report I need to present the ZERO (0) values as the string "p.m." and at the same time my aggregation sum on this column should still work (no conversion errors).

For example, in my column I have the values
10
20
0
30
0
40
Total aggregation = 100

In my report I need to display this:
10
20
p.m.
30
p.m.
40
Total aggregation = 100

Any ideas or suggestions are welcome.

Thank you!
Re: Replace zero values with a custom string in a table with aggregated values ... [message #1828468 is a reply to message #1828445] Wed, 10 June 2020 06:44 Go to previous message
Eclipse UserFriend
Hi All,

I found a solution.
As I was only needing to display zeros (0) as "p.m" visually, I used the OnRender event of the cell element. The code below did the trick:

var newval=this.getValue().toString(); if (newval==0) {this.setDisplayValue("p.m.")}

Previous Topic:Page Break based on row count of two Tables
Next Topic: How birt handles Khmer text
Goto Forum:
  


Current Time: Sat Jul 12 12:54:55 EDT 2025

Powered by FUDForum. Page generated in 0.03669 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top