Rotating text/image with JRotator

JRotator is used to rotate text or images. Since currently JReport supports rotating only images but not text, using JRotator to achieve text rotation becomes a feasible solution.

The following introduces three cases of using JRotator:

Using JRotator to rotate text
  1. Start JReport Designer and open the report in which you want to insert some rotated text.
  2. On the menu bar, click Insert > UDO.
  3. In the Insert UDO dialog, select JRotator from the drop-down list, and then click OK.
  4. Keep the JRotator focused and go to the Report Inspector.
  5. Locate the Display Value property and type in the required text in the value cell, then click outside of the cell. You will then see the typed text displayed in the JRotator.
  6. Specify a rotation degree in the value cell of the Rotate property, for example, 180, then click outside of the cell. You will then find the text in the JRotator reversed.
  7. Save the report.
Using JRotator to rotate an image
  1. Start JReport Designer and open the report in which you want to insert a rotated image.
  2. On the menu bar, click Insert > UDO.
  3. In the Insert UDO dialog, select JRotator from the drop-down list, and then click OK.
  4. Keep the JRotator focused and go to the Report Inspector.
  5. Specify the local path of the required image in the value cell of the Display Image property, for example, C:\image.jpg, then click outside of the cell. You will then see the image displayed in the JRotator.
  6. Specify a rotation degree in the value cell of the Rotate property, for example, 180, then click outside of the cell. You will then find the image in the JRotator reversed.
  7. Save the report.
Using JRotator to rotate a DBField
  1. Start JReport Designer and open the report in which you want to insert a rotated DBField.
  2. On the menu bar, click Insert > UDO.
  3. In the Insert UDO dialog, select JRotator from the drop-down list, and then click OK.
  4. Keep the JRotator focused and go to the Report Inspector.
  5. In the Display Value value cell, create a formula which returns the required DBField and then select the formula. Then click outside of the cell and you will see the DBField displayed in the JRotator.
  6. Specify a rotation degree in the Rotate value cell, for example, 180, then click outside of the value cell. You will then find the DBField in the JRotator reversed.
  7. Save the report.