Printing the fields from transaction class

I have created a transaction class with few fields. while printing the fields in driver and monitor, I want to print all fields in the driver and for monitor, I want to print some fields not all.

say, for example, I have a transaction class named as “xtn” with some fields like,

 1.Address
 2.burst
 3.length
 4.size
 5.data

In drive, I wanna print all 5 items. to print all item we can use “xtn.print()”.

But In the monitor, I want to print 2 items only, like data and address.
how can I print like this? what function I have to use?

In reply to sriganeshd:

Create 2 separate method to print items in transaction class.

In reply to Rahulkumar Patel:

In reply to sriganeshd:
Create 2 separate method to print items in transaction class.

Like, creating two separate do_print methods inside the transaction class?

In reply to sriganeshd:

monitor_print()