M Vol 10

Leave a comment



Jasper Report Unicode

Leave a comment

Wow! Report using Vietnamese!


Copy font Unicode to classpath of IReport, set properties of PDF Font to Arial, Encoding to H-Unicodde, that’s all!

In Netbeans, point classpath to Font Unicode Folder.

Remember, using .jasper file when using JasperFillManager , if you want to use .jrxml, please compile it first.

so fun! I’m very happy about Jasper Report!

Code examples:

public void createServletReport(String fileName, String reportname, Map parameters, Connection con, HttpServletResponse response){
JasperPrint print = JasperFillManager.fillReport(reportDir + File.separator + fileName, parameters, con);

OutputStream ouputStream = response.getOutputStream();

JRExporter exporter = null;

response.setHeader("Content-Disposition", "attachment; filename=\""+reportname+"\"");
exporter = new JRPdfExporter();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, print);
exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, ouputStream);

}catch(Exception e){

Example of arguments in javascript

Leave a comment

you can run this code in firebug .

var myfunction = function(){
    alert("Arg1 = " + arguments[0] + ", Arg2 = " + arguments[1]);

Prototype example in Javascript

Leave a comment

• A prototype is a property of every JavaScript object
• Functions and properties can be associated with a
constructor’s property
• When a function is invoked with new keyword, all
properties and methods of the prototype for the
function are attached to the resulting object

var MyObj = function(name, size){
    this.name = name;
    this.size = size;

MyObj.prototype.tellSize = function(){
    alert("size of " + this.name + "is" + this.size);

var myObject = new MyObj("Sang", "30 Inches");

Event in JavaScript

Leave a comment

onkeypress – A keyboard key is pressed or held down
onkeyup – A keyboard key is released
onload – A page or an image is finished loading
onmousedown – A mouse button is pressed
onmousemove – The mouse is moved
onmouseout – The mouse is moved off an element
onmouseover – The mouse is moved over an element
onmouseup – A mouse button is released
onreset – The reset button is clicked
onresize – A window or frame is resized
onselect – Text is selected
onsubmit – The submit button is clicked
onunload – The user exits the page


How to add host on Ubuntu and Window XP

Leave a comment

For Ubuntu

Hosts should be entered into /etc/hosts file. localhost.localdomain localhost xxx

xxx is where you put what ever name you wish… everything else is the same.

don’t forget to reboot the machine orr.

sudo /etc/rc.d/init.d/network restart

For WinXP
Click on start > run
And then past this line
And then add this line
point-to-your-ip your-host-name
And then
resart DNS Client Service