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 below:
  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 JReport.bat in <install_root>\bin by appending the four classes to the class path. Assume that the four classes are located in d:\test\myudo.

    Change: ... -classpath "c:\jreport\designer\lib\report.jar; ...c:\temp" ...
    To : ... -classpath "c:\jreport\designer\lib\report.jar;d:\test; ... c:\temp" ...

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