Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey Friends,

I have a database field looking like this: "1,2,3,...,6" and I want to split this into separate fields in ireports. some fields do not contain all 6 numbers. some have less than 6 numbers. Then i want to give a message according to that number.

1. "connected"
2. "diconnected"
.
.
.
.
.6. "active"

How can I do that using ireport software? please tell me step by step.

in java i did that like this

Java
Scanner scanner = new Scanner (System.in);
        String name;
        System.out.print("Enter 6 numbers");  
        name = scanner.next(); 
        String[] str_array = name.split(",");
        /*String stringa = str_array[0]; 
        String stringb = str_array[1];
        String stringc = str_array[2];
        String stringd = str_array[3];
        String stringe = str_array[4];
        String stringf = str_array[5];*/
        
        for(String item : str_array){
            //System.out.print(item);
            if(item.equals("1")){
                System.out.println("connected");                
            }else if(item.equals("2")){
                System.out.println("Disconnected");
            }else if(item.equals("3")){
                System.out.println(".....");
            }else if(item.equals("4")){
                System.out.println("......");
            }else if(item.equals("5")){
                System.out.println("......");
            }else if(item.equals("6")){
                System.out.println("active");
            }            
        }
}


Thankx in Advance!
Posted
Updated 25-Sep-13 17:15pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900