Our next condition is: Our system has exported data in XL format, it is a large file with multiple rows and columns and After downloading and opening the user, the document is scrolled on the previous column and the last spreadsheet tab. It is very upset, it is better to focus on the first tab and the first cell. I have given a simple test code to see how it works:
public class selection {public static string file = "/usr/test/poi.test/src/main/resources / Test "; @Test Public Zero Test () throws file notfought exception, IOException {HSSFWorkbook wb = new HSSFWorkbook (new FileInputStream (file)); HSSFSheet s = wb.getSheetAt (0); S.setActive (true); HSSFRow line = s.getRow (0); HSSFCell cell = row.getlet (0); Cell.setAsActiveCell (); FileOutputStream Out = New FileOutputStream (File); Wb.write (outside); Out.close (); }} And it does not work
Here's the solution Working, it is found
HSSFWorkbook wb = new HSSFWorkbook (new FileInputStream (file)); HSSFSheet s = wb.getSheetAt (0); Wb.setActiveSheet (0); S.showInPane (0, 0); FileOutputStream Out = New FileOutputStream (File); Wb.write (outside); Out.close ();
Comments
Post a Comment