Skip to Main Content

Java Programming

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!

Facing error in HSSFaddMergedRegion

pramukhAug 17 2012 — edited Aug 20 2012
Hi,

I am using Java 1.5 and Jasper Reports framework to generate an .xls file. I am using import org.apache.poi.hssf.* from java code to generate the report.

By using public int addMergedRegion(Region region) of org.apache.poi.hssf.usermodel.HSSFSheet; to merge 2 cells. I was able to merge the cells successfully. However, from past few days, this stopped working and I am getting NoSuchMethodError
java.lang.NoSuchMethodError: org.apache.poi.hssf.usermodel.HSSFSheet.addMergedRegion(Lorg/apache/poi/hssf/util/Region;)I
Here is the snippet of the code I am using
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.util.Region;

HSSFWorkbook hwb = new HSSFWorkbook();
sheet = hwb.createSheet("Overall");
sheet.addMergedRegion(new Region(1,(short)0,3,(short)0));
Alternative is using CellRangeAddress of org.apache.poi.ss.util.CellRangeAddress. But the compiler says that
org.apache.poi.ss cannot be resolved
Please suggest.


Thanks,
Pramukh

Edited by: Pramukh on Aug 17, 2012 4:09 PM
This post has been answered by unknown-7404 on Aug 17 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 17 2012
Added on Aug 17 2012
3 comments
2,190 views