Problem in intialling JTable data

Hi Guys,
I have written following code for JTable
private javax.swing.JTable source_detailTable;
source_detailTable.setModel(new javax.swing.table.DefaultTableModel(
        new Object [100][7],
            new String [] {
                "Col No", "Field  Name", "Field  Type", "Field Length", "Field Scale", "Not Null", "Key"
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.Integer.class, java.lang.Integer.class, java.lang.Boolean.class, java.lang.Boolean.class
            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            public boolean isCellEditable(int row, int col) {
                     String datatype = (String) source_detailTable.getModel().getValueAt(row, 2);
                     System.out.println("datatype " + datatype);
                //return true;
                     if(datatype != null){
                     if(col == 3){
                                return isPrecisionEditable(datatype);                         
                     }else if (col == 4) {
                          return isScaleEditable(datatype);
                         }else{
                          return true;
                } else {
                    return true;
       });wht i want is last two column musts be initiallize with false as it is of type boolean ,but currently it is initiallized with null.
i even written
new Object [][] {
                        {null, null, null, null, null, null, null},
                        {null, null, null, null, null, null, null},
                        {null, null, null, null, null, null, null},
                        {null, null, null, null, null, null, null}
                    },but for 100 rows i cant do it this way.
Need your help.
Thanks in advance.

wht i want is last two column musts be initiallize with falseThen initialize them. Use:
model.setValueAt(...);
You can easily create a loop to do this.
Don't depent on an IDE to generate your code because then you are afraid to make changes.

Similar Messages

  • Problem in populating jtable data from database

    hi,
    i am using JTable to retrieve data from database and show it in table. JTable
    is working fine with static data. but while retrieving from databse its giving a NullPointerException at getColumnClass() method. Below is complete source code. plzz help.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.sql.*;
    import javax.swing.table.*;
    /*jdbc connection class*/
    class connect
    Connection con;
    Statement stat;
    public connect()throws Exception
    Class.forName("org.postgresql.Driver");
    con=DriverManager.getConnection("jdbc:postgresql://localhost/dl","dl","dl");
    stat=con.createStatement();
    public ResultSet rsf(String rsstr)throws Exception
    ResultSet rs=stat.executeQuery(rsstr);
    return rs;
    public void upf(String upstr)throws Exception
    stat.executeUpdate(upstr);
    class MyTableModel extends AbstractTableModel
    private String[] columnNames = {"name","id","dep","cat","rem","chkout"};
    Object[][] data;
    public MyTableModel()
    try{
    connect conn=new connect();
    ResultSet rs3=conn.rsf("select * from usertab");
    ResultSetMetaData rsmd=rs3.getMetaData();
    int col=rsmd.getColumnCount();
    int cou=0;while(rs3.next()){cou++;}
    data=new Object[cou][col];
    System.out.println(cou+" "+col);
    ResultSet rs2=conn.rsf("select * from usertab");
    int i=0;int j=0;
    for(i=0;i<cou;i++)
    rs2.next();
    for(j=0;j<col;j++)
    data[i][j]=rs2.getString(getColumnName(j));
    System.out.println(data[0][2]);
    }catch(Exception e){System.out.println("DFD "+e);}
            public int getColumnCount() {
                return columnNames.length;
            public int getRowCount() {
                return data.length;
            public String getColumnName(int col) {
                return columnNames[col];
            public Object getValueAt(int row, int col) {
                return data[row][col];
           public Class getColumnClass(int c) {
              return getValueAt(0, c).getClass();
            public boolean isCellEditable(int row, int col) {
                if (col < 2) {
                    return false;
                } else {
                    return true;
            public void setValueAt(Object value, int row, int col) {
                data[row][col] = value;
                fireTableCellUpdated(row, col);
    class MyFrame extends JFrame
    public MyFrame()
         setSize(600,500);
         JPanel p1=new JPanel();
         p1.setBackground(new Color(198,232,189));
         JTable table = new JTable(new MyTableModel());
         table.setPreferredScrollableViewportSize(new Dimension(500,200));
         table.setBackground(new Color(198,232,189));
         JScrollPane scrollPane = new JScrollPane(table);
         scrollPane.setBackground(new Color(198,232,189));
         p1.add(scrollPane);
         getContentPane().add(p1);
    /*Main Class*/
    class test2
         public static void main(String args[])
         MyFrame fr =new MyFrame();
         fr.setVisible(true);
    }thanx

    hi nickelb,
    i had returned Object.class in the getColumnClass() method. But then i
    got NullPointerException at getRowCount() method. i could understand that the
    main problem is in data[][] object. In all the methods its returning null values as it is so declared outside the construtor. But if i declare the object inside the constructor, then the methods could not recognize the object. it seems i cant do the either ways. hope u understood the problem.
    thanx

  • Problem printing the JTable

    Hi all,
    I have a problem with printing JTable.
    My application has a submit button,JTable and Print Button.
    As I click on the Submit button, the data is retrieved from the Database(MS Access) and displayed on the JTable.
    Now when I click on the Print button, the printer properties dialog box is displayed. But when I click on the print button in the dialog box, nothing is printed on the paper.
    I checked the printers and faxes in the control panel, It showed Java printing under the Document name and Printing under the Status. It is displayed for sometime and then disappeared after some time. But nothing is printed on the paper(not even the blank paper).
    I tried a lot but couldn't understand the problem.
    I have used the following files:
    PrintJTable.java
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.print.*;
    import java.awt.geom.*;
    import java.awt.Dimension;
    import java.applet.*;
    import java.sql.*;
    import java.util.*;
    import java.net.*;
    import java.lang.*;
    import javax.swing.table.*;
    import javax.swing.event.*;
    import javax.swing.border.*;
    class PrintJTable implements ActionListener,Printable
    Connection connect;
    ResultSet rs;
    JTable table;
    JScrollPane tableAggregate;
    DisplayTable displayTable;
    JButton print,submitButton;
    public PrintJTable()
    JFrame frame = new JFrame("Table");
    frame.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {System.exit(0);}});
    connect();
    displayTable= new DisplayTable();
    JButton submitButton= new JButton("SUBMIT");
    submitButton.addActionListener(this);
    JButton printButton= new JButton("PRINT!");
    // for faster printing turn double buffering off
    RepaintManager.currentManager( frame).setDoubleBufferingEnabled(false);
    printButton.addActionListener( new ActionListener(){
    public void actionPerformed(ActionEvent evt) {
    PrinterJob pj=PrinterJob.getPrinterJob();
    pj.setPrintable(PrintJTable.this);
    pj.printDialog();
    try{
    pj.print();
    }catch (Exception PrintException) {}
    tableAggregate = createTable();
    tableAggregate.setBorder(new BevelBorder(BevelBorder.LOWERED));
    frame.getContentPane().setLayout(new BorderLayout());
    frame.getContentPane().add(submitButton,BorderLayout.NORTH);
    frame.getContentPane().add(tableAggregate,BorderLayout.CENTER);
    frame.getContentPane().add(printButton,BorderLayout.SOUTH);
    frame.pack();
    frame.setVisible(true);
    } // end of constructor
    public void connect()
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    System.out.println("Opening db connection");
    connect = DriverManager.getConnection("jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=C:/db1.mdb","","");
    catch (ClassNotFoundException ex) {
    System.err.println("Cannot find the database driver classes.");
    System.err.println(ex);
    catch (SQLException ex) {
    System.err.println("Cannot connect to this database.");
    System.err.println(ex);
    public JScrollPane createTable() {
    displayTable= new DisplayTable();
    JTable table = new JTable(displayTable);
         table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
         table.getTableHeader().setReorderingAllowed(false);
    JScrollPane scrollpane = new JScrollPane(table,
    JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
    JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    return scrollpane;
    } // end of createTable()
    public void actionPerformed(ActionEvent ie)
    try
    Statement statement6=connect.createStatement();
    ResultSet rs6=statement6.executeQuery("select * from benf_details");
    displayTable.executeQuery(rs6);
    statement6.close();
    catch(SQLException sqle)
    JOptionPane.showMessageDialog(null,"error2"+sqle);
    }// end of actionPerformed
    public int print(Graphics g, PageFormat pageFormat, int pageIndex) throws PrinterException {
    Graphics2D g2 = (Graphics2D)g;
    g2.setColor(Color.black);
    int fontHeight=g2.getFontMetrics().getHeight();
    int fontDesent=g2.getFontMetrics().getDescent();
    double pageHeight = pageFormat.getImageableHeight()-fontHeight; //leave room for page number
    double pageWidth = pageFormat.getImageableWidth();
    System.out.println("page width = " + pageWidth );
    double tableWidth = (double) table.getColumnModel().getTotalColumnWidth();
    System.out.println("table width = " + tableWidth );
    double scale = 1;
    if (tableWidth >= pageWidth) {
    scale = pageWidth / tableWidth;
    System.out.println("scale = " + scale );
    double headerHeightOnPage = table.getTableHeader().getHeight() * scale;
    double tableWidthOnPage = tableWidth * scale;
    double oneRowHeight = (table.getRowHeight() + table.getRowMargin()) * scale;
    int numRowsOnAPage = (int)((pageHeight - headerHeightOnPage) / oneRowHeight);
    double pageHeightForTable = oneRowHeight * numRowsOnAPage;
    int totalNumPages = (int)Math.ceil(((double)table.getRowCount())/numRowsOnAPage);
    if(pageIndex >= totalNumPages) {
    return NO_SUCH_PAGE;
    g2.translate(pageFormat.getImageableX(), pageFormat.getImageableY());
    g2.drawString("Page: "+ (pageIndex + 1),(int)pageWidth / 2 - 35,
    (int)( pageHeight + fontHeight - fontDesent ));//bottom center
    g2.translate( 0f, headerHeightOnPage );
    g2.translate( 0f, -pageIndex * pageHeightForTable );
    //If this piece of the table is smaller than the size available,
    //clip to the appropriate bounds.
    if (pageIndex + 1 == totalNumPages) {
    int lastRowPrinted = numRowsOnAPage * pageIndex;
    int numRowsLeft = table.getRowCount() - lastRowPrinted;
    g2.setClip(0, (int)(pageHeightForTable * pageIndex),
    (int) Math.ceil(tableWidthOnPage),
    (int) Math.ceil(oneRowHeight * numRowsLeft));
    //else clip to the entire area available.
    else{
    g2.setClip(0, (int)(pageHeightForTable * pageIndex),
    (int) Math.ceil(tableWidthOnPage),
    (int) Math.ceil(pageHeightForTable));
    g2.scale(scale,scale);
    table.paint(g2);
    g2.scale(1/scale,1/scale);
    g2.translate( 0f, pageIndex * pageHeightForTable);
    g2.translate( 0f, -headerHeightOnPage);
    g2.setClip(0, 0,(int) Math.ceil(tableWidthOnPage), (int)Math.ceil(headerHeightOnPage));
    g2.scale(scale,scale);
    table.getTableHeader().paint(g2);//paint header at top
    return Printable.PAGE_EXISTS;
    } // end of print()
    public static void main(String[] args) {
    new PrintJTable();
    }// end of PrintJTable
    DisplayTable.java
    import java.util.Vector;
    import java.sql.*;
    import javax.swing.*;
    import javax.swing.table.AbstractTableModel;
    import javax.swing.event.TableModelEvent;
    public class DisplayTable extends AbstractTableModel {
    Connection connection;
    Statement statement;
    ResultSet resultSet;
    String[] columnNames = {};
    Vector          rows = new Vector();
    ResultSetMetaData metaData;
    String db_uname,db_passwd;
    public DisplayTable() {
    public void executeQuery(ResultSet resultSet) {
    try {
    metaData = resultSet.getMetaData();
    int numberOfColumns = metaData.getColumnCount();
    columnNames = new String[numberOfColumns];
    // Get the column names and cache them.
    // Then we can close the connection.
    for(int column = 0; column < numberOfColumns; column++) {
    columnNames[column] = metaData.getColumnLabel(column+1);
    // Get all rows.
    rows = new Vector();
    while (resultSet.next()) {
    Vector newRow = new Vector();
    for (int i = 1; i <= getColumnCount(); i++) {
         newRow.addElement(resultSet.getObject(i));
    rows.addElement(newRow);
    // close(); Need to copy the metaData, bug in jdbc:odbc driver.
    fireTableChanged(null); // Tell the listeners a new table has arrived.
    catch (SQLException ex) {
    System.err.println(ex);
    public void close() throws SQLException {
    System.out.println("Closing db connection");
    resultSet.close();
    statement.close();
    connection.close();
    protected void finalize() throws Throwable {
    close();
    super.finalize();
    // Implementation of the TableModel Interface
    // MetaData
    public String getColumnName(int column) {
    if (columnNames[column] != null) {
    return columnNames[column];
    } else {
    return "";
    public Class getColumnClass(int column) {
    int type;
    try {
    type = metaData.getColumnType(column+1);
    catch (SQLException e) {
    return super.getColumnClass(column);
    switch(type) {
    case Types.CHAR:
    case Types.VARCHAR:
    case Types.LONGVARCHAR:
    return String.class;
    case Types.BIT:
    return Boolean.class;
    case Types.TINYINT:
    case Types.SMALLINT:
    case Types.INTEGER:
    return Integer.class;
    case Types.BIGINT:
    return Long.class;
    case Types.FLOAT:
    case Types.DOUBLE:
    return Double.class;
    case Types.DATE:
    return java.sql.Date.class;
    default:
    return Object.class;
    // to make the cells editable
    public boolean isCellEditable(int row, int column) {
    try {
    return metaData.isWritable(column+1);
    catch (SQLException e) {
    return false;
    public int getColumnCount() {
    return columnNames.length;
    // Data methods
    public int getRowCount() {
    return rows.size();
    public Object getValueAt(int aRow, int aColumn) {
    Vector row = (Vector)rows.elementAt(aRow);
    return row.elementAt(aColumn);
    public String dbRepresentation(int column, Object value) {
    int type;
    if (value == null) {
    return "null";
    try {
    type = metaData.getColumnType(column+1);
    catch (SQLException e) {
    return value.toString();
    switch(type) {
    case Types.INTEGER:
    case Types.DOUBLE:
    case Types.FLOAT:
    return value.toString();
    case Types.BIT:
    return ((Boolean)value).booleanValue() ? "1" : "0";
    case Types.DATE:
    return value.toString(); // This will need some conversion.
    default:
    return "\""+value.toString()+"\"";
    public void setValueAt(Object value, int row, int column) {
    try {
    String tableName = metaData.getTableName(column+1);
    // Some of the drivers seem buggy, tableName should not be null.
    if (tableName == null) {
    System.out.println("Table name returned null.");
    String columnName = getColumnName(column);
    String query =
    "update "+tableName+
    " set "+columnName+" = "+dbRepresentation(column, value)+
    " where ";
    // We don't have a model of the schema so we don't know the
    // primary keys or which columns to lock on. To demonstrate
    // that editing is possible, we'll just lock on everything.
    for(int col = 0; col<getColumnCount(); col++) {
    String colName = getColumnName(col);
    if (colName.equals("")) {
    continue;
    if (col != 0) {
    query = query + " and ";
    query = query + colName +" = "+
    dbRepresentation(col, getValueAt(row, col));
    System.out.println(query);
    System.out.println("Not sending update to database");
    // statement.executeQuery(query);
    catch (SQLException e) {
    // e.printStackTrace();
    System.err.println("Update failed");
    Vector dataRow = (Vector)rows.elementAt(row);
    dataRow.setElementAt(value, column);
    }

    Java 1.5 incorporates a very simple way to print from a JTable. I am using a mysql DB but it is the same concept. Review my code and let me know if you have any questions.
    package emsmain;
    import java.awt.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.io.*;
    import java.sql.*;
    import java.text.MessageFormat;
    import java.util.*;
    import javax.print.*;
    import javax.print.attribute.HashPrintRequestAttributeSet;
    import javax.print.attribute.PrintRequestAttributeSet;
    import javax.swing.*;
    import javax.swing.JTable;
    import javax.swing.table.*;
    import java.awt.print.*;
    public class TableFromDatabase extends JFrame implements ActionListener{
        JButton jbtprint = new JButton("Print Report");
        JTable Reporttable;
        Connection conn = Connect_Database.getConnection();
         public TableFromDatabase()
    Vector columnNames = new Vector();
    Vector data = new Vector();     
              try{  
                String query = null;
                Statement ps = null;
                ResultSet rs = null;
                  //Class Master List
                  if (Report_Menu.jrbMaster_list.isSelected()){
                      query =("Select * from students") ;
                  //Classes taken by student
                  if (Report_Menu.jrbClass_taken.isSelected()){
                      String taken = Report_Menu.jtfStudent.getText();
                      query = ("select program.course_num, course_name, course_start_date, course_stat_desc from registration, program where student_id = '"+taken+"' and program.course_num = registration.course_num");
                  //Birthday report
                  if (Report_Menu.jrbBirthday.isSelected()){
                      String birthday = (String) Report_Menu.jcb_birthday.getSelectedItem();
                      query = ("SELECT student_id, fname, lname, address, city, state_name, zipcode, dob FROM students where substring(dob, 6,2) = '"+birthday+"'"); 
                  //Course Catologue
                  if (Report_Menu.jrbCourseCatologue.isSelected()){
                      String course = (String) Report_Menu.jcbChooseCourse.getSelectedItem();
                      query = ("select  course_name, course_length, course_cost, course_credits from course where course_name = '"+course+"'");
                  //Certification expiration report
                  if (Report_Menu.jrbExpiration.isSelected()){
                      String month = (String) Report_Menu.jcbMonth.getSelectedItem();
                      String year = (String) Report_Menu.jcbYear.getSelectedItem();
                      query = ("SELECT FNAME, LNAME FROM STUDENTS, REGISTRATION WHERE substring(expiration_date, 6,2) = '"+month+"' and substring(expiration_date, 1,4) = '"+year+"' and registration.student_id = students.student_id") ;
                  //Class Roster
                  if (Report_Menu.jrbRoster.isSelected()){
                      String c_number = Report_Menu.jtfClassNumber.getText();
                      query = ("Select course_name, course_start_date, fname, lname from program, registration, students where program.course_num = '"+c_number+"' and registration.student_id = students.student_id;");
                  //Squad list and counts
                  if (Report_Menu.jrbSquadCount.isSelected()){
                      query = ("SELECT Squad_Name, count(student_id) from students group by Squad_Name");
                  //Student List
                  if (Report_Menu.jrbStudent_list.isSelected()){
                      String Choose_month = (String) Report_Menu.jcbcourse_month.getSelectedItem();
                      String Choose_Course = (String) Report_Menu.jcbcourse_name.getSelectedItem();
                      query = ("select count(student_id) from (registration, program) where program .course_name = '"+Choose_Course+"' and substring(course_start_date, 6,2) = '"+Choose_month+"'and registration.course_num = program.course_num;");
                ps = conn.createStatement();
                //Run Selected Report
                ps.execute(query);
                rs = ps.executeQuery(query);
                ResultSetMetaData md = rs.getMetaData();
                int columns = md.getColumnCount();
                //  Get column names
                for (int i = 1; i <= columns; i++)
                    columnNames.addElement( md.getColumnName(i) );
                //  Get row data
                while (rs.next())
                    Vector row = new Vector(columns);
                    for (int i = 1; i <= columns; i++)
                        row.addElement( rs.getObject(i) );
                    //add row data to JTable
                    data.addElement( row );
                rs.close();
                ps.close();
            catch(Exception e)
                JOptionPane.showMessageDialog(null,e.getMessage());
            //  Create Jtable with database data 
            Container c = getContentPane();
            c.setLayout(new BorderLayout());
            Reporttable = new JTable(data, columnNames);
            JScrollPane scrollPane = new JScrollPane( Reporttable );
            c.add( scrollPane );
            JPanel buttonPanel = new JPanel();
            buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
            buttonPanel.add(jbtprint);
            c.add(buttonPanel,BorderLayout.SOUTH);
            jbtprint.addActionListener(this);
        public void actionPerformed(ActionEvent e){
             if(e.getActionCommand().equals("Print Report")){
               PrintForm();
    public void PrintForm(){ 
         try {
             String name = null;
             // Will display correct heading for print job
             if (Report_Menu.jrbMaster_list.isSelected()){
             name = "Master List";
             if (Report_Menu.jrbBirthday.isSelected()){
             name = "Birthday List";
             if (Report_Menu.jrbClass_taken.isSelected()){
             name = "Classes taken by Student";
             if (Report_Menu.jrbCourseCatologue.isSelected()){
             name = "Course Catalogue";
             if (Report_Menu.jrbExpiration.isSelected()){
             name = "Certification Expiration Report";
             if (Report_Menu.jrbRoster.isSelected()){
             name = "Class Roster";
             if (Report_Menu.jrbSquadCount.isSelected()){
             name = "Squad list with Student Counts";
             if (Report_Menu.jrbStudent_list.isSelected()){
             name = "Student count by Course";
             // fetch the printable
             Printable printable = Reporttable.getPrintable(JTable.PrintMode.FIT_WIDTH,
                                                      new MessageFormat(name),
                                                      new MessageFormat("Page - {0}"));
             // fetch a PrinterJob
             PrinterJob job = PrinterJob.getPrinterJob();
             // set the Printable on the PrinterJob
             job.setPrintable(printable);
             // create an attribute set to store attributes from the print dialog
             PrintRequestAttributeSet attr = new HashPrintRequestAttributeSet();
             // display a print dialog and record whether or not the user cancels it
             boolean printAccepted = job.printDialog(attr);
             // if the user didn't cancel the dialog
             if (printAccepted) {
                    try {
                          // do the printing (may need to handle PrinterException)
                        job.print(attr);
                    } catch (PrinterException ex) {
                        ex.printStackTrace();
         } finally {
             // restore the original table state here (for example, restore selection)
    }

  • Problem in Customising JTable's Functionality

    Problem Scenario :
    We are facing a problem related to JTables. In our GUI, we have used JTables and the data model that we are using for the table is a bit complicated. Complicated in the sense that we want different values(multiple) in each cell of a particular column in the table and we want to use JComboBox at that particular cell. For achieving this we have set the values in the JComboBox in its renderer class. But to set the user selected value in the particular cell JComboBox we initialized a new JComboBox in the renderer class. With this the GUI is working fine but it has raised a problem that if we renderer the component another JComboBox appears in the same cell. The problem is obvious as we are initializing a new JComboBox in the renderer class, but to solve our purpose we don�t have another way.
    With the kind of data model we are using is it possible to create a JTable with combo boxes in a particular cell having different option values in each cell?
    Could someone suggest a solution for this problem?
    Regards
    Prajkta Bonde
    [email protected]

    I have done it around 4 years back. Add filled JComboBox as table data.
    Attached sample code should help
    // Imports
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.table.*;
    class SimpleTableExample
              extends      JFrame
         // Instance attributes used in this example
         private     JPanel          topPanel;
         private     JTable          table;
         private     JScrollPane scrollPane;
         // Constructor of main frame
         public SimpleTableExample()
              // Set the frame characteristics
              setTitle( "Simple Table Application" );
              setSize( 300, 200 );
              setBackground( Color.gray );
              // Create a panel to hold all other components
              topPanel = new JPanel();
              topPanel.setLayout( new BorderLayout() );
              getContentPane().add( topPanel );
              // Create columns names
              String columnNames[] = { "Column 1", "Column 2", "Column 3" };
              Object dataValues[][] = new Object[10][3];
              for(int row=0;row<dataValues.length;row++) {
                   for(int col=0;col<dataValues[row].length;col++){
                        JComboBox tempBox = new JComboBox();
                        for(int data=0;data<10;data++){
                             tempBox.addItem("Row "+row+" Column "+col+" Data "+data);
                        dataValues[row][col]=tempBox;
              // Create a new table instance
              table = new JTable( dataValues, columnNames );
            comboBoxColumn(table.getColumnModel().getColumn(0));
            comboBoxColumn(table.getColumnModel().getColumn(1));
            comboBoxColumn(table.getColumnModel().getColumn(2));
              // Add the table to a scrolling pane
              scrollPane = new JScrollPane( table );
              topPanel.add( scrollPane, BorderLayout.CENTER );
        public void comboBoxColumn(TableColumn comboBoxCol) {
            comboBoxCol.setCellEditor(new TableComponentEditor());
            comboBoxCol.setCellRenderer(new TableComponentRenderer());
            //Set up tool tip for the sport column header.
            TableCellRenderer headerRenderer = comboBoxCol.getHeaderRenderer();
            if (headerRenderer instanceof DefaultTableCellRenderer) {
                 ((DefaultTableCellRenderer)headerRenderer).setToolTipText("Click the sport to see a list of service stations");
        } //end of method
        class TableComponentEditor extends DefaultCellEditor {
            * Constructor
            * @param none
            TableComponentEditor() {
                super(new JComboBox());
            * Called when table Cell is clicked
            * @param table
            * @param value - Object associated with the particular column for which it is called
            * @param isSelected -whether the particular cell is selected
            * @param row - The row to which cell belongs
            * @param column - The Column To which Cell Belongs
            public  Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
                cbo = (JComboBox)value;
                return cbo;
            *  getCellEditorValue
            * @return Object
            public Object getCellEditorValue() {
                return cbo;
            /***************CLASS VARIABLES***********************/
            private JComboBox cbo = null;
        class TableComponentRenderer  implements TableCellRenderer {
            public  Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)  {
                return (JComboBox)value;
         // Main entry point for this example
         public static void main( String args[] )
              // Create an instance of the test application
              SimpleTableExample mainFrame     = new SimpleTableExample();
              mainFrame.setVisible( true );
    }

  • Java.io.NotSerializableException when overwrite the JTable data into .txt file

    hi everyone
    this is my first time to get help from sun forums
    i had java.io.NotSerializableException: java.lang.reflect.Constructor error when overwrite the JTable data into .txt file.
    At the beginning, the code will be generate successfully and the jtable will be showing out with the data that been save in the studio1.txt previously,
    but after i edit the data at the JTable, and when i trying to click the save button, the error had been showing out and i cannot succeed to save the JTable with the latest data.
    After this error, the code can't be run again and i had to copy the studio1.txt again to let the code run 1 more time.
    I hope i can get any solution at here and this will be very useful for me.
    the following is my code...some of it i create it with the GUI netbean
    but i dunno how to attach my .txt file with this forum
    did anyone need the .txt file?
    this is the code that suspect maybe some error here
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    String filename = "studio1.txt";
              try {
                  FileOutputStream fos = new FileOutputStream(new File(filename));
                  ObjectOutputStream oos = new ObjectOutputStream(fos);
                   oos.writeObject(jTable2);
                   oos.close();
              catch(IOException e) {
                   System.out.println("Problem creating table file: " + e);
                   return;
              System.out.println("JTable correctly saved to file " + filename);
    }the full code will be at the next msg

    this is the part 1 of the code
    this is the full code...i had /*....*/ some of it to make it easier for reading
    package gui;
    import javax.swing.*;
    import java.io.*;
    public class timetables extends javax.swing.JFrame {
        public timetables() {
            initComponents();
        @SuppressWarnings("unchecked")
        private void initComponents() {
            jDialog1 = new javax.swing.JDialog();
            buttonGroup1 = new javax.swing.ButtonGroup();
            buttonGroup2 = new javax.swing.ButtonGroup();
            buttonGroup3 = new javax.swing.ButtonGroup();
            buttonGroup4 = new javax.swing.ButtonGroup();
            jTextField1 = new javax.swing.JTextField();
            jLayeredPane1 = new javax.swing.JLayeredPane();
            jLabel6 = new javax.swing.JLabel();
            jTabbedPane1 = new javax.swing.JTabbedPane();
            jScrollPane3 = new javax.swing.JScrollPane();
            jTable2 = new javax.swing.JTable();
            jScrollPane4 = new javax.swing.JScrollPane();
            jTable3 = new javax.swing.JTable();
            jButton1 = new javax.swing.JButton();
            jButton2 = new javax.swing.JButton();
    /*       org.jdesktop.layout.GroupLayout jDialog1Layout = new org.jdesktop.layout.GroupLayout(jDialog1.getContentPane());
            jDialog1.getContentPane().setLayout(jDialog1Layout);
            jDialog1Layout.setHorizontalGroup(
                jDialog1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(0, 400, Short.MAX_VALUE)
            jDialog1Layout.setVerticalGroup(
                jDialog1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(0, 300, Short.MAX_VALUE)
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            jLayeredPane1.add(jLabel6, javax.swing.JLayeredPane.DEFAULT_LAYER);
            String filename1 = "studio1.txt";
            try {
                   ObjectInputStream ois = new ObjectInputStream(new FileInputStream(filename1));
                   jTable2 = (JTable) ois.readObject();
                   System.out.println("reading for " + filename1);
              catch(Exception e) {
                   System.out.println("Problem reading back table from file: " + filename1);
                   return;
            try {
                   ObjectInputStream ois = new ObjectInputStream(new FileInputStream(filename1));
                   jTable3 = (JTable) ois.readObject();
                   System.out.println("reading for " + filename1);
              catch(Exception e) {
                   System.out.println("Problem reading back table from file: " + filename1);
                   return;
            jTable2.setRowHeight(20);
            jTable3.setRowHeight(20);
            jScrollPane3.setViewportView(jTable2);
            jScrollPane4.setViewportView(jTable3);
            jTable2.getColumnModel().getColumn(4).setResizable(false);
            jTable3.getColumnModel().getColumn(4).setResizable(false);
            jTabbedPane1.addTab("STUDIO 1", jScrollPane3);
            jTabbedPane1.addTab("STUDIO 2", jScrollPane4);
            jTextField1.setText("again n again");
            jLabel6.setText("jLabel5");
            jLabel6.setBounds(0, 0, -1, -1);
            jButton2.setText("jButton2");
            jButton1.setText("jButton1");
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton1ActionPerformed(evt);
          

  • Java.io.NotSerializableException when overwrite the JTable data into .txt

    hi everyone
    i had java.io.NotSerializableException: java.lang.reflect.Constructor error when overwrite the JTable data into .txt file.
    At the beginning, the code will be generate successfully and the jtable
    will be showing out with the data that been save in the studio1.txt
    previously,
    but after i edit the data at the JTable, and when i trying to click the
    save button, the error had been showing out and i cannot succeed to
    save the JTable with the latest data.
    After this error, the code can't be run again and i had to copy the studio1.txt again to let the code run 1 more time.
    I hope i can get any solution at here and this will be very useful for me.
    but i dunno how to attach my .txt file with this forum
    did anyone need the .txt file?
    the following is my suspect code
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    String filename1 = "studio1.txt";
              try {
                  FileOutputStream fos = new FileOutputStream(new File(filename1));
                  ObjectOutputStream oos = new ObjectOutputStream(fos);
                   oos.writeObject(jTable2.getModel());
                   oos.flush();
                   oos.close();
                   fos.close();
              catch(IOException e) {
                   System.out.println("Problem creating table file: " + e);
                            e.printStackTrace();
                   return;
              System.out.println("JTable correctly saved to file " + filename1);
    }this is the reading code
    String filename1="studio1.txt";
            try {
                   ObjectInputStream ois = new ObjectInputStream(new FileInputStream(filename1));
                   TableModel model = (TableModel)ois.readObject();
                    jTable3.setModel(model);
                   System.out.println("reading for " + filename1);
              catch(Exception e) {
                   System.out.println("Problem reading back table from file: " + filename1);
                   return;
              }Edited by: Taufulou on Jan 8, 2009 11:43 PM
    Edited by: Taufulou on Jan 8, 2009 11:44 PM
    Edited by: Taufulou on Jan 8, 2009 11:45 PM

    is this the code u mean?
    i had put this code inside it but the problem still remain the same
    if (jTable2.isEditing()) {
                jTable2.getCellEditor().stopCellEditing();
            }i had found a new thing that when i just double click the cell without change any data inside the table
    and click the button "Save". the same exception which is
    java.io.NotSerializableException: java.lang.reflect.Constructor
    will come out again.

  • Problem with extract huge data in WEBI (Errors:WIO 30280 and ERR_WIS_30270)

    Hi gurus, need your help.
    When we run the query for the report we get an error in Web Intellegence .
    This error may be two types. And their rotation occurs randomly.
    First error: There is no memory available. Please close document to free memory (WIO 30280)
    Second error: An internal error occurred while calling the 'processDPCommands' API. (ERR_WIS_30270)
    When we try reopen WEB Intelligence, or reloading servers or machine, we have no   any results and get error again.
    I was try change different parametrs in universe designer for connection and universe, in central managment console for WEBI, but it's not solve problem
    This query select data from huge table (4,7 million rows), and when I use limit for maximum rows in WEBI my report working correctly.
    Is there any way to solve these problems associated with large data? What  is invoke this problem when we try to get full data?
    We use Business Objects Enterprise XI 3.1 version 12.4.0.966 
    Our system Windows Server  R2  Enterprise 2008 SP1 (64-bit system), Processor Intel 2.67 GHz (2 processors), RAM 8 Gb.                                                                               
    Thanks.
                                                                                    Ruslan

    Hi Brad,
    here we are talking about XI3.1 which has the limitations inherited from the operating system. as this blog post explains with plenty of details.
    In BI4.0 you can leverage larger datasets without any problems however you need to properly size and configure the services.
    There are several documents out there:
    How to configure the APS  http://scn.sap.com/docs/DOC-31711
    Companion Guide
    https://service.sap.com/~sapdownload/011000358700000307202011E/SBO_BI_4_0_Companion_V4.pdf
    Web Intelligence Sizing Guide
    https://service.sap.com/~sapdownload/011000358700001403692011E/BI_4_0_WEBI_NEW.pdf
    Best regards,
    Simone

  • How can I debug a problem with the 3g data connection on my iPhone 4s?

    This question didn't get any answers in the "Using iPhone" forum. Thought I would re-ask here. Note, I had to reset the network again today 2 days after the last reset:
    I've been having intermittent problems with my 3g data connection on my iPhone 4s on ATT. Whenever this happens I see full bars etc, but can't browse from safari or get any data in other apps. My wife's iPhone 4 right next to me has no issues at all. Switching on/off airplane mode and turning off/on Cellular Data does not help. The only thing that helps is resetting the Network Settings or hard restarting the phone.
    I figured my problems were hardware related so I took my phone in for a replacement the other day. Things started out fine but after I upgraded it to 5.01 and restored my backup and now I am back to having the same issue today. I assume the issue is with something coming from my backup / restore but is there any way for me to pinpoint what could be causing the issue. I have a lot of apps, I'd rather not have to reinstall and set them all backup manually, but I would if I knew that would fix the problem... but for all I know one of the apps could be causing it.
    Anyone have any logs I can check or testing I can do on my end?
    Thanks!

    Unfortunately, Apple does not make any logs available to the average schmoe (like us) for networking, kernel dumps, or anything else (assuming, of course, it is not jailbroken).
    Your best bet is to take it back into the store. Ask them to look at the notes in GCRM regarding the last time this occured, then explain after upgrading to 5.01 it is occuring again. Then ask them for a phone swap since it is a reoccuring issue and doesn't sound like an OS/SW issue. Good luck!

  • Problem while exporting the data from a report to an excel file.

    Hi SAP guru's,
    I have a problem while exporting the data from a report to an excel file.
    The problem is that after exporting, the excel file seems to have some irrelevant characters....I am checking this using SOST transaction..
    Required text (Russian):
    Операции по счету                                    
    № документа     Тип документа     № учетной записи     Дата документа     Валюта     Сумма, вкл. НДС     Срок оплаты     Описание документа
    Current Text :
       ? 5 @ 0 F 8 8  ? >  A G 5 B C                                   
    !   4 > : C       "" 8 ?  4 > : C      !   C G 5 B = > 9  7 0 ? 8 A 8        0 B 0  4 > : C         0 ; N B 0      ! C <       ! @ > :  > ? ; 0 B K        ? 8 A 0 = 8 5  4 > : C
    Can you help me making configuration settings if any?
    Regards,
    Avinash Raju

    Hi Avinash
    To download  such characteres you need to adjust code page to be used during export. You can review SAP note 73606 to identify which code page is required for this language
    Best regards

  • Can't open file - error "There was a problem reading the layer data.."

    I'm on a
    Mac Pro, 10.5.7
    PSCS3
    I have been sent a file (148MB) from a client via FTP that I can not open. The file was created on a PC, using PSCS3.
    I'm usually pretty good at troubling shooting but I have not seen this before.
    Any help, suggestions would welcomed.
    I get the following error messages: (see attached)

    It looks like the atttachement did not work
    Here are the error messages:
    First message:
    "There was a problem reading the layer data. Read the composite date instead?"
    Second Message:
    "Could not complete your request because the file is not compatiable with this version of Photoshop."

  • Request: Problem in Extraction of data from CRM to BW

    Hi Gurus
    I have problems in extracting the data from CRM to BW.I thought you are the one who can solve them:
    1) When I check the data in the datasource in RSA3 i can see all records as well as i can see complete data in that but when i extract and check the data in cube i can see all records but i cannot see the complete data i.e some data is missing.
    2)And another problem is that In report i have 2 characteristics(DATS) start date and end date now i am trying to get number of days from start date to end date.
    I appreciate you in advance. If u find any good documentation please send me to [email protected]
    With regards
    Nagamani.

    Hi krishna,
                       yes we did enhancement to this data source. In PRDOCTION its taking 27 hours time  to load data.
              For extraction from source system (CRM) its taking  nearly 24 hours time  as per JOb LOG .
    08/05/2010 11:53:08 Call customer enhancement EXIT_SAPLRSAP_001 (CMOD) with 10,849 records
    08/05/2010 12:02:02 Result of customer enhancement: 10,849 records
    08/05/2010 12:02:03 PSA=0 USING & STARTING SAPI SCHEDULER
    08/05/2010 12:02:03 Asynchronous send of data package 1 in task 0002 (1 parallel tasks)
    08/05/2010 12:02:06 IDOC: Info IDoc 2, IDoc No. 1576298, Duration 00:00:01
    08/05/2010 12:02:06 IDoc: Start = 08/05/2010 10:26:37, End = 08/05/2010 10:26:38
    08/05/2010 13:02:38 Call customer enhancement EXIT_SAPLRSAP_001 (CMOD) with 10,958 records
    08/05/2010 13:11:48 Result of customer enhancement: 10,958 records
    08/05/2010 13:11:52 Asynchronous send of data package 2 in task 0003 (1 parallel tasks)
    08/05/2010 13:11:53 tRFC: Data Package = 1, TID = 0AA00D0301984C5AEE8E44DB, Duration = 00:16:
    08/05/2010 13:11:53 tRFC: Start = 08/05/2010 12:02:19, End = 08/05/2010 12:18:27
    08/05/2010 14:30:13 Call customer enhancement EXIT_SAPLRSAP_001 (CMOD) with 11,296 records
    08/05/2010 14:39:53 Result of customer enhancement: 11,296 records
    like this its taking 24 hours in extraction its self.
    Edited by: kotha123 on Aug 10, 2010 12:08 PM
    Edited by: kotha123 on Aug 10, 2010 12:09 PM

  • Problem with transferring of data to non sap

    Hi all,
             I am doing program of creating excise invoice details and those are transfering to non sap.and I am successfully passing text file to that non sap by using FTP connection.
    like FTP_CONNECT
    FTP_COMMAND
    FTP_R3_TO_CLIENT
    FTP_DISCONNECT
    But text file details are coming like this
    means even line items are all displaying in one row.means continously all line items are coming just like this.
    0001000264,070914,,,1000,Steel (pune) Plant,
    Retail Outlet 1,0001000265,070914,,,1000,Steel (hyderabad) Plant,Retail Outlet 1
    Actually here problem is text file data is continously coming with ','
    means actually those values has to come as
             0001000264,070914,,,1000,ESSAR Steel (Hazira) Plant,Retail Outlet 1
            0001000264,070914,,,1000,ESSAR Steel (Hazira) Plant,Retail Outlet 1
    How to split those records when sending the text file.
    This is very big issue.I am unable to complete this issue.
    Please if any one knows the solution please guide me.
    please help me.
    Thanks & Regards,
    J.Goud

    Hi all,
                My problem was solved.But I have used GUI_DOWNLOAD.
        But i want to place the file name with increasing order number.
    Just like suppose 1st i am placing file name as  PO000051.txt
    next time the file name has to be placed with increasing order like PO000052.txt
    I am generating the number in my program actually i am using like this.If i keep file name as
    190.0.18.65\qdls\ITGSAP_P\PO000052.txt means only it will place only that file how to increment that number. i am not getting.
    If i am keeping
    190.0.18.65\qdls\ITGSAP_P\g_file   like this means file is not placing.
    pls help me if any one knows solution.
      CALL FUNCTION 'GUI_DOWNLOAD'
           EXPORTING
              BIN_FILESIZE        = ' '
              CODEPAGE            = ' '
                FILENAME            = '
    190.0.18.65\qdls\ITGSAP_P\g_file'
              FILETYPE            = ' '
              MODE                = ' '
              WK1_N_FORMAT        = ' '
              WK1_N_SIZE          = ' '
              WK1_T_FORMAT        = ' '
              WK1_T_SIZE          = ' '
              COL_SELECT          = ' '
              COL_SELECTMASK      = ' '
          importing
               filelength          =
           TABLES
                DATA_TAB            = ist_file
              FIELDNAMES          =
           EXCEPTIONS
                FILE_OPEN_ERROR     = 1
                FILE_WRITE_ERROR    = 2
                INVALID_FILESIZE    = 3
                INVALID_TABLE_WIDTH = 4
                INVALID_TYPE        = 5
                NO_BATCH            = 6
                UNKNOWN_ERROR       = 7
                OTHERS              = 8.
    regards,
    J.Goud

  • Re: Problem with transferring of data to non sap by using FTP funtion modul

    Hi all,
             I am doing program of creating excise invoice details and those are transfering to non sap.and I am successfully passing text file to that non sap by using FTP connection.
    like FTP_CONNECT
    FTP_COMMAND
    FTP_R3_TO_CLIENT
    FTP_DISCONNECT
    But text file details are coming like this
    means even line items are all displaying in one row.means continously all line items are coming just like this.
    0001000264,070914,,,1000,Steel (pune) Plant,
    Retail Outlet 1,0001000265,070914,,,1000,Steel (hyderabad) Plant,Retail Outlet 1
    Actually here problem is text file data is continously coming with ','
    means actually those values has to come as
             0001000264,070914,,,1000,ESSAR Steel (Hazira) Plant,Retail Outlet 1
            0001000264,070914,,,1000,ESSAR Steel (Hazira) Plant,Retail Outlet 1
    How to split those records when sending the text file.
    This is very big issue.I am unable to complete this issue.
    Please if any one knows the solution please guide me.
    please help me.
    Thanks & Regards,
    J.Goud

    Hi all,
             I am doing program of creating excise invoice details and those are transfering to non sap.and I am successfully passing text file to that non sap by using FTP connection.
    like FTP_CONNECT
    FTP_COMMAND
    FTP_R3_TO_CLIENT
    FTP_DISCONNECT
    But text file details are coming like this
    means even line items are all displaying in one row.means continously all line items are coming just like this.
    0001000264,070914,,,1000,Steel (pune) Plant,
    Retail Outlet 1,0001000265,070914,,,1000,Steel (hyderabad) Plant,Retail Outlet 1
    Actually here problem is text file data is continously coming with ','
    means actually those values has to come as
             0001000264,070914,,,1000,ESSAR Steel (Hazira) Plant,Retail Outlet 1
            0001000264,070914,,,1000,ESSAR Steel (Hazira) Plant,Retail Outlet 1
    How to split those records when sending the text file.
    This is very big issue.I am unable to complete this issue.
    Please if any one knows the solution please guide me.
    please help me.
    Thanks & Regards,
    J.Goud

  • Problem with transferring of data to non sap by using FTP funtion modul

    Hi all,
             I am doing program of creating excise invoice details and those are transfering to non sap.and I am successfully passing text file to that non sap by using FTP connection.
    like FTP_CONNECT
    FTP_COMMAND
    FTP_R3_TO_CLIENT
    FTP_DISCONNECT
    But text file details are coming like this
    means even line items are all displaying in one row.means continously all line items are coming just like this.
    0001000264,070914,,,1000,Steel (pune) Plant,
    Retail Outlet 1,0001000265,070914,,,1000,Steel (hyderabad) Plant,Retail Outlet 1
    Actually here problem is text file data is continously coming with ','
    means actually those values has to come as
             0001000264,070914,,,1000,ESSAR Steel (Hazira) Plant,Retail Outlet 1
            0001000264,070914,,,1000,ESSAR Steel (Hazira) Plant,Retail Outlet 1
    How to split those records when sending the text file.
    This is very big issue.I am unable to complete this issue.
    Please if any one knows the solution please guide me.
    please help me.
    Thanks & Regards,
    J.Goud

    Hi,
         Thanks for reply.
    Hi all,
                My problem was solved.But I have used GUI_DOWNLOAD.
        But i want to place the file name with increasing order number.
    Just like suppose 1st i am placing file name as  PO000051.txt
    next time the file name has to be placed with increasing order like PO000052.txt
    I am generating the number in my program actually i am using like this.If i keep file name as
    190.0.18.65\qdls\ITGSAP_P\PO000052.txt means only it will place only that file how to increment that number. i am not getting.
    If i am keeping
    190.0.18.65\qdls\ITGSAP_P\g_file   like this means file is not placing.
    pls help me if any one knows solution.
      CALL FUNCTION 'GUI_DOWNLOAD'
           EXPORTING
              BIN_FILESIZE        = ' '
              CODEPAGE            = ' '
                FILENAME            = '
    190.0.18.65\qdls\ITGSAP_P\g_file'
              FILETYPE            = ' '
              MODE                = ' '
              WK1_N_FORMAT        = ' '
              WK1_N_SIZE          = ' '
              WK1_T_FORMAT        = ' '
              WK1_T_SIZE          = ' '
              COL_SELECT          = ' '
              COL_SELECTMASK      = ' '
          importing
               filelength          =
           TABLES
                DATA_TAB            = ist_file
              FIELDNAMES          =
           EXCEPTIONS
                FILE_OPEN_ERROR     = 1
                FILE_WRITE_ERROR    = 2
                INVALID_FILESIZE    = 3
                INVALID_TABLE_WIDTH = 4
                INVALID_TYPE        = 5
                NO_BATCH            = 6
                UNKNOWN_ERROR       = 7
                OTHERS              = 8.
    Regards,
    j.Goud

  • Dynamic Calc processor cannot lock more than [100] ESM blocks during the calculation, please increase CalcLockBlock setting and then retry(a small data cache setting could also cause this problem, please check the data cache size setting).

    Hi,
    Our Environment is Essbase 11.1.2.2 and working on Essbase EAS and Shared Services components.One of our user tried to run the Cal Script of one Application and faced this error.
    Dynamic Calc processor cannot lock more than [100] ESM blocks during the calculation, please increase CalcLockBlock setting and then retry(a small data cache setting could also cause this problem, please check the data cache size setting).
    I have done some Google and found that we need to add something in Essbase.cfg file like below.
    1012704 Dynamic Calc processor cannot lock more than number ESM blocks during the calculation, please increase CalcLockBlock setting and then retry (a small data cache setting could also cause this problem, please check the data cache size setting).
    Possible Problems
    Analytic Services could not lock enough blocks to perform the calculation.
    Possible Solutions
    Increase the number of blocks that Analytic Services can allocate for a calculation:
    Set the maximum number of blocks that Analytic Services can allocate to at least 500. 
    If you do not have an $ARBORPATH/bin/essbase.cfg file on the server computer, create one using a text editor.
    In the essbase.cfg file on the server computer, set CALCLOCKBLOCKHIGH to 500.
    Stop and restart Analytic Server.
    Add the SET LOCKBLOCK HIGH command to the beginning of the calculation script.
    Set the data cache large enough to hold all the blocks specified in the CALCLOCKBLOCKHIGH setting. 
    Determine the block size.
    Set the data catche size.
    Actually in our Server Config file(essbase.cfg) we dont have below data  added.
    CalcLockBlockHigh 2000
    CalcLockBlockDefault 200
    CalcLockBlocklow 50
    So my doubt is if we edit the Essbase.cfg file and add the above settings and restart the services will it work?  and if so why should we change the Server config file if the problem is with one application Cal Script. Please guide me how to proceed.
    Regards,
    Naveen

    Your calculation needs to hold more blocks in memory than your current set up allows.
    From the docs (quoting so I don't have to write it, not to be a smarta***:
    CALCLOCKBLOCK specifies the number of blocks that can be fixed at each level of the SET LOCKBLOCK HIGH | DEFAULT | LOW calculation script command.
    When a block is calculated, Essbase fixes (gets addressability to) the block along with the blocks containing its children. Essbase calculates the block and then releases it along with the blocks containing its children. By default, Essbase allows up to 100 blocks to be fixed concurrently when calculating a block. This is sufficient for most database calculations. However, you may want to set a number higher than 100 if you are consolidating very large numbers of children in a formula calculation. This ensures that Essbase can fix all the required blocks when calculating a data block and that performance will not be impaired.
    Example
    If the essbase.cfg file contains the following settings:
    CALCLOCKBLOCKHIGH 500  CALCLOCKBLOCKDEFAULT 200  CALCLOCKBLOCKLOW 50 
    then you can use the following SET LOCKBLOCK setting commands in a calculation script:
    SET LOCKBLOCK HIGH; 
    means that Essbase can fix up to 500 data blocks when calculating one block.
    Support doc is saying to change your config file so those settings can be made available for any calc script to use.
    On a side note, if this was working previously and now isn't then it is worth investigating if this is simply due to standard growth or a recent change that has made an unexpected significant impact.

Maybe you are looking for

  • How do I import multiple Ai files into one Indesign File - whilst still keeping the Ai Files editable and up dateable for the one Indesign File?

    Hi All, Im relatively new to Ai and Indesign, and have been doing Uni work over Christmas, and have a rather urgent question thats stressing me out. I originally had many art boards in my ai file, but due to the number, I split these into single file

  • Scroll Wheel no longer works. Please Help !

    About a month ago, my scroll wheel suddenly just stopped working. I now have very limited use of it. For example, I cannot scroll through my song list, because it takes about 5 minutes of constantly trying to scroll, for it to move down one song. The

  • External HD issue. Finder cannot complete the operation because some data..

    Last night I had a drive throw the error "finder cannot complete the operation because some data in "<file>" could not be read or written. Error code-36". I thought it was a bad disk. Then tonight I plugged in a flash drive, formatted it on the machi

  • ERS??

    Hello All, I have been trying to run the ERS process..... 1. I have ticked GR based IV and ERS in vendor master 2. Then I created a PO for this vendor with the GR based IV ticked in the PO 3. Now I go to txn MRRL and run the Txn in test mode 4. I get

  • New on JSP

    Hello,           I am new on JSP, and I want some good and free help/tutorial for JSP.           Is JSP the same language-script for WebLogic, WebSphere, Tomcat, Apache,           etc. or it has some standards, which is the same for all servers &