-
-
Save uttamhn/8a823eb4fd077b06ee62 to your computer and use it in GitHub Desktop.
ZK Page load sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Book book = ss.getSelectedSheet().getBook() //get the book object | |
Worksheet fidelityStatement = book.createSheet(“Fidelity”) //Create Fidelity statement | |
Worksheet pncStatement = book.createSheet(“PNC”) | |
//Set your headers or footers for your sheet | |
//Now load the data if you have any to the sheets you just created | |
for(int rowCount = startRow; rowCount < endRow; rowCount= rowCount+2){ | |
for(int startCell = startColumn; startCell < endColumn; startCell++){ | |
org.zkoss.poi.hssf.usermodel.HSSFCell c1 = Utils.getOrCreateCell(sheet,rowCount,startCell) | |
org.zkoss.poi.hssf.usermodel.HSSFCell c2 = Utils.getOrCreateCell(sheet,rowCount+1,startCell) | |
if(sheetNo == 0){ | |
//if this method is called for calculaton feilds on content sheet. | |
if(startRow1 != 3){ | |
c1.setCellStyle(styleList[3]) | |
c2.setCellStyle(styleList[0]) | |
if(quantityColumns && quantityColumns.contains(startCell-3)){//24 | |
c1.setCellStyle(styleList[6]) | |
c2.setCellStyle(styleList[6]) | |
} | |
.................. | |
//You can get the data as I did from your domain module, using famous groovy findBy or findAll | |
InstStatement iStatement = InstStatement.findByEffectiveDate(it, fromDate) | |
if(iStatement){ | |
Utils.setCellValue(sheet, rowNumber , columnNumber, it.tranDate) | |
Utils.setCellValue(sheet, rowNumber , columnNumber++ ,it.tranType) | |
Utils.setCellValue(sheet, rowNumber , columnNumber++,it.amount) | |
Utils.setCellValue(sheet, rowNumber , columnNumber++,balance) | |
} | |
. | |
. | |
. | |
. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment