Lets share love

How ? copy url of this blog and share in your social network :) simple

12

Monday, January 20, 2014

html table to JavaScript array

you can put data of HTML table to a array and then send it to PHP or JAVA or GROOVY for any use with following code.               var myTableArray = [];             $("#dataTableList tr").each(function() {                 var arrayOfThisRow = [];                 var tableData = $(this).find('td');                 if (tableData.length > 0) {    ...

Tuesday, January 14, 2014

Using CASE expression in SQL queries  Use of CASE Expressions in SQL query is sometimes extremely useful.For example Using CASE in SELECT statement provides developer the power to manipulates the data at presentaion layer without changing data at backend.So there are various use of CASE Expressions and it can be used in, including in statements like [SELECT, UPDATE, DELETE, SET ] and clauses like [ WHERE, ORDER BY, HAVING, GROUP BY ] Here is some more information on CASE expressions Type of CASE Expression: Simple...

Monday, January 13, 2014

Groovy Sql queries

1. For selecting from database:: import groovy.sql.Sql sql = Sql.newInstance("jdbc:oracle:thin:@localhost:1521:orcl", "hr", "hr",                       "oracle.jdbc.pool.OracleDataSource") sql.eachRow("SELECT employee_id, last_name, first_name FROM employees") {    println "The employee's name is ${it.first_name} ${it.last_name}." } 2. INSERT into  employeeId = 2000 firstName = "Fred" lastName = "Flintstone" eMail = "fred@slaterockngravel.com" jobId = "QU_OPER" hireDate...

Groovy SQL

Okay today i am going to discuss about Groovy SQL . 1. First of you will have to import sql to your controller :                                     import groovy.sql.Sql; 2. Then you have to define datasource globally  : class controllerClass  {            def dataSource } 3. Now in you action  def action (){                 def sql = Sql.newInstance(dataSource)  ...

Thursday, January 9, 2014

Using map for jasper reports datasource

i used this for map-based datsource in jasper reports. def action() { HashMap[] reportRows = new HashMap[2];         HashMap row1Map = new HashMap();         HashMap row2Map = new HashMap();         row1Map.put("name", "aaditya");         row1Map.put("lastname", "bhatta");         row1Map.put("phone", "9848782444");         row1Map.put("gender", "male");         row2Map.put("name", "aaditya");  ...

Visit to Chisapani , Nepal

Deepak Bhatta, Prithu Sharma, Bharat Ghatal, Munna Gupta, Deepak Padal and me planned to go Namobuddha for trekking. We searched in Google, printed Google map to Namobuddha, searched for hotels and other details of Namobuddha. Finally we met in Koteshwor at 11am. We suddenly changed plan to Namobuddha we all agreed to go to Chisapaani. Everybody wanted a kick in this trek. Now we had no map and no details. We are dwellers of mountains we will find...

Monday, January 6, 2014

short-cut for new tab

CTRL + ( CLICK on a link ) ===>  opens a new tab in browser :) simple but useful&nbs...

Thursday, January 2, 2014

To change port in grails

You may need to run more than one apps at the same time in grails. You cannot run two apps in same port so you need to change port for running next app. here is the command for changing port in grails.                                                            -Dserver.port=8081 run-app this will run your app in 8081 port if you default 8080 port s busy.&nbs...

How to Subtotals in groups in iReport

Okay if you are reading this blog you must have learned to create groups in ireport. so lets continue to sum integers in groups. Here is what we want at the end. here this is a group that is ordered by district name "Gorkha" . so we will add the middle column. Okay lets get started.  1. create a variable. and go to its property.  here district wise is my group name. and $F{id} is the field that i want to SUM. now drag that varisble...

Wednesday, January 1, 2014

Jasper reports and its features

Jasper Report is an open source java reporting engine, which unlike other reporting tools, for example, Crystal Reports, is Java based and doesn't have its own expression syntax. JasperReports has the ability to deliver rich content onto the screen, to the printer, or into PDF, HTML, XLS, RTF, ODT, CSV, TXT and XML files. As it is not a standalone tool, it cannot be installed on its own. Instead, it is embedded into Java applications by including its library in the application's CLASSPATH. JasperReports is a Java class library, and is not...

using jasper report for Grails

Jasper reporting library is very popular in JAVA community. And it can be used with Grails. You can install plugin with                                                               grails install-plugin jasper in command prompt of Grails. and get a coffee because its going to take time. after jasper is installed in your project. you have to create a .jrxml file or .jasper file. you...