tags:

views:

254

answers:

4

hi,

how can i make a cell read only in excel using java

Thanks in advance

A: 

Take a look at the Apache POI project, specifically the HSSF & XSSF subprojects, that provides a Java library to manipulate Excel documents.

antrix
A: 

Maybe you can try jExcel. It is quite simple and easy to use.

Yurish
i ve already half completed my work in apache poi so help me to solve this problem with that
Karthik.m
+2  A: 

You may use apache POI library to achive this. Here is a simple code sample:

HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("Test");

Row row = sheet.createRow(0);

CellStyle style = wb.createCellStyle();
style.setLocked(true);
cell = row.createCell(0);
cell.setCellStyle(style);

// this is important as locking is pnly activated if sheet is protected
sheet.protectSheet("");
lweller
in the above code "cell = row.createCell(0);"here what is cell
Karthik.m
A: 

You can try SmartXLS for java.

liya