Java Questions
Java Questions

Reputation: 7953

how to convert the width of column of html table to the width of excel column in java

I have width of the column value as a percentage and I want to convert the same to excel width to set the width of the column. How do we do this in java, based on what the column width is calculated in excel.?

I use the following:

HSSFSheet sheet = hwb.createSheet(reportName); 
sheet.setColumnWidth((short)columnIterator, (short)6000);

In this method, the first argument is the column id and the second one is the width of the column. I want to set this width dynamically using the html width.

Example:

If the the column width in html is 10% then what is the equelant width in excel width.? I want to set the column width of excel dynamically like setAutoColumnwidth().

UPDATE :

i found this, is this correct.

Regards,

Upvotes: 1

Views: 1676

Answers (1)

Related Questions