Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How i will print excel file in java

843805Apr 25 2006 — edited Apr 27 2006
hi,
I have generated an excel file using "jexcelapi_2_5_9" tool. Now want to print this file from java.Now i cannot do it. How this possible? Is there anybody can help me? I have send my code :
package selec_image;

import jxl.Workbook;
import jxl.write.*;
import java.io.*;

public class Excel {

public Excel(String name) {
try{
Workbook wb= Workbook.getWorkbook(new File("report.xls"));
WritableWorkbook copy=Workbook.createWorkbook(new File("Workbook.xls"),wb);
WritableSheet sheet = copy.getSheet(0);


Label label = new Label(0,1,"Bina");
sheet.addCell(label);
Label label1 = new Label(1,1,"187");
sheet.addCell(label1);

WritableImage image = new WritableImage(2,3,2,6,new File(name));
sheet.addImage(image);
copy.write();
copy.close();
}
catch(Exception ex){
ex.printStackTrace();
}
}
}
Now i want to print Workbook.xls. But i cannot do it. Plaese help me.
With regards
bina
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 25 2006
Added on Apr 25 2006
2 comments
516 views