import org.apache.poi.ss.usermodel.*;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.xssf.usermodel.*;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.util.CellReference;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import java.io.*;
import java.util.*;
import javax.swing.*;
public class apachePOI7A
{
public static void update(String filename, int pageno,String xy0,double a[][])
{
    FileInputStream in = new FileInputStream(new File(filename));
    String s2=word(filename);
    SXSSFWorkbook workbook = new SXSSFWorkbook(100);
    int n0[]=excelcode(xy0);
    int nx=n0[0];
    int ny=n0[1];
    Sheet sheet= workbook.getSheetAt(pageno);;
    int n=a.length;
    int m=a[0].length;
    for(int i=0;i<n;i++)
    { Row row=sheet.getRow(nx+i);
      for(int j=0;j<m;j++)
       {Cell cell=row.getCell((ny+j),Row.RETURN_BLANK_AS_NULL);
        String adress=new CellReference(cell);
        cell.setCellValue(""+a[i][j]);
       }  
    }
    in.close(); 
try {   
     FileOutputStream out=new FileOutputStream(filename);
     workbook.write(out);
     out.close();
    } catch (Exception e) {e.printStackTrace();} 
}

	
public static void main(String arg[])
{ 

}
}