BrightSide Workbench Full Report + Source Code
org.turro.financials.sheets.ReportSheet Class Reference

Public Member Functions

 ReportSheet (File sheetFile, Date date, RegisterView view)
 
InputStream getExcel () throws IOException, BiffException, WriteException
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 53 of file ReportSheet.java.

Constructor & Destructor Documentation

◆ ReportSheet()

org.turro.financials.sheets.ReportSheet.ReportSheet ( File  sheetFile,
Date  date,
RegisterView  view 
)

Definition at line 63 of file ReportSheet.java.

63  {
64  this.sheetFile = sheetFile;
65  this.date = date;
66  this.view = view;
67  this.year = new CheckDate(date).getYear();
68  dao = new FinancialsPU();
69  }

Member Function Documentation

◆ getExcel()

InputStream org.turro.financials.sheets.ReportSheet.getExcel ( ) throws IOException, BiffException, WriteException

Definition at line 71 of file ReportSheet.java.

71  {
72  clearCells = new ArrayList<WritableCell>();
73  ByteArrayOutputStream baos = new ByteArrayOutputStream();
74  WorkbookSettings wsWrite = new WorkbookSettings();
75  wsWrite.setEncoding("UTF-8");
76  WorkbookSettings wsRead = new WorkbookSettings();
77  wsRead.setEncoding("ISO-8859-1");
78  WritableWorkbook workbook = Workbook.createWorkbook(baos, Workbook.getWorkbook(sheetFile, wsRead), wsWrite);
79  for(WritableSheet sheet : workbook.getSheets()) {
80  for(int row = 0; row < sheet.getRows(); row++) {
81  for(int col = 0; col < sheet.getColumns(); col++) {
82  processCell(sheet, row, col);
83  }
84  }
85  for(WritableCell cell : clearCells) {
86  sheet.addCell(new Label(cell.getColumn(), cell.getRow(), ""));
87  }
88  clearCells.clear();
89  }
90  workbook.write();
91  workbook.close();
92  baos.close();
93  return new ByteArrayInputStream(baos.toByteArray());
94  }
Here is the caller graph for this function:

The documentation for this class was generated from the following file: