craftleft.gif (3002 bytes)QuickTable
Home | API | Tutorial | Download | Support | Contact topblack.gif (108 bytes)


QuickTable User Cp  |  Register  |  Members  |  Search  |  Help
    |- QuickTable Discussion Forums > JDBC/Database Issues Post New Topic   Post A Reply
Excel Copy Paste printer friendly version
next newest post | next oldest post
Author Messages
shakti_ks{@}yhaoo.com
Unregistered
Edit or delete this message Reply w/Quote
Posted Wednesday, December 31, 1969 @ 23:59:59  

I am trying to copy cells from excel to QuickTable and QuickTable to excel, I have enabled quicktable by calling
yourQuickTable.enableExcelCopyPaste() ; but still it not working here is code :

import javax.swing.*;
import quick.dbtable.*;
import java.sql.*;

public class QuickTableFrame extends JFrame
{
public QuickTableFrame()
{
//set Frame properties
setSize(300,200);
setVisible(true);

//create a new quicktable
quick.dbtable.DBTable dBTable1 = new quick.dbtable.DBTable();

//add to frame
getContentPane().add(dBTable1);

//set the database driver to be used, we are using jdbc-odbc driver
dBTable1.setDatabaseDriver("oracle.jdbc.driver.OracleDriver");

/*
set the jdbc url,"quicktabledemo" is the data source we have created
for the database
*/

try
{
//dBTable1.setJdbcUrl("jdbc:odbc:quicktabledemo");
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con = DriverManager.getConnection("jdbc:oracle:thin:@3.177.128.223:1521:train", "iriuwappid", "iri404");
dBTable1.setConnection(con);
// set the select statement which should be used by the table
dBTable1.setSelectSql("select * from EMPL");

//to create the navigation bars for the table
dBTable1.createControlPanel();


//connect to database & create a connection
//dBTable1.connectDatabase();
dBTable1.enableExcelCopyPaste() ;
//fetch the data from database to fill the table
dBTable1.refresh();
}
catch(SQLException e)
{
e.printStackTrace();
}
catch(ClassNotFoundException e)
{
e.printStackTrace();
}

}

public static void main(String[] args)
{
//create a new table frame
QuickTableFrame myframe = new QuickTableFrame();
}
}


Can anyone help me ?

Thanks

admin{@}quicktable.org
Unregistered
Edit or delete this message Reply w/Quote
Posted Wednesday, December 31, 1969 @ 23:59:59  

when you try to copy the records from QuickTable, if any of the cells are in edit mode( example if one of the cell shows texfield for editing), the ctrl-c event will go to that editing component intead of Quicktable, so the records may not be copied. Please make sure you are not editing any cells & then copy. Otherwise you can call the QuickTable method copyToClipboard(null), which will copy the selected rows into clipboard which can be later pasted in excel. Similarly if you have a paste problem , please call pasteFromClipboard()

Ben

Post New Topic   Post A Reply Jump to:
Contact Us | QuickTable - A Java DBGrid | Privacy Policy All times are GMT -5 Hours.
Welcome to QuickTable Forums, Guest!  
Login
Username :
Password :
In order to fully utilize the abilities of this board, you are required to register as a member. Registration is free, and allows you to do lots of things including turning on or off certain features of this board. Register now!
Powered by CuteCast v2.0 BETA 2
Copyright © 2001-2003 ArtsCore Studios