Int cannot be deffered error

Hello,
I hope this is an appropriate forum for this question. This is not a HW assignment; I have just started Java as a hobby. I think the real problem I have is a lack of sound understanding of how to call methods, and what criteria have to be met to call a method within the main().
Here is the code:
public class InconvenientChange3
     public static int quarters;
     public static int dimes;
     public static int nickels;
     public static int pennies;
     public static int sum;
     public static int sum()
               sum = quarters + dimes + nickels + pennies;
     public static void main(String[] args)
               System.out.println();
               int[] values = new int [100];
               for (int amount = 1; amount < 100; amount ++)
                         quarters = amount/25;
                         int remainder = amount%25;
                         dimes = remainder/10;
                         remainder = remainder%10;
                         nickels = remainder/5;
                         pennies = remainder%5;
               for (int amount = 1; amount < 100; amount ++ )
                         values[amount] = sum.values[amount];
                         System.out.println(values[amount]);
               System.out.println();
The error I get is: int cannot be dereferenced values[amount] = sum.values[amount];
I have tried troubleshooting this for a while, but can't figure out this error. Thanks so much for your assistance.
- steve

Hello,
Thanks for your response. My intent is to apply the method "sum" (which adds the total number of quarters, dimes, nickels, and pennies) to the elements of the values[ ] array, thus creating a new array that holds the number of coins required for each value.
So the value at index 1 is 1 (1 penny)
The value at index 11 is 2 (1 dime, 1 penny)
The value at index 41 is 4 (1 quarter, 1 dime, 1 nickel, 1 penny)
etc.
I played with this a little, and successfully printed the sum for every value by including the statement:
sum = quarters + dimes + nickels + pennies wihin the first for loop. (So I know my math logic is correct). Now I want to assign these sums to a new array - that's my intent.
Thanks again for your help and patience.
Regards,
steve

Similar Messages

  • "int cannot be dereferenced" error.. help me please

    I'm working with an array list class called PersonList and it uses attributes from a normal class called Person.
    I would like to make this method PrintPerson inside the PersonList class that should search for a specific Person given the ID as parameter to the method. the method should print all info of the Person if found, otherwise a message saying id is not valid.
    I solved it like this:
    public void PrintPerson(int id)
              System.out.println("Enter ID of the person ");
              id = Stdin.readInteger();
              //search the ID if it is in the List
              int i=0;
              while
              ((i<next)&&(!(list.getID().equals(id))))
              i++;
              //if found
              if (i<next)
                   list[i].OutputWindow();}//display the object ouput of this ID
                   else{
                   System.out.println("The following ID: " id "is not valid!");
              }//end if
         }// end of method
    my problem is with this code:
    ((i<next)&&(!(list.getID().equals(id))))
    I get this error "int cannot be dereferenced"
    what should I do? help me please
    -- Matt

    list.getID() == id                                                                                                                                                                                                                               

  • Program Error: Int cannot be derefereced

    I am writing a program which displays a GUI for a chocolate chip cookies recipe. The user can key in the number of cookies they want, and the program will calculate and display the appropriate amount of ingredients required.
    It is a program I have done myself in order to improve my skills.
    There is an error in my code which I can't seem to get rid of. It says that "int cannot be derefereced" and it occurs on this line: String text = noOfCookies.getText();
    I hope someone will be able to tell me what has gone wrong. Thanks for any help.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class CookieGUI
      private int WIDTH = 450;
      private int HEIGHT = 600;
      private JFrame frame;
      private JPanel panel;
      private JLabel inputLabel, outputLabel, outputLabel2, outputLabel3,
      outputLabel4, outputLabel5, outputLabel6, outputLabel7, outputLabel8,
      outputLabel9, outputLabel10, resultLabel, resultLabel2, resultLabel3,
      resultLabel4, resultLabel5;
      private JTextField noOfCookies;
       //sets up the GUI
      public CookieGUI()
        frame = new JFrame("Choc Chip Cookie Recipe Creator.Version 1");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        inputLabel = new JLabel ("Enter the number of cookies required: ");
        outputLabel = new JLabel ("Ingredients required: ");
        outputLabel2 = new JLabel ("Sugar: ");
        resultLabel = new JLabel ("---");
        outputLabel3 = new JLabel ("Butter: ");
        resultLabel2 = new JLabel ("---");
        outputLabel4 = new JLabel ("Self Raising Flour: ");
        resultLabel3 = new JLabel ("---");
        outputLabel5 = new JLabel ("Egg: ");
        resultLabel4 = new JLabel ("---");
        outputLabel6 = new JLabel ("Chocolate Chips: ");
        resultLabel5 = new JLabel ("---");
    // Output labels for the steps go here:
        outputLabel7 = new JLabel ("Step 1 : Mix sugar, butter and "
        + "self raising flour thoroughly.");
        outputLabel8 = new JLabel ("Step 2 : Stir in egg, a few "
        + "drops of vanilla essence and chocolate chips.");
        outputLabel9 = new JLabel ("Step 3 : Roll out mixture and "
        + "cut out cookies.");
        outputLabel10 = new JLabel ("Step 4 : Bake in hot oven "
        + "(Gas Mark 6) for 10-12 minutes.");
        panel = new JPanel();
        panel.setPreferredSize (new Dimension(WIDTH, HEIGHT));
        panel.setBackground (Color.cyan);
        panel.add (inputLabel);
        panel.add (noOfCookies);
        panel.add (outputLabel);
        panel.add (outputLabel2);
        panel.add (outputLabel3);
        panel.add (outputLabel4);
        panel.add (outputLabel5);
        panel.add (outputLabel6);
        panel.add (outputLabel7);
        panel.add (outputLabel8);
        panel.add (outputLabel9);
        panel.add (outputLabel10);
        panel.add (resultLabel);
        panel.add (resultLabel2);
        panel.add (resultLabel3);
        panel.add (resultLabel4);
        panel.add (resultLabel5);
        frame.getContentPane().add (panel);
        public void display()
          frame.pack();
          frame.show();
    //action listener
    private class CookieListener implements ActionListener
      public void actionPerformed (ActionEvent event)
        double sugar, butter, selfRaisingFlour, egg, vanillaEssence,
        chocolateChips;
        int noOfCookies;
        String text = noOfCookies.getText();
        noOfCookies = Integer.parseInt (text);
        sugar =(0.3334 * noOfCookies);
        noOfCookies = Integer.parseInt (text);
        butter = (0.3334 * noOfCookies);
        noOfCookies = Integer.parseInt (text);
        selfRaisingFlour = (0.6667 * noOfCookies);
        noOfCookies = Integer.parseInt (text);
        egg = (0.08334 * noOfCookies);
        noOfCookies = Integer.parseInt (text);
        chocolateChips = (0.3334 * noOfCookies);
    //set all the result labels
    resultLabel.setText (Double.toString (sugar));
    resultLabel2.setText (Double.toString (butter));
    resultLabel3.setText (Double.toString (selfRaisingFlour));
    resultLabel4.setText (Double.toString (egg));
    resultLabel5.setText (Double.toString (chocolateChips));
    public class Cookie
    //creates and displays the cookie recipe GUI
       public static void main (String[] args)
         CookieGUI chocchip = new CookieGUI();
         chocchip.display();
    }

    You dont have to instantiate it, just declaringit
    is
    enough..
    I do believe that is false. It is assigned null if
    you do not instantiate it. Meaning when youreference
    it you will get a null pointer exception.Yes, that's true, but you'll still have these
    shadowing problens in your code... The OP declared
    (not instantiated) JTextField noOfCookies , then
    declared int noOfCookies in a method. Referring to
    'noOfCookies' within this method will refer to the
    int.. This is true whether you instantiate the global
    JTextField noOfCookies or just declare it.Right, but the lack of instantiation was pointed out as a possible solution to a second problem, once the program runs, it crashes and issues an error report. The suggestion was made to point out that the user should instantiate the noOfCookies JTextField before adding it to the GUI, and definitely before calling noOfCookies.getText(); (assuming the int was changed to another name, or she correctly referenced the textfield noOfCookies so as not to get the compile time error)

  • ERROR: int cannot be dereferenced

    hi everyone i am trying to copmile the following code
    public void refreshGUI() {
            MessageBoardQueries MBQ = new MessageBoardQueries();
            Date date = Calendar.getInstance().getTime();
            DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
            String argDate = df.format(date).toString();
            int pNumber = MBQ.queryPending(argDate);
            int aNumber = MBQ.queryAccepted(argDate);
            int dNumber = MBQ.queryDeclined(argDate);
            pendingNumberField.setText(pNumber.toString());
            acceptedNumberField.setText(MBQ.queryAccepted(argDate));
            declinedNumberField.setText(MBQ.queryDeclined(argDate));
        }but i keep getting the error:
    int cannot be dereferenced on the line
    pendingNumberField.setText(pNumber.toString());
    does anyone know why?

    because int is a primitive datatype, hence doesn't inherit from java.lang.Object, and as such doesn't have a toString method
    try Integer.toString(pNumber) or String.valueOf(pNumber). either is equally valid

  • Need help with class info and cannot find symbol error.

    I having problems with a cannot find symbol error. I cant seem to figure it out.
    I have about 12 of them in a program I am trying to do. I was wondering if anyone could help me out?
    Here is some code I am working on:
    // This will test the invoice class application.
    // This program involves a hardware store's invoice.
    //import java.util.*;
    public class InvoiceTest
         public static void main( String args[] )
         Invoice invoice1 = new Invoice( "1234", "Hammer", 2, 14.95 );
    // display invoice1
         System.out.println("Original invoice information" );
         System.out.println("Part number: ", invoice1.getPartNumber() );
         System.out.println("Description: ", invoice1.getPartDescription() );
         System.out.println("Quantity: ", invoice1.getQuantity() );
         System.out.println("Price: ", invoice1.getPricePerItem() );
         System.out.println("Invoice amount: ", invoice1.getInvoiceAmount() );
    // change invoice1's data
         invoice1.setPartNumber( "001234" );
         invoice1.setPartDescription( "Yellow Hammer" );
         invoice1.setQuantity( 3 );
         invoice1.setPricePerItem( 19.49 );
    // display invoice1 with new data
         System.out.println("Updated invoice information" );
         System.out.println("Part number: ", invoice1.getPartNumber() );
         System.out.println("Description: ", invoice1.getPartDescription() );
         System.out.println("Quantity: ", invoice1.getQuantity() );
         System.out.println("Price: ", invoice1.getPricePerItem() );
         System.out.println("Invoice amount: ", invoice1.getInvoiceAmount() );
    and that uses this class file:
    public class Invoice
    private String partNumber;
    private String partDescription;
    private int quantityPurchased;
    private double pricePerItem;
         public Invoice( String ID, String desc, int purchased, double price )
              partNumber = ID;
         partDescription = desc;
         if ( purchased >= 0 )
         quantityPurchased = purchased;
         if ( price > 0 )
         pricePerItem = price;
    public double getInvoiceAmount()
         return quantityPurchased * pricePerItem;
    public void setPartNumber( String newNumber )
         partNumber = newNumber;
         System.out.println(partDescription+" has changed to part "+newNumber);
    public String getPartNumber()
         return partNumber;
    public void setDescription( String newDescription )
         System.out.printf("%s now refers to %s, not %s.\n",
    partNumber, newDescription, partDescription);
         partDescription = newDescription;
    public String getDescription()
         return partDescription;
    public void setPricePerItem( double newPrice )
         if ( newPrice > 0 )
    pricePerItem = newPrice;
    public double getPricePerItem()
    return pricePerItem;
    Any tips for helping me out?

    System.out.println("Part number:
    "+invoice1.getPartNumber;
    The + sign will concatenate invoice1.getPartNumber()
    after "Part number: " forming only one String.I added the plus sign and it gives me more errors:
    C:\>javac InvoiceTest.java
    InvoiceTest.java:16: operator + cannot be applied to java.lang.String
            System.out.println("Part number: ",   + invoice1.getPartNumber() );
                                                  ^
    InvoiceTest.java:17: cannot find symbol
    symbol  : method getPartDescription()
    location: class Invoice
            System.out.println("Description: ", + invoice1.getPartDescription() );
                                                          ^
    InvoiceTest.java:17: cannot find symbol
    symbol  : method println(java.lang.String,int)
    location: class java.io.PrintStream
            System.out.println("Description: ", + invoice1.getPartDescription() );
                      ^
    InvoiceTest.java:18: cannot find symbol
    symbol  : method getQuantity()
    location: class Invoice
            System.out.println("Quantity: ", + invoice1.getQuantity() );
                                                       ^
    InvoiceTest.java:18: cannot find symbol
    symbol  : method println(java.lang.String,int)
    location: class java.io.PrintStream
            System.out.println("Quantity: ", + invoice1.getQuantity() );
                      ^
    InvoiceTest.java:19: cannot find symbol
    symbol  : method println(java.lang.String,double)
    location: class java.io.PrintStream
            System.out.println("Price: ", + invoice1.getPricePerItem() );
                      ^
    InvoiceTest.java:20: cannot find symbol
    symbol  : method println(java.lang.String,double)
    location: class java.io.PrintStream
            System.out.println("Invoice amount: ", + invoice1.getInvoiceAmount() );
                      ^
    InvoiceTest.java:24: cannot find symbol
    symbol  : method setPartDescription(java.lang.String)
    location: class Invoice
            invoice1.setPartDescription( "Yellow Hammer" );
                    ^
    InvoiceTest.java:25: cannot find symbol
    symbol  : method setQuantity(int)
    location: class Invoice
            invoice1.setQuantity( 3 );
                    ^
    InvoiceTest.java:30: operator + cannot be applied to java.lang.String
            System.out.println("Part number: ", + invoice1.getPartNumber() );
                                                ^
    InvoiceTest.java:31: cannot find symbol
    symbol  : method getPartDescription()
    location: class Invoice
            System.out.println("Description: ", + invoice1.getPartDescription() );
                                                          ^
    InvoiceTest.java:31: cannot find symbol
    symbol  : method println(java.lang.String,int)
    location: class java.io.PrintStream
            System.out.println("Description: ", + invoice1.getPartDescription() );
                      ^
    InvoiceTest.java:32: cannot find symbol
    symbol  : method getQuantity()
    location: class Invoice
            System.out.println("Quantity: ", + invoice1.getQuantity() );
                                                       ^
    InvoiceTest.java:32: cannot find symbol
    symbol  : method println(java.lang.String,int)
    location: class java.io.PrintStream
            System.out.println("Quantity: ", + invoice1.getQuantity() );
                      ^
    InvoiceTest.java:33: cannot find symbol
    symbol  : method println(java.lang.String,double)
    location: class java.io.PrintStream
            System.out.println("Price: ", + invoice1.getPricePerItem() );
                      ^
    InvoiceTest.java:34: cannot find symbol
    symbol  : method println(java.lang.String,double)
    location: class java.io.PrintStream
            System.out.println("Invoice amount: ", + invoice1.getInvoiceAmount() );
                      ^
    16 errors

  • Help! Getting the cannot find symbol error.

    Hello everyone. I have gone throught my whole program and I am still getting a cannot find symbol error. What does this error mean exactly? Here is the code below. I am trying to color a background using a comobox method.
    import java.awt.BorderLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.ButtonGroup;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.border.EtchedBorder;
    import javax.swing.border.TitledBorder;
    import java.awt.GridLayout;
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import javax.swing.JComboBox;
    public class ComboboxFrame extends JFrame
        public ComboboxFrame()
            colorPanel = new JPanel();
            colorPanel.setPreferredSize(new Dimension(PANEL_WIDTH, PANEL_HEIGHT));
            getContentPane().add(colorPanel, BorderLayout.CENTER);
            class ChoiceListener implements ActionListener
                public void actionPerformed(ActionEvent event)
                    setbackgroundColor();
            listener = new ChoiceListener();
            createControlPanel();
            setbackgroundColor();
            pack();
        private void createControlPanel()
          JPanel colorPanel = createComboBox();
          JPanel controlPanel = new JPanel();
          controlPanel.setLayout(new GridLayout(1, 1));
          controlPanel.add(colorPanel);
          getContentPane().add(
             controlPanel, BorderLayout.SOUTH);
       public JPanel createComboBox()
          colorCombo = new JComboBox();
          colorCombo.addItem("Red");
          colorCombo.addItem("Green");
          colorCombo.addItem("Blue");
          colorCombo.setEditable(true);
          colorCombo.addActionListener(listener);
          JPanel panel = new JPanel();
          panel.add(colorCombo);
          return panel;
       public void setbackgroundColor()
           String color = (String)colorCombo.getSelectedItem();
           colorPanel.setbackgroundColor(new backgroungColor(color));
           colorPanel.repaint();
       private JPanel colorPanel; 
       private static final int PANEL_WIDTH = 300;
       private static final int PANEL_HEIGHT = 300;
       private JComboBox colorCombo;
       private ActionListener listener;
    }The line with the error is: colorPanel.setbackgroundColor(new backgroungColor(color));
    Here is the second file
    import javax.swing.JFrame;
    public class backgroundTest
        public static void main(String[] args)
            JFrame frame = new comboboxFrame();
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.show();
    }Any help would be appreciated. Thank you

    Hello everyone. I have gone throught my whole
    program and I am still getting a cannot find symbol
    error. "Symbol" here means variable or method name (or maybe class name, but I think it will specifically bitch about classnames in that case).
    String foo = "foo";
    System.out.println(zoo); // no such variable as zoo. So...
    colorPanel.setbackgroundColor(new backgroungColor(color));Looks like colorPanel or setbackgroundColor(new backgroungColor doesn't exist.
    Note that spelling and capitalization count. Java's really anal that way.

  • Help - cannot find symbol error

    Can someone help me? I am getting "cannot find symbol" error in my code and cannot figure out why. Here is my code:
    public class toyInventory
    private String[] toyInventory = {"ball", "bat", "bear", "car", "doll", "game", "glove", "playstation", "train"};
    private int[] nineArray = {0,0,0,0,0,0,0,0};
    int invItems = 0;
    public void countToy()
    String orderInput[] = {"bear", "train", "car", "ball", "doll", "ball", "train", "doll", "game", "train", "bear", "doll", "train", "car", "ball", "bat", "glove", "bat", "b", "doll", "bear", "ball", "doll", "bat", "car", "glove", "train", "doll", "bear"};
    int noMatch;
    for(int a = 0; a < orderInput.length; a++)
    noMatch = 0;
    for(int b = 0; b < toyInventory.length; b++)
    if(orderInput[a] == toyInventory)
    noMatch = 1;
    break;
    if(noMatch == 0)
    invItems = 1;
    public void printItems()
    for(int c = 0; c < toyInventory.length; c++)
    if (countToy[c] > 4)<-------- cannot find symbol error here
    System.out.print("*");
    System.out.print(toyInventory[c] + "\t" + countToy[c] + "\n"); <----cannot find symbol error here also
    System.out.print("The number of invalid items in the order is" + invItems);
    public static void main( String[] args)
    toyInventory collection = new toyInventory ();
    collection.countToy();
    collection.printItems();

    public void countToy()
    String orderInput[] = {"bear", "train", "car", "ball", "doll", "ball", "train", "doll", "game", "train", "bear", "doll", "train", "car", "ball", "bat", "glove", "bat", "b", "doll", "bear", "ball", "doll", "bat", "car", "glove", "train", "doll", "bear"};In the above code you have declared countToy() as method and while in the below lines you are calling countToy[] as an array. So please check that...
    if (countToy[c] > 4)<-------- cannot find symbol error here
    System.out.print("*");
    System.out.print(toyInventory[c] + "\t" + countToy[c] + "\n"); <----cannot find symbol error here also
    }

  • Cannot find symbol error.. really stuck.

    I have a class named Rectangle.java. It is in a package "Geometry" together with Point.java and Line.java. But when I try to use Rectangle.java in my main program, MyRect.java, it gives me a "cannot find symbol" error, particularly the methods and sometimes the variables. I tried compiling just my Rectangle class and it compiled fine.. And I tried the Line and Point classes on another program and it works fine... well probably because the Line and Point classes are from a book(Ivor Horton's Beginning Java 2).. I am just starting out in Java. :)
    Rectangle.java
    package Geometry;
    public class Rectangle{
        public Point[] corner = new Point[4];
        public String name;
        public Rectangle(){
            corner[0].setPoints(0,0);
            corner[1].setPoints(1,0);
            corner[2].setPoints(0,1);
            corner[3].setPoints(1,1);
            name = new String("Unknown");
        public Rectangle(double point1_x,double point1_y,double point2_x, double point2_y, String Name){
            corner[0].setPoints(point1_x, point1_y);
            corner[3].setPoints(point2_x, point2_y);
            corner[1].setPoints(point2_x, point1_y);
            corner[2].setPoints(point1_x, point2_y);
            name = new String(Name);
        public Rectangle(final Rectangle oldRect, String Name){
            corner[0] = oldRect.corner[0];
            corner[3] = oldRect.corner[3];
            corner[1] = oldRect.corner[1];
            corner[2] = oldRect.corner[2];
            name = new String(Name);
        public double getWidth(){
            return corner[0].distance(corner[1]);
        public static void printRectangle(final Rectangle rect){
            for(int i= 0;i<4;i++){
                System.out.println("Corner"+(i+1)+" X: "+rect.corner.getX()+" Corner"+(i+1)+" Y: "+rect.corner[i].getY());
    System.out.println();
    public String toString(){
    return ("Name: "+name);
    }MyRect.java
    import Geometry.*;
    public class MyRect{
        public static void main(String[] args){
            Rectangle myRect = new Rectangle(0,0,2,1);
            Rectangle copyRect = new Rectangle(myRect);
            printRectangle(myRect);
            double width = myRect.getWidth();
    }and the errors:
    MyRect.java:4: cannot find symbol
    symbol  : constructor Rectangle(double,double,double,double,java.lang.String)
    location: class Rectangle
                    Rectangle myRect = new Rectangle(0.0,0.0,2.0,1.0,"My Rectangle")
                                       ^
    MyRect.java:9: cannot find symbol
    symbol  : variable name
    location: class Rectangle
                    System.out.println(myRect.name);
                                             ^
    2 errors

    Are you sure you have posted the whole content of MyRect.java
    import Geometry.*;
    public class MyRect{
        public static void main(String[] args){
            Rectangle myRect = new Rectangle(0,0,2,1);
            Rectangle copyRect = new Rectangle(myRect);
            printRectangle(myRect);
            double width = myRect.getWidth();
    }I don't see the following error line in the code you have given.
    MyRect.java:4: cannot find symbol
    symbol  : constructor Rectangle(double,double,double,double,java.lang.String)
    location: class Rectangle
                    Rectangle myRect = new Rectangle(0.0,0.0,2.0,1.0,"My Rectangle")
                                       ^
    MyRect.java:9: cannot find symbol
    symbol  : variable name
    location: class Rectangle
                    System.out.println(myRect.name);
                                             ^
    2 errors

  • Cannot find symbol error. don't know why

    Hello, I'm trying to write a button bean in the shape of a triangle but netbeans keeps throwing up a cannot find symbol error at my g.fillPolygon line. I've declared the number of sides and x and y coords.
    Any ideas as to why this is happening would be greatly appreciated.
    Here's the code:
    package trianglebutton;
    import java.util.*;
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.*;
    import java.io.*;
    public class TriangleButtonBean extends JButton implements Serializable
    private TriangleButtonBean graphicPolygon;
    private Color buttonColour;
    private Color textColour;
    private String caption;
    private int sides = 3;
    private int size = 30;
    private int centerX = 100;
    private int centerY = 100;
         public TriangleButtonBean()
              super();
              setPreferredSize(new Dimension(50,50));
              setBorder(null);
              buttonColour = Color.red;
              textColour = Color.black;
              caption = "";
         public TriangleButtonBean(String acaption)
              super();
              setPreferredSize(new Dimension(50,50));
              setBorder(null);
              caption = acaption;
         public void paintComponent(Graphics g)
    String astring;
              super.paintComponent(g);
    g.setColor(buttonColour);
              int centerX = graphicPolygon.getCenterX(); //Invoking getCenterX method
              int centerY = graphicPolygon.getCenterY(); //Invoking getCenterY method
              //int Xcoordinates [] = graphicPolygon.getPolygonXCoordinates(sides,size);
              //int Ycoordinates [] = graphicPolygon.getPolygonYCoordinates(sides,size);
    g.drawPolygon(centerX,centerY, sides); //Draw polygon using xcoord,ycoord and number of sides
              g.fillPolygon(centerX,centerY, sides); //Fill poly
              g.setColor(textColour);
              if (caption.length() > 1)
                   astring = caption.substring(0,1);
              else
                   astring = caption;
              g.drawString(astring,22,27);
         public void setButtonColour(Color acolour)
              buttonColour = acolour;
              repaint();
         public Color getButtonColour()
              return buttonColour;
         public void setTextColour(Color acolour)
              textColour = acolour;
              repaint();
         public Color getTextColour()
              return textColour;
         public void setCaption(String acaption)
              caption = acaption;
              repaint();
         public String getCaption()
              return caption;
    // public void setCenterX(int xcoords)
    // centerX = xcoords;
    public int getCenterX()
    return centerX;
    // public void setCenterY(int ycoords)
    // centerY = ycoords;
    public int getCenterY()
    return centerY;
    public static void main(String[] args){
    TriangleButtonBean agui = new TriangleButtonBean();
    } // End of class

    Please READ, STUDY, and UNDERSTAND the error messages, they are telling you exactly what the problem is:
    . . .\TriangleButtonBean.java:56: cannot find symbol
    symbol  : method drawPolygon(int,int,int)
    location: class java.awt.Graphics
    g.drawPolygon(centerX,centerY, sides); //Draw polygon using xcoord,ycoord and number of sides
    ^
    . . .\TriangleButtonBean.java:57: cannot find symbol
    symbol  : method fillPolygon(int,int,int)
    location: class java.awt.Graphics
    g.fillPolygon(centerX,centerY, sides); //Fill poly
    ^
    2 errors
    Process javac exited with code 1In both cases the messages ar telling you that the methods
    drawPolygon(int,int,int)
    method fillPolygon(int,int,int)
    can't be found in java.awt.Graphics
    And if you look at the documentation, you see that is indeed the problem - the first two arguments are int arrrays, not int.
    Fix the method signature or use something else.

  • "Cannot find Symbol" error message

    I have a "cannot find symbol" error message on line 5 below in
    the driver class.
    Thank you for your assistance
    1 public class GameLauncher
    2 {
    3  public static void main(String[] args)
    4 {
    5   GuessGame game = new GuessGame();
    6   game.startGame();
    7 }
    8}
    public class GuessGame
      public void startGame()
      Player p1;
      Player p2;
      Player p3;
      int guessp1 = 0;
      int guessp2 = 0;
      int guessp3 = 0;
      boolean p1isRight = false;
      boolean p2isRight = false;
      boolean p3isRight = false;
      int targetNumber = (int) (Math.random() * 10);
      System.out.println(" I'm thinking of a number between 0 and 9....");
      while(true)
        p1.guess();
        p2.guess();
        p3.guess();
        guessp1 = p1.number;
        System.out.println("Player one guessed " + guessp1);
        guessp2 = p2.number;
        System.out.println("Player two guessed " + guessp2);
        guessp3 = p3.number;
        System.out.println("Player three guessed " + guessp3);
        if (guessp1 == targetNumber)
          p1isRight = true;
        if (guessp2 == targetNumber)
          p2isRight = true;
        if (guessp3 == targetNumber)
          p3isRight = true;
        if ( p1isRight || p2isRight || p3isRight)
          System.out.println("We have a winner ! ");
          System.out.println("Player one got it right? " + p1isRight);
          System.out.println("Player two got it right? " + p2isRight);
          System.out.println("Player three got it right? " + p3isRight);
          System.out.println("Game is over ! ");
          break; //game is over so break out of loop
        else
          //we must keep going because no one guessed the number !
          System.out.println(" Players will have to try again ! ");
        } // end of if/else
      } // end of loop
    } // end of startGame() method
    } //end of class
    public class Player
      int number = 0;   // the guess is stored here
      public void guess()
        System.out.println(" I'm guessing " + number);
    ---------------------------------------------------------------  

    Thank you . You were right . I didn't set up the classes correctly.
    I corrected a few other errors and the program runs ok !
    Below is the corrected code and the output
    public class GameLauncher
      public static void main(String[] args)
       GuessGame game = new GuessGame();
       game.startGame();
    /* One possible set of output is
    I'm thinking of a number between 0 and 3....
    I'm guessing 1
    I'm guessing 3
    I'm guessing 0
    Player one guessed 1
    Player two guessed 3
    Player three guessed 0
    We have a winner !
    Player one got it right? true
    Player two got it right? false
    Player three got it right? false
    Game is over !
    public class Player
      int number = 0;   // the guess is stored here
      public void guess()
        number = (int)(Math.random() * 4);
        System.out.println(" I'm guessing " + number);
    public class GuessGame
      public void startGame()
        int x = 0;
      Player p1 = new Player();
      Player p2 = new Player();
      Player p3 = new Player();
      int guessp1 = 0;
      int guessp2 = 0;
      int guessp3 = 0;
      boolean p1isRight = false;
      boolean p2isRight = false;
      boolean p3isRight = false;
      int targetNumber = (int) (Math.random() * 4);
      System.out.println("\n I'm thinking of a number between 0 and 3....\n");
      while(x <5)
        p1.guess();
        p2.guess();
        p3.guess();
        guessp1 = p1.number;
        System.out.println("\nPlayer one guessed " + guessp1);
        guessp2 = p2.number;
        System.out.println("Player two guessed " + guessp2);
        guessp3 = p3.number;
        System.out.println("Player three guessed " + guessp3);
        if (guessp1 == targetNumber)
          p1isRight = true;
        if (guessp2 == targetNumber)
          p2isRight = true;
        if (guessp3 == targetNumber)
          p3isRight = true;
        if ( p1isRight || p2isRight || p3isRight)
          System.out.println("\nWe have a winner ! ");
          System.out.println("Player one got it right? " + p1isRight);
          System.out.println("Player two got it right? " + p2isRight);
          System.out.println("Player three got it right? " + p3isRight);
          System.out.println("Game is over ! ");
          break; //game is over so break out of loop
        else
          //we must keep going because no one guessed the number !
          System.out.println(" Players will have to try again ! ");
        } // end of if/else
        x = x + 1;
      } // end of loop
    } // end of startGame() method
    } //end of class 

  • Please help with cannot find symbol error. Been struggling all day :(

    Hi all. :)
    Writing a game for my phone with KToolbar and have been getting a cannot find symbol error for every variable and method I try to use across Classes. I've looked all over and though it seems a common problem I always either don't understand or can't get working the various solutions. Example of my errors:
    C:\...\BTK800i.java:197: cannot find symbol
    symbol : variable youSayWhat
    location: class HelloCanvas
              youSayWhat=key;
              ^
    If I try BTK800i.variable or BTK800i.message I get a new error.
    C:\...\src\BTK800i.java:184: non-static method newOrdersSarge() cannot be referenced from a static context
              BTK800i.newOrdersSarge();
              ^
    Both these errors apply to both variables and methods. It only happens when I'm using methods/variables of one class in another, am I using public and private incorrectly? It doesn't seem to make a difference if I make variables public or leave them private, I'm trying to get to them with a public method within a private class. Is it something else? I really have no idea. :(
    Here's my code, it's long enough to be a tiresome read so I've tried to skip what I know isn't relevant.
    public class BTK800i extends MIDlet {
         private Display myDisplay;
         private HelloCanvas myCanvas;
         public int youSayWhat;
            //a whole bunch more skipped here, but I'm fairly certain it's not anything that'll help find a solution
         public BTK800i() {
              paused=false;
    public void startApp() throws MIDletStateChangeException {
              if( paused ) {
                   myCanvas.repaint();
              else {
                   myDisplay=Display.getDisplay(this);
                   myCanvas=new HelloCanvas();
                   myDisplay.setCurrent(myCanvas);
                   myCanvas.setFullScreenMode(true);
                   youSayWhat=0;
                           //again with the skipping, more code not related
    public void newOrdersSarge() {
    //whole bunch of code
    //other methods skipped
    class HelloCanvas extends Canvas {
         public void keyPressed (int key) {
              youSayWhat=key;
              repaint ();
    //skippage
    }The stuff I skipped is mainly either more of the same sorta thing or maths/writing to screen stuff.
    Thanks alot to anyone who helps. I'm really struggling with this. :(
    Dan.

    But I have been reading them :(
    My next-door neighbour unfortunately is an 80-something married man, but I will go have a looksie about static and instances.
    I thought the point of public variables was that other classes could use them, is this wrong?
    Also does this mean that to use the variables from my BTK class in the HelloCanvas class I need to first instantiate BTK? I don't understand how that works as the code starts running from the BTK class in the first place :S I guess more reading will help with this.
    Thanks very much for replying. :)
    Edit:
    OK I have read up on it but I don't think I found anything I hadn't read before. I tried to make a new class which I could instantiate to hold all the variables and methods I wanted everything to be able to access, but that went disastrously. Am I right in understanding that there are no global variables in Java? :s
    Edited by: Dan69 on Apr 17, 2010 1:15 PM

  • Cannot find package error and cannot resolve symbol error

    Hi
    I have a file Assignment.java in C:\TIJCode\c03 folder. But this file belongs to the default package. This file imports a package com.bruceeckel.simpletest which is in C:\TIJCode\ folder. Now this package has a file named Test.java which accesses a few more files fromt he same package.
    I set the classpath to C:\TIJCode. When i try to run the Assignment file I get an error saying package com.bruceeckel.simpletest cannot be found and cannot resolve symbol error. symbol: Test Class: Assignment.
    The files in com.bruceeckel.simpletest package were not compiled. So I first tried to do that. But I get a cannot resolve symbol error while trying to compile a file NumOfLinesException which inherits SImpleTestException file. The exact error message is
    NumOfLinesException.java : 7 : cannot resolve symbol
    symbol : class SimpleTestException
    location : class com.bruceeckel.simpletest.NumOfLinesException extends SimpleTestException
    The exact code in each of above mentioned files is
    //: c03:Assignment.java
    // Assignment with objects is a bit tricky.
    // From 'Thinking in Java, 3rd ed.' (c) Bruce Eckel 2002
    // www.BruceEckel.com. See copyright notice in CopyRight.txt.
    import com.bruceeckel.simpletest.*;
    class Number {
    int i;
    public class Assignment {
    static Test monitor = new Test();
    public static void main(String[] args) {
    Number n1 = new Number();
    Number n2 = new Number();
    n1.i = 9;
    n2.i = 47;
    System.out.println("1: n1.i: " + n1.i +
    ", n2.i: " + n2.i);
    n1 = n2;
    System.out.println("2: n1.i: " + n1.i +
    ", n2.i: " + n2.i);
    n1.i = 27;
    System.out.println("3: n1.i: " + n1.i +
    ", n2.i: " + n2.i);
    monitor.expect(new String[] {
    "1: n1.i: 9, n2.i: 47",
    "2: n1.i: 47, n2.i: 47",
    "3: n1.i: 27, n2.i: 27"
    } ///:~
    //: com:bruceeckel:simpletest:SimpleTestException.java
    // From 'Thinking in Java, 3rd ed.' (c) Bruce Eckel 2002
    // www.BruceEckel.com. See copyright notice in CopyRight.txt.
    package com.bruceeckel.simpletest;
    public class SimpleTestException extends RuntimeException {
    public SimpleTestException(String msg) {
    super(msg);
    } ///:~
    //: com:bruceeckel:simpletest:NumOfLinesException.java
    // From 'Thinking in Java, 3rd ed.' (c) Bruce Eckel 2002
    // www.BruceEckel.com. See copyright notice in CopyRight.txt.
    package com.bruceeckel.simpletest;
    public class NumOfLinesException extends SimpleTestException {
    public NumOfLinesException(int exp, int out) {
    super("Number of lines of output and "
    + "expected output did not match.\n" +
    "expected: <" + exp + ">\n" +
    "output: <" + out + "> lines)");
    } ///:~
    //: com:bruceeckel:simpletest:Test.java
    // Simple utility for testing program output. Intercepts
    // System.out to print both to the console and a buffer.
    // From 'Thinking in Java, 3rd ed.' (c) Bruce Eckel 2002
    // www.BruceEckel.com. See copyright notice in CopyRight.txt.
    package com.bruceeckel.simpletest;
    import java.io.*;
    import java.util.*;
    import java.util.regex.*;
    public class Test {
    // Bit-shifted so they can be added together:
    public static final int
    EXACT = 1 << 0, // Lines must match exactly
    AT_LEAST = 1 << 1, // Must be at least these lines
    IGNORE_ORDER = 1 << 2, // Ignore line order
    WAIT = 1 << 3; // Delay until all lines are output
    private String className;
    private TestStream testStream;
    public Test() {
    // Discover the name of the class this
    // object was created within:
    className =
    new Throwable().getStackTrace()[1].getClassName();
    testStream = new TestStream(className);
    public static List fileToList(String fname) {
    ArrayList list = new ArrayList();
    try {
    BufferedReader in =
    new BufferedReader(new FileReader(fname));
    try {
    String line;
    while((line = in.readLine()) != null) {
    if(fname.endsWith(".txt"))
    list.add(line);
    else
    list.add(new TestExpression(line));
    } finally {
    in.close();
    } catch (IOException e) {
    throw new RuntimeException(e);
    return list;
    public static List arrayToList(Object[] array) {
    List l = new ArrayList();
    for(int i = 0; i < array.length; i++) {
    if(array[i] instanceof TestExpression) {
    TestExpression re = (TestExpression)array;
    for(int j = 0; j < re.getNumber(); j++)
    l.add(re);
    } else {
    l.add(new TestExpression(array[i].toString()));
    return l;
    public void expect(Object[] exp, int flags) {
    if((flags & WAIT) != 0)
    while(testStream.numOfLines < exp.length) {
    try {
    Thread.sleep(1000);
    } catch (InterruptedException e) {
    throw new RuntimeException(e);
    List output = fileToList(className + "Output.txt");
    if((flags & IGNORE_ORDER) == IGNORE_ORDER)
    OutputVerifier.verifyIgnoreOrder(output, exp);
    else if((flags & AT_LEAST) == AT_LEAST)
    OutputVerifier.verifyAtLeast(output,
    arrayToList(exp));
    else
    OutputVerifier.verify(output, arrayToList(exp));
    // Clean up the output file - see c06:Detergent.java
    testStream.openOutputFile();
    public void expect(Object[] expected) {
    expect(expected, EXACT);
    public void expect(Object[] expectFirst,
    String fname, int flags) {
    List expected = fileToList(fname);
    for(int i = 0; i < expectFirst.length; i++)
    expected.add(i, expectFirst[i]);
    expect(expected.toArray(), flags);
    public void expect(Object[] expectFirst, String fname) {
    expect(expectFirst, fname, EXACT);
    public void expect(String fname) {
    expect(new Object[] {}, fname, EXACT);
    } ///:~

    What do you have in the C:\TIJCode\ directory? Does the directory structure mimic the package structure for the stuff you're importing?

  • SSO to BI - Service Cannot Be Reached Error

    Hi All-
    I'm working on integrating BI and EP (both Netweaver 7). We've exported/imported the certificates for both systems and defined the BI system in the System Landscape of EP. All connection tests return OK.
    I created an iView using the iView template for "BEx Web Application iView (SAP NetWeaver 7.0 Format)", assigned the alias of the BI system created, and added the BEx query string.
    When I preview this iView, I get the error:
    "Service cannot be reached",
    What has happened?
    URL
    http://<domain>.com/irj/servlet/prt/portal/prtmode/preview/prtroot/com.sap.ip.bi.web.portal.integration.launcher call was terminated because the corresponding service is not available.
    However, if I switch the iView property for Version to "BW 2.x/3.x", then I can connect to the report, but it opens to the variable screen.
    Any ideas on how to correct the service cannot be reached error?
    Thanks

    Dear Tim,
    A couple of things you might want to look at.
    1. In the system that you have created for BI, ensure that you have
    a. ITS Path : /sap/bc/gui/sap/its/webgui
    b. Web AS Path : /sap/bw/BEx
    Also for the hostnames, ITS and WebAS a FQDN is given followed by the portnumber.
    2. In the system where your BI resides, go to transaction SICF and ensure this patch under
    default_host : /sap/bc/gui/sap/its/webgui is active and
    default_host : /sap/bw/BEx is active as well.
    To ensure it is active, just do a right click and activate it, if it already active, you can deactive it and active it again and test.
    Cheers!
    Sandeep Tudumu

  • "Value cannot be null" error when trying to edit or create Maintenance Plan in SQL Server 2008

    I have SQL Server 2008 installed on Windows Server 2008 64bit, every time I try to open or create a new Maintenance Plan I receive the error:
    Value cannot be null.
    Parameter name: component (System.Design)
    Program Location:
       at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.GetDesigner(IComponent component)
       at Microsoft.DataTransformationServices.VsIntegration.DtsDesignerService.OpenDesigner(String connectionString, Object connection, String objectUrn)
       at Microsoft.SqlServer.Management.DatabaseMaintenance.MaintDesignerMenuHandler.Invoke()
    And in the Design view screen
    "Microsoft SQL Server Management Studio is unable to load this document: Could not load type 'Microsoft.SqlServer.Dts.runtime.Wrapper.IDTSPackageSigning100' from assembly 'Microsoft.SqlServer.DTSRunTimeWrap, Version=10.0.0.0, Culture=neutral'. 
    I have searched for a possible solution and have tried some suggestions of registering the msxml6.dll but and have installed VS2008 SP1 but I'm not in a position where I can do a full reinstall of SQL Server right now. Any help is appreciated. My SQL server
    environment information is below. 
    Microsoft SQL Server Management Studio
    10.0.1600.22 ((SQL_PreRelease).080709-1414 )
    Microsoft Analysis Services Client Tools
    2007.0100.1600.022 ((SQL_PreRelease).080709-1414 )
    Microsoft Data Access Components (MDAC)
    6.0.6002.18005 (lh_sp2rtm.090410-1830)
    Microsoft MSXML 3.0 4.0 5.0 6.0 
    Microsoft Internet Explorer 8.0.6001.18943
    Microsoft .NET Framework 2.0.50727.4206
    Operating System 6.0.6002

    I digged a little deeper and figured out it was a missing directory/file in %TEMP%. Seems some CleaningTool removes all files/directories in %Temp% and after that SSMS was not working any longer. The missing file is actually not needed, but the
    missing directory causes the "Value cannot be null" error.
    My missing file name was:
    C:\Users\<username>\AppData\Local\Temp\2\6vvdaozf.tmp
    But the file name changes on every startup.
    So my missing directory name was:
    C:\Users\<username>\AppData\Local\Temp\2
    After creating a empty directory with the name "2" in %TEMP% all went back to work fine for me.
    I'm not sure the directory name is every time the same, but you can discover your missing file with the process monitor from Sysinternal Tools and filters to "Process Name is ssms.exe" and "Path contains AppData\Local\Temp"
    Hope this helps other people to solve their issues too.
    Thank you!! When I run %temp% it takes me to "C:\Users\Admin ...~\AppData\Local\Temp\some random number". At first the random number was 3, after I logged off and back on it was 2. My temp variable in enviromental variables is correct. I looked on another machine
    running SQL2008 and temp is correct there. If I try to rename the numbered folder SSMS stops working. Any idea?

  • PL/SQL reporting problem -  "The webpage cannot be found" error

    Dear All Expert,
    I'm here having a problem on generating apex report using PL/SQL. "The webpage cannot be found" error appear when "Search" button pressed.
    I'm appreciating if anyone can give their idea on this issue.
    PL/SQL will be fired when "Search" button pressed.
    My PL/SQL code as below;
    DECLARE
    lv_desc CLOB:='';
    lv_note_desc varchar2(4000);
    lv2      CLOB;
    lv_title varchar2(2000);
    lv_ti          varchar2(10);
    lv_tg          varchar2(10);
    lv_tr_cnt     integer:= 0;
    lv_ti_code     varchar2(6);
    lv_age          number(6):= 0;
    lv_note_flag     varchar(1);
    fv_note_flag varchar2(6);
    fv_ti_code varchar2(6);
    ti_code varchar2(20);
    ti_name varchar2(50);
    ti_tm_code varchar2(6);
    ti_test_grp varchar2(6);
    note_desc varchar2(4000);
    ti_unit varchar2(20);
    ti_insurance_code varchar2(20);
    ti_price number(14);
    ti_sex varchar(1);
    ti_age varchar(10);
    ti_tr_desc varchar(30);
    ti_lolimit number(10);
    ti_uplimit number(10);
    ti_plolimit number(10);
    ti_puplimit number(10);
    lv_hkey          number(10):= 0;
    lv_found     varchar2(1):= 'N';
    lv_itpv     varchar2(4000);          
    lv_lolimit     char(15);
    lv_uplimit     char(15);
    lv_tr          char(15);
    lv_tc          char(30);
    CURSOR READ_C1_REC IS
    select ti_code, ti_name, ti_tm_code, ti_test_grp,ti_unit, ti_itpv_flag,ti_attached_cmt
    from test_item
    where ti_code like NVL(:P11104_TI_CODE,'%')
    and ti_test_grp like NVL(:P11104_TG_CODE,'%')
    and ti_code not like '0MB%'
    order by ti_code;
    C1_REC READ_C1_REC%ROWTYPE;
    CURSOR READ_C2_REC IS
    select tr_sex_code,tr_ageto,tr_agecode,tr_range_desc,tr_mrr_desc,tr_normal_lolimit,tr_upper_uplimit,tr_panic_lolimit,tr_panic_uplimit
    from tr_range
    where tr_ti_code = lv_ti_code
    order by tr_ageto asc,tr_sex_code desc;
    C2_REC READ_C2_REC%ROWTYPE;
    cursor READ_C3_REC is
    select tivh_key
    from test_itpvh
    where tivh_ti_code = ti_code
    order by tivh_efd desc;
    C3_REC READ_C3_REC%ROWTYPE;
    cursor READ_C4_REC is
    select tivd_lolimit,tivd_uplimit,tivd_value,tivd_rr_desc
    from test_itpvd
    where tivd_hkey = lv_hkey
    order by tivd_seqno;
    C4_REC READ_C4_REC%ROWTYPE;
    BEGIN
    lv_title := '<div style="overflow: auto;height: 500px; width: 1000px;"><table style="width: 500px" cellpadding="0" cellspacing="0"><thead><tr><th>Code</th><th>Name</th></tr></thead>';
    htp.p(lv_title);
    OPEN READ_C1_REC;
    LOOP
    FETCH READ_C1_REC INTO C1_REC;
    EXIT WHEN READ_C1_REC%NOTFOUND;
         lv_note_flag := 'N';     
    fv_note_flag := 'N';
         fv_ti_code := c1_rec.ti_code;
    ti_code := c1_rec.ti_code;
    ti_name := ' '||c1_rec.ti_name;
    ti_tm_code := c1_rec.ti_tm_code;
         ti_test_grp := c1_rec.ti_test_grp;
    lv_desc := '<tbody><tr><td><input type="hidden" name="f01" value="'||fv_ti_code||'" /></td>'||
    '<td><input type="text" name="f02" size="20" maxlength="20" value="'||ti_code||'" /></td>'||
    '<td><input type="text" name="f03" size="50" maxlength="50" value="'||ti_name||'" /></td>'||
    '<td><input type="text" name="f04" size="6" maxlength="6" value="'||ti_tm_code||'" /></td>'||
    '<td><input type="text" name="f05" size="6" maxlength="6" value="'||ti_test_grp||'" /></td>';
    if c1_rec.ti_itpv_flag = 'Y' then
         lv_note_flag := 'Y';
         open read_c3_rec;
         loop
              fetch read_c3_rec into c3_rec;
              exit when read_c3_rec%notfound;
              lv_hkey := c3_rec.tivh_key;
              lv_found := 'Y'; exit;
         end loop;
         close read_c3_rec;
    if lv_found = 'Y' then
              lv_lolimit := 'Lower limit'; lv_uplimit := 'Upper limmit';
              lv_tr := 'Result'; lv_tc := 'Comment';
              lv_itpv := 'INTERPRETED TEST RESULT'||chr(10)||'-----------------------'||chr(10)||lv_lolimit||lv_uplimit||lv_tr||lv_tc||chr(10);
              open read_c4_rec;
              loop
              fetch read_c4_rec into c4_rec;
              exit when read_c4_rec%notfound;
              lv_lolimit := to_char(c4_rec.tivd_lolimit,'999990.999');
              lv_uplimit := to_char(c4_rec.tivd_uplimit,'999990.999');
    lv_tr := c4_rec.tivd_value;          
              lv_tc := c4_rec.tivd_rr_desc;
              lv_itpv := lv_itpv||chr(10)||lv_lolimit||lv_uplimit||lv_tr||lv_tc;
              end loop;
              close read_c4_rec;
         end if;
    note_desc := lv_itpv||chr(10)||chr(10);
         end if;
         if ltrim(rtrim(c1_rec.ti_attached_cmt)) is not null then
         lv_note_flag := 'Y';
         note_desc := note_desc||'ATTACHED COMMENTS'||chr(10)||'-----------------'||chr(10)||ltrim(rtrim(c1_rec.ti_attached_cmt))||chr(10);
         end if;
    begin
         select unit_name into ti_unit
    from unit_tbl
    where unit_code = c1_rec.ti_unit;
         exception when no_data_found then
    ti_unit := null;
         end;
    lv_desc := lv_desc ||'<td><input type="text" name="f06" size="20" maxlength="20" value="'||ti_unit||'" /></td>';
    begin
         select imh_insurance_code, imh_curr_p1 into ti_insurance_code, ti_price
         from item_masterh
    where imh_code = c1_rec.ti_code;
         exception when no_data_found then
         ti_insurance_code := null; ti_price := null;
         end;
    lv_desc := lv_desc ||'<td><input type="text" name="f07" size="20" maxlength="20" value="'||ti_insurance_code||'" /></td>'||'<td><input type="text" name="f08" size="14" maxlength="14" value="'||to_char(ti_price)||'" /></td>';
    lv_ti_code := c1_rec.ti_code;     
    lv_tr_cnt := 0;
    lv2 := '<table width="100%" border="0" bgcolor="#009900" cellspacing="0">';
    OPEN READ_C2_REC;
         LOOP
         FETCH READ_C2_REC INTO C2_REC;
         EXIT WHEN READ_C2_REC%NOTFOUND;
         lv_tr_cnt := lv_tr_cnt + 1;
    if c2_rec.tr_agecode = 'Y' then                    
    lv_age := c2_rec.tr_ageto / 365;
         elsif c2_rec.tr_agecode = 'M' then
              lv_age := c2_rec.tr_ageto / 30;
         else
              lv_age := c2_rec.tr_ageto;
         end if;
         ti_sex := c2_rec.tr_sex_code;
    ti_age := lv_age||c2_rec.tr_agecode;     
    ti_tr_desc := ' '||c2_rec.tr_range_desc;
         ti_lolimit := c2_rec.tr_normal_lolimit;
         ti_uplimit := c2_rec.tr_upper_uplimit;
         ti_plolimit := c2_rec.tr_panic_lolimit;
         ti_puplimit := c2_rec.tr_panic_uplimit;
    if c2_rec.tr_range_desc = 'MRR' then
         lv_note_flag := 'Y';
         note_desc := 'MRR DESCRIPTION'||chr(10)||'---------------'||chr(10)||c2_rec.tr_mrr_desc||chr(10)||chr(10)||note_desc;
         end if;
    if lv_note_flag = 'Y' then
    fv_note_flag := 'Y';
    end if;
    lv2 := lv2 || '<tr><td><input type="text" name="f09" size="1" maxlength="1" value="'||ti_sex||'" /></td>'||'<td><input type="text" name="f10" size="10" maxlength="10" value="'||to_char(ti_age)||'" /></td>'||'<td><input type="text" name="f11" size="30" maxlength="30" value="'||ti_tr_desc||'" /></td>'||'<td><input type="text" name="f12" size="10" maxlength="10" value="'||to_char(ti_lolimit,'99990.999')||'" /></td>'||'<td><input type="text" name="f13" size="10" maxlength="10" value="'||to_char(ti_uplimit,'99990.999')||'" /></td>'||'<td><input type="text" name="f14" size="10" maxlength="10" value="'||to_char(ti_plolimit,'99990.999')||'" /></td>'||'<td><input type="text" name="f15" size="10" maxlength="10" value="'||to_char(ti_puplimit,'99990.999')||'" /></td></tr>';
         END LOOP; lv2 := lv2||'</table>';
         CLOSE READ_C2_REC;
    if lv_tr_cnt = 0 then
         if lv_note_flag = 'Y' then
    fv_note_flag := 'Y';
    end if;
         end if;
    lv_desc := lv_desc||'<td><input type="hidden" name="f16" value="'||fv_note_flag||'" /></td>'||'<td><input type="hidden" name="f17" value="'||note_desc||'" /></td>';
         lv_desc := lv_desc||'<td>'||lv2||'</td></tr></tbody>';
    htp.p(lv_desc);
    END LOOP;
    CLOSE READ_C1_REC;
    htp.p('</table>');
    END;
    Thanks you very much in advance!

    First thing I'd say is that you're code doesn't compile:
    lv_title := '   //  <----Secondly, does no-one use comments anymore? Isn't this drilled into people in programming classes at colleges? There's a whole bunch of code there but not much in the way of explanation as to what you are trying to achieve. It might make perfect sense to you now but try going back to it in a year and see if you can untangle it's purpose.
    Thirdly, is there a specific reason why you've chosen to manually generate a report in PL/SQL, rather than delegating it to a report region? I understand that for particular formatting requirements (denormalised data, cells-within-cells etc), it is occasionally necessary to go to these lengths but I can't help but feeling a well-written query could simplify a lot of this, particularly the references multiple cursors.

Maybe you are looking for

  • Need to remove carriage returns, spaces, etc.

    Hello, I am trying to build a string that is on one line, 1,2,3,4,5,6,7,8,9 however, I wind up with each number on a separate line. 1, 2, 3, 4, 5, 6, 7, 8, 9 My code looks like this: var xxx = ""; for (var i=1; i<= nNumWords; i++) {       global.srch

  • Setting fonts in reports.

    Using labview V6.1 and Windows 2000. I am using the Append front panel image to report.vi to attach a panel image to a report. I would like to set the font of the text that is in this image, but the set report font.vi does nothing for this neither do

  • Fastest way you switch between multiple images (CS3) ?

    I'm originally a Fireworks user (from 2001) and am starting to learn Photoshop as it is in my CS3 set and it's superiority in image editing. BUT, I was suprised/shocked/P.O.-ed to notice Photoshop doesn't have tabs to easily switch between images lik

  • Order probability in quotation

    Hello, Has anyone worked with Probability in % of a quotation leading into a sales order? On the item category (AGN for example) you can predefine a percentage for order probability. The help text reads: "When you enter a value, the sales probability

  • Transition from my firefox extension to a Flash Builder desktop app

    Trying to make a slow transistion from my firefox extension to a Flash Builder desktop app. Okay i'm not familiar on how to go about this I have js code that lets my app sync it self with the lates build it looks for a new version number which is in