This example describes how to access a record for your UDO and how to register your UDO with the report system.
|
|
|
|
Note: Since the compiling process of JReport Designer differs with that of JReport Server, when you run UDOs in these two applications, you should pay attention to some minor differences. For example, to get width and height, in JReport Designer, you should use:
w = guitools.toolkit.Unit.convertUnitToPixel(((Integer)propertySetable.getPropertyByName
("Width").getObject()).intValue());
h = guitools.toolkit.Unit.convertUnitToPixel(((Integer)propertySetable.getPropertyByName
("Height").getObject()).intValue());
While in JReport Server, you should use the following instead:
JRObjectResult obj = (JRObjectResult)propertySetable;
w = guitools.toolkit.Unit.convertUnitToPixel(obj.getTemplate().getWidth(obj));
h = guitools.toolkit.Unit.convertUnitToPixel(obj.getTemplate().getHeight(obj));
To compile these four Java files, you should add report.jar and JREngine.jar with their path into the class path. For example, use the following command:
Javac -classpath "C:\JReport\Designer\lib\JRengine.jar;C:\JReport\Designer\lib\report.jar;C:\test "MyDbFld.java
Here it is assumed that JReport Designer is installed to C:\JReport\Designer
. The Java files for the example are in C:\test\myudo
.
<install_root>\lib
directory by appending the four classes as follows:
|
<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;