Qore jni Module 2.6.0
Loading...
Searching...
No Matches
ExcelDataProvider::ExcelWriteDataProvider Class Reference

Provides a data provider for writing EXCEL files. More...

#include <ExcelWriteDataProvider.qc.dox.h>

Inherits DataProvider::AbstractDataProvider.

Public Member Methods

void constructor (string path, soft< hash< auto > > opts)
 Creates the ExcelWriteDataProvider with the output path and optionally an option hash.
 
void constructor (OutputStream stream, soft< hash< auto > > opts)
 Creates the ExcelWriteDataProvider with an output stream and optionally an option hash.
 
void setupWriter ()
 Sets up the writer.
 
string getName ()
 Returns the object name.
 
void destructor ()
 Destructor - ensures file is written.
 
soft< hash< auto > > createRecordImpl (hash< auto > rec, soft< hash< auto > > create_options)
 Creates a single record in the data provider.
 
void commit ()
 Commits (writes) the Excel file.
 
binary getData ()
 Returns the data as binary.
 
int getCreatedCount ()
 Returns the number of records created.
 
hash< DataProviderInfo > getStaticInfoImpl ()
 Returns data provider static info.
 

Public Attributes

const auto ProviderInfo = ...
 Provider info.
 
const auto ConstructorOptions = ...
 Constructor options.
 

Private Attributes

soft< string > path
 The output path.
 
soft< OutputStream > stream
 The output stream.
 
string name
 The name of the object.
 
ExcelWriter writer
 The Excel writer object.
 
soft< hash< auto > > opts
 The options.
 

Detailed Description

Provides a data provider for writing EXCEL files.

Member Function Documentation

◆ commit()

void ExcelDataProvider::ExcelWriteDataProvider::commit ( )

Commits (writes) the Excel file.

Call this method when you are done writing records to ensure the file is written. This is also called automatically in the destructor.

◆ constructor() [1/2]

void ExcelDataProvider::ExcelWriteDataProvider::constructor ( OutputStream  stream,
soft< hash< auto > >  opts 
)

Creates the ExcelWriteDataProvider with an output stream and optionally an option hash.

Parameters
streamthe output stream to write to
optsa hash of optional options
Exceptions
EXCEL-WRITE-OPTION-ERRORinvalid or unknown option; conflicting options

◆ constructor() [2/2]

void ExcelDataProvider::ExcelWriteDataProvider::constructor ( string  path,
soft< hash< auto > >  opts 
)

Creates the ExcelWriteDataProvider with the output path and optionally an option hash.

Parameters
paththe output file path
optsa hash of optional options
Exceptions
EXCEL-WRITE-OPTION-ERRORinvalid or unknown option; conflicting options

◆ createRecordImpl()

soft< hash< auto > > ExcelDataProvider::ExcelWriteDataProvider::createRecordImpl ( hash< auto >  rec,
soft< hash< auto > >  create_options 
)

Creates a single record in the data provider.

Parameters
recthe record to create
create_optionsno options are currently supported
Returns
the record created (echoes back the input)

◆ getData()

binary ExcelDataProvider::ExcelWriteDataProvider::getData ( )

Returns the data as binary.

Returns
the Excel file contents as binary data
Note
This is an alternative to using path or stream - get the data directly

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