public class CSVTabularDataWriter extends Object implements ReportWriter
OutputStream
as a Text CSV FileModifier and Type | Field and Description |
---|---|
protected List<Reporter<Object[]>> |
baseReporters
Each Reporter will create a new Section
|
protected org.apache.poi.ss.usermodel.Workbook |
workbook |
Constructor and Description |
---|
CSVTabularDataWriter() |
Modifier and Type | Method and Description |
---|---|
List<Reporter<Object[]>> |
getBaseReporters()
Each Reporter will create a new Sheet
|
protected PageInfo |
getPageInfoForReport(Reporter<Object[]> report,
int index,
PageInfo pageInfo)
If the the data is is only a page then we should override and return the appropriate PageInfo
|
protected Object[] |
getParamsForReport(Reporter<Object[]> report,
int index,
Object[] params)
If there are conditions/parameters for the report; then supply them in accordance to what is required by the Data generating
Reporter s |
void |
init()
Initialize the Export Writer
|
void |
setBaseReporters(List<Reporter<Object[]>> baseReporters)
Each Reporter will create a new Sheet
|
org.apache.poi.ss.usermodel.Workbook |
writeDataToFile(Object[] params,
PageInfo pageInfo)
Generate the file from the data
|
void |
writeDataToStream(OutputStream outputStream,
Object[] params,
PageInfo pageInfo)
Generate the Excel and write it onto the
OutputStream |
protected List<Reporter<Object[]>> baseReporters
protected transient org.apache.poi.ss.usermodel.Workbook workbook
@PostConstruct public void init()
ReportWriter
init
in interface ReportWriter
protected Object[] getParamsForReport(Reporter<Object[]> report, int index, Object[] params)
Reporter
sreport
- as Reporter
index
- as intparamsas
- Object[]protected PageInfo getPageInfoForReport(Reporter<Object[]> report, int index, PageInfo pageInfo)
public org.apache.poi.ss.usermodel.Workbook writeDataToFile(Object[] params, PageInfo pageInfo) throws Exception
public void writeDataToStream(OutputStream outputStream, Object[] params, PageInfo pageInfo) throws Exception
OutputStream
writeDataToStream
in interface ReportWriter
outputStream
- as OutputStream
params
- as Object[] as any parameters to pass to the Reporter
@nullable truepageInfo
- as PageInfo
as any pagination details to pass @nullable trueException
public List<Reporter<Object[]>> getBaseReporters()
getBaseReporters
in interface ReportWriter
public void setBaseReporters(List<Reporter<Object[]>> baseReporters)
setBaseReporters
in interface ReportWriter
Copyright © 2018. All rights reserved.