Gender: Unspecified
Location:
Registered: May 2006
Status: Offline
Posts: 1
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?
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.
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!