Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Evaluate all datasets for nulls
Evaluate all datasets for nulls [message #1009301] Thu, 14 February 2013 21:23 Go to next message
Mike S is currently offline Mike SFriend
Messages: 7
Registered: November 2010
Junior Member
Hi, i am working on a custom report where the customer wants to replace all NULL with 'N/A'. I know how to accomplish this on a per field basis but that can be very tedious and time consuming. I have been looking through the script events when a report is run to determine what is the best place to add code to check for nulls in all datasets and replace them with 'N/A'. Should this be done beforeClose, afterClose, or during the presentation phase?

Any tips on Java code that would perform such action would also be helpful

Thanks
Mike
Re: Evaluate all datasets for nulls [message #1009454 is a reply to message #1009301] Fri, 15 February 2013 07:06 Go to previous messageGo to next message
David Good is currently offline David GoodFriend
Messages: 41
Registered: September 2012
Member
Hi Mike,

I have just run a test and it can be done using styles:

In the report create a new style (I named mine null_map)
In the condition use: this.value, equal to, null for the 3 inputs
In your report select the most parental object (i.e. grid) and apply the style

I have only run a simple test, please let me know how you go.

Another way which may work for you if the array assignment is possible:

In the onFetch method of each dataset place the row's fields into separate indexes of an array. Find the length of the array and then loop through its indexes to replace any nulls with N/A, before passing back to the report. It may work and I would be keen to hear if someone has. This method would affect performance, but possibly not very much.

Good luck let me know how you go.

David
Re: Evaluate all datasets for nulls [message #1013045 is a reply to message #1009454] Fri, 22 February 2013 16:58 Go to previous messageGo to next message
Mike S is currently offline Mike SFriend
Messages: 7
Registered: November 2010
Junior Member
David, i tried this method but when i run the report i get an error stating "this.value is invalid"
Re: Evaluate all datasets for nulls [message #1013106 is a reply to message #1009301] Fri, 22 February 2013 19:54 Go to previous messageGo to next message
Mike S is currently offline Mike SFriend
Messages: 7
Registered: November 2010
Junior Member
Correction, i was using uppercase NULL. When i use lowercase null every field is N/A.
Re: Evaluate all datasets for nulls [message #1014830 is a reply to message #1013106] Tue, 26 February 2013 14:53 Go to previous message
Mike S is currently offline Mike SFriend
Messages: 7
Registered: November 2010
Junior Member
Im giving this a bump since someone created a ton of messages with the same topic above.

Anyone have a solution?

Thanks
Mike

Previous Topic:BIRT ppt report doesn't work with office 2012
Next Topic:Scripted datasource : wrong scope for "this" in Birt 4.2.1
Goto Forum:
  


Current Time: Thu Feb 02 02:52:27 GMT 2023

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

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

Back to the top