http://khmermusic-alert.blogspot.com/2009/05/m-production-cd-vol10.html
Jasper Report Unicode
May 19, 2009
Wow! Report using Vietnamese!
Haha!
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){ try{ JasperPrint print = JasperFillManager.fillReport(reportDir + File.separator + fileName, parameters, con); OutputStream ouputStream = response.getOutputStream(); JRExporter exporter = null; response.setContentType("application/pdf"); response.setHeader("Content-Disposition", "attachment; filename=\""+reportname+"\""); exporter = new JRPdfExporter(); exporter.setParameter(JRExporterParameter.JASPER_PRINT, print); exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, ouputStream); exporter.exportReport(); }catch(Exception e){ System.out.println(e); } }
Example of arguments in javascript
May 6, 2009
you can run this code in firebug .
var myfunction = function(){ alert("Arg1 = " + arguments[0] + ", Arg2 = " + arguments[1]); } myfunction("Test1","Test2");
Prototype example in Javascript
May 6, 2009
• 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"); myObject.tellSize();
Event in JavaScript
May 5, 2009
• 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
May 5, 2009
For Ubuntu
Hosts should be entered into /etc/hosts file.
127.0.0.1 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
c:\windows\system32\drivers\etc\hosts
And then add this line
point-to-your-ip your-host-name
And then
resart DNS Client Service