Wednesday, January 9, 2013

Errro Log - Unknown Source

Spent three hours to solve the problem.

"How to make the log file to show exact line number the exception thrown instead of Unknown source?"

The exact line number the exception thrown (It is what I want)
Caused by: java.lang.NullPointerException
at com.vaadin.ui.collection.Testing.isValidFormSubmit(Testing.java:315)....

It informs you there is an exception, please guess where the exception is. (Kill me)
Caused by: java.lang.NullPointerException
at com.vaadin.ui.collection.Testing.isValidFormSubmit(Unknown Source)....

It is only add debug="true" in your javac tag of your build.xml file if you are using ant script to compile your project.

Friday, December 28, 2012

Vaadin 6.8.2 - Table Scroll Issue

Vaadin - Table Scroll

Condition:

By Clicking "Find Next" button, the record in the table containing the input name will be highlighted.

It should be called table.setValue(itemId) to set which record should be highlighted and setCurrentPageFirstItemId(itemId) to scroll to the highlighted record as the first row in the table.

However, I found that function setCurrentPageFirstItemId could work properly. It cannot locate the right position for the highlighted record. I tried to find the reasons/causes related to that on the internet. Someone has the same issue but no solution provided.

Problem:
The problem is the modified CSS. I set all the cell content be "pre-wrap" like
.v-table-cell-wrapper{ font-size: 9px; white-space: pre-wrap !important; }

Solution:
The white-space: pre-wrap !important should be removed because Vaadin could not encounter the dynamic row height I guess.

Tuesday, November 27, 2012

iReport 4.7.1 - New Font Installation

If you want to use Traditional Chinese Font (such as 細明體) in the jasper report, you should install a new font in your iReport and create a jar file for your project classpath.

The installation of a new font is going to be demonstrated in the following.
Enjoy and Relax! Hope this will help the beginners. Actually, I am also a newbie. =]


  • Go to C drive >> Window >> Fonts >> Copy the font (i.e. .ttf file under C:\WINDOWS\Fonts) you want to iReport Installed Path (\iReport-4.7.1\ireport\fonts)
  • Open iReport Designer >> Select Tools >> Option
  •  Select "Fonts" tab and click "Install Font" button

  • Click "Browse" button and select the corresponding .ttf file. Click "Next" button
  • Select PDF Encoding 

Note:  If there is an exception thrown (e.g. "Unsupported Encoding Exception: UniCNS-UCS2-H", "Identity-H" (UTF8) should be used for PDF Encoding. It is because Java doesn't know UniCNS-UCS2-H encoding but UTF8 Encodeing.
  • After installation, you can check the irfonts.xml file under (\iReport-4.7.1\ireport\fonts). You can find that the Font Family inserted.

  • Export the newly installed font as jar file and place the jar in both your project classpath and server lib folder.