BrightSide Workbench Full Report + Source Code
org.turro.jpa.export.ExportQuery Class Reference

Public Member Functions

 ExportQuery (Collection< String > columns, Collection< Object[]> results)
 
InputStream getExcel (String sheetName)
 

Detailed Description

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

Definition at line 40 of file ExportQuery.java.

Constructor & Destructor Documentation

◆ ExportQuery()

org.turro.jpa.export.ExportQuery.ExportQuery ( Collection< String >  columns,
Collection< Object[]>  results 
)

Definition at line 45 of file ExportQuery.java.

45  {
46  this.columns = columns;
47  this.results = results;
48  }

Member Function Documentation

◆ getExcel()

InputStream org.turro.jpa.export.ExportQuery.getExcel ( String  sheetName)

Definition at line 50 of file ExportQuery.java.

50  {
51  try {
52  ByteArrayOutputStream baos = new ByteArrayOutputStream();
53  WritableWorkbook ww = Workbook.createWorkbook(baos);
54  WritableSheet ws = ww.createSheet(sheetName, 0);
55  writeSheet(ws);
56  ww.write();
57  ww.close();
58  baos.close();
59  return new ByteArrayInputStream(baos.toByteArray());
60  } catch (WriteException | IOException ex) {
61  Logger.getLogger(ExportQuery.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
62  }
63  return null;
64  }
ExportQuery(Collection< String > columns, Collection< Object[]> results)
Here is the call graph for this function:
Here is the caller graph for this function:

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