Example 2: Making a group based on a UDO

This example describes how to make a group based on a UDO. This sample is similar to a summary field. This example includes the implementation of four classes and shares a class with Example 1.

  1. Create the template, result, creator and render files as follows:
  2. Compile the four Java files in the same way as Example 1.
  3. Modify udo.ini in <install_root>\lib\ by appending the four classes as follows:
    Begin
    name=MySumFld 
    template=myudo.MySumFld 
    resultobject=myudo.MySumFldRst 
    resultcreator=myudo.MySumFldCreator 
    resultviewer=myudo.MyDbFldRender
    End
  4. Edit setenv.bat in <install_root>\bin by appending the path of the four classes to the batch file's ADDCLASSPATH variable. Assume that the four classes are located in D:\test\myudo.

    set ADDCLASSPATH=%JAVAHOME%\lib\tools.jar;D:\test;

  5. Start JReport Designer.
  6. Click Insert > UDO. You will now find a new UDO object named MySumFld in the drop-down list of the Insert UDO dialog.