Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ordering of sheets in excel in apache poi

I want to rearrange the sheets being generated before writing it to an xls document using apache poi in java. Is there any way of doing it? For ex:sheet Names are "RF for 10","Blended for 10","RF for 30","Blended for 30".

I want the xls to be generated in the following order of sheets: "RF for 10","RF for 30","Blended for 10","Blended for 30".

like image 383
nivedita rashmi Avatar asked Dec 01 '22 19:12

nivedita rashmi


1 Answers

You can rearrange the order of the sheets in a workbook with the setSheetOrder method of the Workbook class.

like image 66
rgettman Avatar answered Dec 18 '22 02:12

rgettman