adasi

Member
Jul 1, 2011
22
0
0
41
Ruwanwella
Akhila ayya....

Kohomada?

mata podi problem ekak..Jasper report wala, main report 1 and e main report eke sub report 3 k thiyenawa..eka iReport tool ekedi compile wenawa.
but
java walin compile kalama run wenne na errors enawa..
mama cording kale main report ekata witharae..
sub report walata wena wenam cording karanna oneda?

error eka,,,
net.sf.jasperreports.engine.JRException: Could not load object from location : .\Job_Card_subreport0.jasper

please help me....
 

Ashhab

Well-known member
  • Jan 12, 2009
    1,712
    97
    63
    33
    GalleStar
    how to run this program in CMD


    public class Customer {
    int cusNo;
    String name;
    String address;
    double salesValue;

    public void setData(int pcusNO,String pname,String paddress,int psalesValue){
    cusNo=pcusNO;
    name=pname;
    address=paddress;
    salesValue=psalesValue;
    }

    public void display(){

    System.out.println("name is:" +name+" cusNO is: "+cusNo+" address is: "+address+"salesvalues are:"+salesValue);

    }
    }

    class RegularCustomer extends Customer{


    double discount;
    double amountPayable;


    public void setData(int pcusNO,String pname,String paddress,int psalesValue,double pdiscount){
    super.setData(pcusNO, pname, paddress, psalesValue);

    discount=pdiscount;

    }

    public void calculateAmountPayable(double TOTAL){

    amountPayable=TOTAL-discount;

    }


    public void display(){
    super.display();
    System.out.println("Discount is "+discount+" Amount payable is "+amountPayable);
    }



    }
     

    IcedEarth

    Member
    Feb 1, 2010
    1,523
    244
    0
    Somewhere In Ice Age
    JButtons ගොඩක් click කරනකොට ඒවායින් midi sounds එන විදිහට හදන්නේ කොහොමද:eek::eek: ??? ActionListener 1n Buttons 20 කට විතර sounds දාන්න ඕනේ!!! :confused:
     

    akhilapraveen

    Active member
  • Jun 2, 2008
    335
    72
    28
    This is the way,

    The java sound API is quite advanced and allows for many complex operations.

    Assuming you want to use a wave file your starting point is AudioSystem in the javax.sound.sampled package (midi is another class/package).

    In your application initialization:
    1. Get an AudioInputStream from a file/URL or some other input location:
    AudioInputStream audioInput = AudioSystem.getAudioInputStream(MyClass.class.getResource("sound/buttonClick.wav"));
    2. Get a Clip object that can play the sound, this operation can fail if the computer can't play sound:
    private static Clip buttonClickSound;
    ...
    buttonClickSound = AudioSystem.getClip();
    3. Load the audio input into the clip:
    buttonClickSound.open(audioInput);

    4. Now in your actionPerformed method play the sound:
    buttonClickSound.start();

    Java only comes with basic audio file support. If you want to play something like an MP3 you will need to obtain a 3rd party library (freely available).
     

    pradeep0079

    Member
    Aug 19, 2010
    151
    8
    0
    Akhila ayya....

    Kohomada?

    mata podi problem ekak..Jasper report wala, main report 1 and e main report eke sub report 3 k thiyenawa..eka iReport tool ekedi compile wenawa.
    but
    java walin compile kalama run wenne na errors enawa..
    mama cording kale main report ekata witharae..
    sub report walata wena wenam cording karanna oneda?

    error eka,,,
    net.sf.jasperreports.engine.JRException: Could not load object from location : .\Job_Card_subreport0.jasper

    please help me....
    machan sub report danwanum ubta krama 2k thiyenawa

    1.absolute paths eka denna puluwan
    ekiyanne uba path eka denawa 'c:\reports\rpt0.jasper'

    2.Relative path eka dennath puluwan
    ekiyanne '.\\subrpt.jsaper'

    3. path eka parameter ekata set karala dennath puluwan;


    ube prasne hatiyata uba dela thiye na path eka harida balapan,
    1.main report eka thiyena thnata sub report dala balapan

    2.uba relative path ekak dunna num
    eg: ube jar file eka run wenne c:\app kiyana folder eke athule kiyala hithamu.
    ethakota '.' kiyanne current directory eka .etha kota uba .\Job_Card_subreport0.jasper eka oya folder eke thiyenna one.

    *ireport walata gihilla SUBREPORT_DIR kiyana parameter eke
    Default Value Expression balapan eke thama path eka thiyenne
    ehana thama sunreport eka thiyenne one '

    poddak eka balapan;
     

    pradeep0079

    Member
    Aug 19, 2010
    151
    8
    0
    how to run this program in CMD


    public class Customer {
    int cusNo;
    String name;
    String address;
    double salesValue;

    public void setData(int pcusNO,String pname,String paddress,int psalesValue){
    cusNo=pcusNO;
    name=pname;
    address=paddress;
    salesValue=psalesValue;
    }

    public void display(){

    System.out.println("name is:" +name+" cusNO is: "+cusNo+" address is: "+address+"salesvalues are:"+salesValue);

    }
    }

    class RegularCustomer extends Customer{


    double discount;
    double amountPayable;


    public void setData(int pcusNO,String pname,String paddress,int psalesValue,double pdiscount){
    super.setData(pcusNO, pname, paddress, psalesValue);

    discount=pdiscount;

    }

    public void calculateAmountPayable(double TOTAL){

    amountPayable=TOTAL-discount;

    }


    public void display(){
    super.display();
    System.out.println("Discount is "+discount+" Amount payable is "+amountPayable);
    }



    }

    machan java programme ekak run wenna main method ekak one

    Code:
    public class Apprunner {
     
    public static void main(String [] a){
      
    try{
    RegularCustomer  rc=new RegularCustomer ();
    //set rc properties here  eg:-rc.setAge(10) ;
    rc.display();
    }catch(Exception e){
      e.printStackTrace();
    }
    
    }
    
    
    }

    to compile these
    in command line goto folder where file kept
    type javac *.java
    java Apprunner
     

    adasi

    Member
    Jul 1, 2011
    22
    0
    0
    41
    Ruwanwella
    machan sub report danwanum ubta krama 2k thiyenawa

    1.absolute paths eka denna puluwan
    ekiyanne uba path eka denawa 'c:\reports\rpt0.jasper'

    2.Relative path eka dennath puluwan
    ekiyanne '.\\subrpt.jsaper'

    3. path eka parameter ekata set karala dennath puluwan;


    ube prasne hatiyata uba dela thiye na path eka harida balapan,
    1.main report eka thiyena thnata sub report dala balapan



















    2.uba relative path ekak dunna num
    eg: ube jar file eka run wenne c:\app kiyana folder eke athule kiyala hithamu.
    ethakota '.' kiyanne current directory eka .etha kota uba .\Job_Card_subreport0.jasper eka oya folder eke thiyenna one.

    *ireport walata gihilla SUBREPORT_DIR kiyana parameter eke
    Default Value Expression balapan eke thama path eka thiyenne
    ehana thama sunreport eka thiyenne one '

    poddak eka balapan;


    ayya.....

    mage main report and sub report thiyenne eka folder ekaka..
    ewa ireport ekedi compile karapuwahama data ekka hodata compile wenawa..

    namuth mama java cording eke cording kale main report ekata witharae...
    sub report auto compile karaganne nadda main report eka?

    oyata barida mata java cording eka ewanna...(main,sub report compile wena)

    thanks..
     

    pradeep0079

    Member
    Aug 19, 2010
    151
    8
    0
    ayya.....

    mage main report and sub report thiyenne eka folder ekaka..
    ewa ireport ekedi compile karapuwahama data ekka hodata compile wenawa..

    namuth mama java cording eke cording kale main report ekata witharae...
    sub report auto compile karaganne nadda main report eka?

    oyata barida mata java cording eka ewanna...(main,sub report compile wena)

    thanks..
    wisthara onene num mail eka pm karapan ,netbeans project ekak dennum.

    uba code eke use karana koto jrxml file eka use karanne epa ,
    mokada uba report eka balana hama welawema report eka generate karanne jrxml eka compile wenawa ,eka overhead ekak ube application ekata ,eka hinda '.jasper' file eka use karapana.
    ethakota report eka fill wenawa ,complile wenne nehe.
     

    akhilapraveen

    Active member
  • Jun 2, 2008
    335
    72
    28
    aiya inupt karapu no 10k asending order ekata print wenna hadanne kohomada....

    for(int i = 0; i < blah; i++)
    {
    Random generator = new Random();
    num1 = generator.nextInt(56) + 1;
    num2 = generator.nextInt(56) + 1;
    num3 = generator.nextInt(56) + 1;
    num4 = generator.nextInt(56) + 1;
    num5 = generator.nextInt(56) + 1;
    num6 = generator.nextInt(46) + 1;

    int a[] = {num1,num2,num3,num4,num5};
    int temp;
    for(int j=0;j<a.length;j++)
    {
    for(int k=j+1;k<a.length;k++)
    {
    if(a[k]<a[j])
    {
    temp=a[j];
    a[j]=a[k];
    a[k]=temp;
    }
    }
    }

    num1=a[0];
    num2=a[1];
    num3=a[2];
    num4=a[3];
    num5=a[4];
     

    adasi

    Member
    Jul 1, 2011
    22
    0
    0
    41
    Ruwanwella
    How to view jasper report on the JDialog Form???

    ayya...

    JDialog form ekaka button ekak haraha jasper report ekak load kalama,,
    e report eka load wenne JDialog Form ekata yatin ne?e report eka JDialog Form ekata udin load karaganne kohomada?

    help ekak denna???