2.5

2016-06-17 7 views
0

내가 엑셀 ​​aspose 버전 2.5 파일을 읽을 수 aspose 버전의 Excel 파일을 읽고, 나는 최신 버전에서 우리가 할 수 있다는 것을 알고이 같은 : 나는 2.5 aspose에있는 모든 문서를 발견하지 않았다 Workbook w = new Workbook(fileStream); Cells cells = w.getWorksheets().get(0).getCells(); 2.5

.

답변

1

다음 예제 코드와 예제 콘솔 출력을 참조하십시오. 이 코드는 소스 엑셀 파일을 읽고 셀 A1 ~ A10의 이름과 해당 값을 인쇄합니다.

자바

// Open the workbook with inputstream or filepath 
Workbook wb = new Workbook(); 
wb.open("source.xlsx"); 

// Access first worksheet 
Worksheet ws = wb.getWorksheets().getSheet(0); 

// Read cells A1 to A10 and print their values 
for (int i = 0; i < 10; i++) { 
    int row = i; 
    int col = 0; 

    // Access the cell by row and col indices 
    Cell cell = ws.getCells().getCell(row, col); 

    // Print cell name and its value 
    System.out.println(cell.getName() + ": " + cell.getStringValue()); 
} 

샘플 콘솔 출력

A1: 13 
A2: 16 
A3: 87 
A4: 73 
A5: 69 
A6: 91 
A7: 59 
A8: 46 
A9: 82 
A10: 54 

참고 : 내가 Aspose에서 개발자 전도사로 일하고 있어요