|
prithaa wrote: Is there an article to open an excel file Quite possibly, have you tried a Google search?
prithaa wrote: a new file is created instead of opening the old file. Without seeing your code I don't think we can guess what you may be doing wrong.
[edit]
This method[^] is probably what you are looking for.
[/edit]
|
|
|
|
|
thanks
but the above link is not opening
my problem was the following
InputStream inp = new FileInputStream("d:/Writefile.xls");
WorkbookSettings ws = new WorkbookSettings();
Workbook wb = Workbook.getWorkbook(inp, ws);
Sheet sheet = wb.getSheet(0);
Number number;
number = new Number(0, 0, 453.25, times);
((WritableSheet) sheet).addCell(number);
wb.close();
The above code doesnt add the cell to the given file just opens the file.I get DispatchUnCaughtException for the line
((WritableSheet) sheet).addCell(number);
Thanks for the reply
Pritha
|
|
|
|
|
|
thanks Richard
but a
WritableWorkbook creates a new workbook and has no method which opens a workbook
Pritha
|
|
|
|
|
This method[^] creates one. May I suggest you go through all the documentation to check which methods are required to create the objects you are trying to work with.
|
|
|
|
|
thanks for the article
but i cant still open a writableworkbook .i can write on a new
workbook
but cant write on an existing workbook
I didnt find any method doing that either in writableworkbook
regards
Pritha
|
|
|
|
|
|
prithaa wrote: thanks for the article
I did not provide one, I wonder what you have been looking at.
prithaa wrote: but i cant still open a writableworkbook
Did you follow my advice and read all the documentation in the link I gave you? It clearly shows how to create a writeable workbook from an existing file.
|
|
|
|
|
yes i did read the link u sent and looked at the
class writablework
but there is no method which opens an existing .xls file
Regards
Pritha
|
|
|
|
|
Sorry, previous link was not correct owing to HTML frame. However, I think this one[^] is the best you will get.
|
|
|
|
|
thanks for replying
Workbook workbook = Workbook.getWorkbook(new File("d:/Writefile.xls"));
WritableWorkbook copy = Workbook.createWorkbook(new File("d:/Writefile1.xls"), workbook);
copy.write();
WritableSheet sheet = copy.getSheet("Report2");
Number number;
number = new Number(0, 0, 453.25, times);
sheet.addCell(number);
copy.write();
copy.close();
I want to open an existing file and add a cell to an existing sheet. The above code opens the file but the cell editing doesnt happen.
Regards
pritha
|
|
|
|
|
Sorry, no idea why that's happening; I think you may need to re-check the documentation and work with your debugger.
|
|
|
|
|
Thankyou Richard for your help
|
|
|
|
|
Just for the record, I have never used these packages[^]; all the information I gave you I found by using Google and reading the Javadocs.
|
|
|
|
|
Hi, I have a class for uploading a file with a method called uploadFile(), which uploads the user's file to the server in a directory like this:
C:/apache-tomcat-6.0.35/temp/accountName/username/filename
Before uploading the file, it calls the method createDirectory() which creates the above directory path if it doesnt already exist. Here is the code for it:
public void createDirectory(String accountName, String username){
if (new File("C:\\apache-tomcat-6.0.35\\temp\\" + accountName + "\\" + username).exists() == false) {
new File("C:\\apache-tomcat-6.0.35\\temp\\" + accountName + "\\" + username).mkdirs();
}
}
I want to test that it creates a directory if it doesnt exist, without actually creating the directory (so using Mockito).
I'm struggling to get to grips with Mockito and would appreciate any assistance with it.
Thanks
|
|
|
|
|
I haven't work with that before. However, why don't you read there documentations and give a try?
If you've never failed... You've never lived...
|
|
|
|
|
Im facing one problem in streaming data capture for reading the broadcast during multithreading, pls help if u get time,
Actually there is one class which is reading data from one of the udp socket another class is their which accepts the tcp connection from every client request and creates a thread for every client and request the same udp class for data the thing is working with 1st thread which gets created but when i request with another client from another pc/ip the packets get losted to the 2nd client/thread
I have made a workaround by creating a list where im storing the Threads outputstream object
and looping it to send the data to all the client but this is just temporary as it ll delay the packets if clients/connections gets increased
pls suggest if required will share the code.
thanks in advance
|
|
|
|
|
praveen2609 wrote: there is one class which is reading data from one of the udp socket another class is their which accepts the tcp connection from every client request and creates a thread for every client and request the same udp class
So which is it: TCP or UDP? There is a difference and it affects how your program needs to operate.
modified 25-Jun-12 5:23am.
|
|
|
|
|
TCP is accepting connections from client requests , and create a thread which internally calls a class in run method of thread which create a udp connection and continously receives the data from the udp port and writes it to the tcp connection outputstream object
|
|
|
|
|
I'm still not sure what you are doing; perhaps if you show some of the code that is not working people will be able to offer suggestions.
|
|
|
|
|
It appears that you have the following system.
You have UDP port which recieves data.
You have TCP listener which accepts client connections.
Once you have a client connection you want to send some or all of the data from the UDP port to those clients (it doesn't matter whether it is some or all as that is a different problem.)
Solution to the above.
Part 1.
1. Create a thread safe pipe which allows for a single input and allows for multiple readers. This has NOTHING to do with UPD nor TCP.
2. Test it.
3. Test it again using threads.
Part 2
1. Creaet a UPD port
2. Set up the UPD port to write messages (data collected from port into something meaningful) to the pipe.
3. Test this. Note that this has NOTHING to do with TCP.
Part 3
1. Create a TCP listener
2. For each listener request hook up as a reader to the pipe.
3. Test this. Note that this has NOTHING to do with UDP.
Part 4
1. Put parts 2 and 3 together.
2. Test it.
|
|
|
|
|
hello,
I will look after a few days on the developement of an application jee a little big but I decided to devote one week prior to document more about IDEs and frameworks
then after my little research, I found netbeans for me the most because I like it more than eclipse and I will rely on the tutorial application full e-commerce to the doc netbeans to make my application,
but on the use of framework, I have not a clue what to do
is that because this is the first application I must not do all even if it is large
or I have to use because it facilitates the work
what do you advise me
and if I have to use them: to which you can direct me: JSF, Spring, Struct ......
and thank you
|
|
|
|
|
You can use Eclipse RCP as a framework for your application. It is working fine and also pretty well documented. The Framework provides a lot of features that one otherwise has to develop oneself.
You have to develop under Eclipse, but that is anyway the most common used IDE. With a little experience you'll begin to love it because it's so simple and structured.
Ralf Ebert has placed his book on Eclipse RCP3.x in the web : http://www.ralfebert.de/eclipse_rcp/EclipseRCP.pdf[^]
Lars Vogel is the other big source for tutorials and howto's on this :
http://www.vogella.com/eclipse.html[^]
|
|
|
|
|
Java EE spread in a wide range, like JSF, JSP, Spring, etc... So its all depend on what you really want to do. My advice is take the only tutorial and work on with that. With the time you can have a better understanding about the subject matter.
Don't stick with one IDE. Each and every has there own advantages and disadvantages. In almost all the IDEs you can easily attach the Java DOC and refer any time you want.
If you've never failed... You've never lived...
|
|
|
|
|