Total Pageviews

2013/12/24

Cannot Import Java Source Code via Astah Pro

Problem
When I used Astah Pro to do import java code

But it show the error which complain encoding issues:


Solution
As we do import java code, we need to set the property of "Charset of imported files" to UTF-8.

Then we can import Java source code successfully.




An internal error occurred during: "Initializing Java Tooling" from Eclipse

Problem
One day as I startup my eclipse it show the error as bellows:

Solution
Step1. Close Eclipse
Step2. Go to your eclipse workspace, and go to this directory
 %workspace%/.metadata/.plugins/org.eclipse.jdt.core/  
ex.

Step3. delete variablesAndContainers.dat
Step4. Start Eclipse







2013/12/05

How to pad a string with spaces when size of data is unknown in Microsoft SQL Server

Requirement
When I select a character data with varchar(6) from Microsoft SQL Server....

And these data should have fixed length in report.
If the data is 01, it should right pad with 4 spaces.
If the data is 01234, it should right pad with 1 space.

Solution
If we would like to meet this requirement in SQL Server, we can use 'CAST' function which provided by SQL Server
select cast(repno as char(6)) from NSS313FA  

Utilizing cast function in SQL statement, you can get fixed length in report no matter how long the data is.
   


2013/12/04

How to display column footer immediately without any spaces after details band

Problem
This is my report design in iReport:

Here is the Detail property and Column Footer property setting:

But...as I generate pdf, there has unnecessary spaces between Detail band and Column Footer band.

Solution
Step1. Right click --> property

Step2. Check the "Float column footer" property

Then this problem will be solved. There will not have any spaces between Detail band and Column Footer band.