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 > General QuickTable Support/Help Post New Topic   Post A Reply
How do I use QuickTable in non DB mode printer friendly version
next newest post | next oldest post
Author Messages
Derek
Private

Gender: Unspecified
Location:
Registered: May 2006
Status: Offline
Posts: 1

Click here to see the profile for Derek Send email to Derek Send private message to Derek Find more posts by Derek Edit or delete this message Reply w/Quote
Posted Wednesday, May 24, 2006 @ 00:38:46  

I desire to show the data file with the delimiter "," in the QuickTable.
I try to use the function,
Code:
refresh(java.io.InputSteam in, java.lang.String delimiter)

, to display the result I desire.
This can extract the data from the file correctly, but all data was in the same row.

I encountered two puzzles to be solved.
1. What should I do to assign the header values to each corrosponding columns?
2. What should I do to control one tuple to locate in the proper line instead of piling into the same line?

Thank you.

Admin
Board Owner

Gender: Unspecified
Location:
Registered: Jul 2003
Status: Offline
Posts: 9

Click here to see the profile for Admin Send email to Admin Send private message to Admin Find more posts by Admin Edit or delete this message Reply w/Quote
Posted Wednesday, May 24, 2006 @ 11:29:47  

Since you are using File as a source, try to use the File methods instead of inputstream.

refresh(java.io.File f, java.util.Properties prop) http://quicktable.org/doc/quick/dbtable/DBTable.html#refresh(java.io.File, java.util.Properties)

or

refresh(java.io.File f, java.lang.String delimiter) http://quicktable.org/doc/quick/dbtable/DBTable.html#refresh(java.io.File, java.lang.String)

Please read the API, it answers most of your question.

1. You can either have the header names in the first line of your data file and then set the property "firstRowHasColumnNames=true" or you can load the data as you have done and then call dbTbale.getColumn(1).setHeaderValue("col1");

Code:

Properties prop = new Properties();
prop.put("delimiter",",");
prop.put("firstRowHasColumnNames", "true");

File dataFile = new File("data.txt");
dbtable.refresh(dataFile,prop);

2. This may be a bug. Try using the File object instead of inputstream. If you still have the problem. Please email to support at quicktable.org with the data file with few lines of data and the code snippet which you used to create inputstream and load data using refresh.

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