Pages

Tuesday, June 23, 2009

Simple Menubar in GWT

This is just a simple example of menubar for GWT beginners.
Code:

import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.MenuBar;

public class Menubar extends MenuBar{
MenuBar menu = new MenuBar();//main menubar
public Menubar() {


Building menubar in GWT

This is just a simple example on building a menubar with submenus.

Code:

Monday, June 22, 2009

Calculating Sum in Each Group in iReport


To calculate the sum in each group in iReport, just do as shown in previous post Grouping in iReport. Now add in query, another field of which you want to take out the sum. For example see in figure below.


More...
Now create a new variable named SUM as shown in figure.



Now select and write the fields as shown in figure for variable SUM.



Now arrange all the fields as shown in figure and run the file.


Output:


Sunday, June 21, 2009

Grouping in iReport


Here is a simple example on grouping in iReport. Its steps are as follows:

1. Create a new document as shown in figure.

More...
2. Now go to the Data option and select Report Query and write query in the window that appears as shown below.



3. Now go to View option and select Report Groups and name the group and give the expression of the field by which you want to group as shown in figure.



4.Now put the info required in the bands as shown in figure.



5. Now right click on field and edit the properties as shown in figure.






6. Delete the unnecessary bands and make report clear and keep only necessary bands as shown below.




7.Now run the report and the result will be shown as in figure.


Thursday, June 18, 2009

Reading Files From a Certain Location Using JAVA


Here is a simple example of reading files from any folder and list their names and size on disk. The code goes here:

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

public class FileTest {
public static void main(String args[]){
File file = new File("C:/windows/system32");
File files[] = file.listFiles();