VKRep
Class TReportAbstract

java.lang.Object
  |
  +--VKRep.TReportAbstract
All Implemented Interfaces:
java.lang.Runnable, java.io.Serializable
Direct Known Subclasses:
TReportHorizontal, TReportVertical

public abstract class TReportAbstract
extends java.lang.Object
implements java.io.Serializable, java.lang.Runnable

Title: Base abstract class for all generator report by VK Reports

Description: Standard set of properties and methods for all generator reports.

Copyright: Copyright (c) 2003

Company:

Version:
1.0
Author:
Vlad Karpov
See Also:
Serialized Form

Nested Class Summary
protected  class TReportAbstract.BOutStream
          Title: Class BOutStream byte array output stream Description: Used for keep intermediate result of horisontal report.
protected  class TReportAbstract.TBiffRec
          Title: Class TBiffRec represents record of BIFF file itself.
protected  class TReportAbstract.TBiffRecHeader
          Title: The header of BIFF record.
protected  class TReportAbstract.TSection
          Title: Class TSection represents VK Reports Section.
 
Field Summary
protected  java.io.InputStream blankInputStream
          Blank input stream.
static int BODY
          Number of 'BODY' section.
protected  TReportAbstract.BOutStream BOutStreamA
          Horisontal XLS4 report consist of two parts.
protected  TReportAbstract.BOutStream BOutStreamB
          Horisontal XLS4 report consist of two parts.
protected  byte charByName
          Variable charByName hold symbol for data request by name.
protected  byte charByNum
          Variable charByName hold symbol for data request by num.
static int FILE_FOOTER
          Number of 'FILE FOOTER' section.
static int FILE_HEADER
          Number of 'FILE HEADER' section.
static int GROUP_FOOTER
          Number of 'GROUP FOOTER' section.
static int GROUP_HEADER
          Number of 'GROUP HEADER' section.
protected  java.lang.String inputBlank
          File name for input blank.
protected  byte[] inputBuffer
          Input buffer.
static int LAST_DYN_SECTION
          The number which is begining of your own section definition.
protected  int lastDynSection
          This variable hold last number dynamic user define section.
protected  VKRepListener listener
          Object which implements VKRepListener interface.
static int MAX_LABEL_NAME_LEGTH
          Maximum length of Data Name for request by name.
static int MAX_SECTION_NUM
          Maximum number of sections.
protected  int offsetXLSInput
          It is work variable input XLS4 file counter.
protected  int outCase
          Horisontal XLS4 report consist of two parts.
protected  byte[] outputBuffer
          Output buffer.
protected  int outputBufferCount
          Counter for output buffer.
protected  java.lang.String outputReport
          File name for output report.
protected  int realInputBlankLength
          Real input blank (file or stream) length.
static int REPORT_FOOTER
          Number of 'REPORT FOOTER' section.
static int REPORT_HEADER
          Number of 'REPORT HEADER' section.
protected  java.io.OutputStream reportOutStream
          Report output stream.
static int REQUEST_DATA_BY_NAME_SYMBOL
          Default symbol for data request by name.
static int REQUEST_DATA_BY_NUM_SYMBOL
          Default symbol for data request by number.
protected  VKRepEvent rptEvent
          This is Event object that pass to all Event handlers.
static int RTF_SECTION_BEGIN_BREAKED
          Used for RTF report.
static int RTF_SECTION_END_BREAKED
          Used for RTF report.
protected  TReportAbstract.TSection[] sections
          Array of TSection object.
static int STREAM_BUFFER_SIZE
          VK Reports generator load input blank to the memory.
protected  int streamBufferSize
          Size of inputBuffer and outputBuffer.
static int SUBGROUP_FOOTER
          Number of 'SUBGROUP FOOTER' section.
static int SUBGROUP_HEADER
          Number of 'SUBGROUP HEADER' section.
static int SUBSUBGROUP_FOOTER
          Number of 'SUBSUBGROUP FOOTER' section.
static int SUBSUBGROUP_HEADER
          Number of 'SUBSUBGROUP HEADER' section.
static int SUPERSUBGROUP_FOOTER
          Number of 'SUPERSUBGROUP FOOTER' section.
static int SUPERSUBGROUP_HEADER
          Number of 'SUPERSUBGROUP HEADER' section.
private  java.util.Vector VKRepListeners
          Array with objects which implemented VKRepListener interface and connected to TReportAbstract object.
protected  short[] XLSBlank
          Null (or blank) XLS4 BIFF record.
protected  short[] XLSBool
          Boolean XLS4 BIFF record.
protected  short[] XLSCOL
          Column XLS4 BIFF record.
protected  short[] XLSDimension
          Dimantion XLS4 BIFF record.
protected  short[] XLSLabel
          Label XLS4 BIFF record.
protected  short[] XLSNumber
          Float number XLS4 BIFF record.
protected  short[] XLSRK
          RK XLS4 BIFF record.
protected  short[] XLSRow
          Row XLS4 BIFF record.
 
Constructor Summary
TReportAbstract()
          Constructor.
 
Method Summary
 void addVKRepListener(VKRepListener l)
          Add listener in standard Java event system.
static java.lang.Object ass2Number(int j)
          Convert value from XLS4 RC format to number (Integer or Double).
protected  short byteAsShort(byte b)
          Convert byte to short.
protected  void clearSections()
          Initialize array of sections.
protected  void clearVars()
          Virtual auxiliary method.
 void closeInputStream()
          Close input stream.
protected  void closeOutBuffer()
          Close output buffer.
 void closeOutputStream()
          Close output stream.
 void doDataRequest(VKRepEvent e)
          This public method only invoke TReportAbstract.fireDataRequest(VKRepEvent e).
 void doEndReport(VKRepEvent e)
          This public method only invoke TReportAbstract.fireEndReport(VKRepEvent e).
 void doMoveNext(VKRepEvent e)
          This public method only invoke TReportAbstract.fireMoveNext(VKRepEvent e).
 void doMoveTop(VKRepEvent e)
          This public method only invoke TReportAbstract.fireMoveTop(VKRepEvent e).
 void doReportError(VKRepEvent e)
          This public method only invoke TReportAbstract.fireReportError(VKRepEvent e).
 void doRequestByName(VKRepEvent e)
          This public method only invoke TReportAbstract.fireRequestByName(VKRepEvent e).
 void doRequestByNum(VKRepEvent e)
          This public method only invoke TReportAbstract.fireRequestByNum(VKRepEvent e).
 void doSectionBegin(VKRepEvent e)
          This public method only invoke TReportAbstract.fireSectionBegin(VKRepEvent e).
 void doSectionCheck(VKRepEvent e)
          This public method only invoke TReportAbstract.fireSectionCheck(VKRepEvent e).
 void doSectionComplete(VKRepEvent e)
          This public method only invoke TReportAbstract.fireSectionComplete(VKRepEvent e).
 void doSectionEnd(VKRepEvent e)
          This public method only invoke TReportAbstract.fireSectionEnd(VKRepEvent e).
 void doSectionPrepare(VKRepEvent e)
          This public method only invoke TReportAbstract.fireSectionPrepare(VKRepEvent e).
 void doStartReport(VKRepEvent e)
          This public method only invoke TReportAbstract.fireStartReport(VKRepEvent e).
 void execute()
          Method execute start process of build report.
static double exp2(int x)
          2 power by x.
protected  void fireDataRequest(VKRepEvent e)
          Data request report event.
protected  void fireEndReport(VKRepEvent e)
          End report event.
protected  void fireMoveNext(VKRepEvent e)
          Move next row of data source for report event.
protected  void fireMoveTop(VKRepEvent e)
          Move top data source for report event.
protected  void fireReportError(VKRepEvent e)
          Report error event.
protected  void fireRequestByName(VKRepEvent e)
          Data request by name report event.
protected  void fireRequestByNum(VKRepEvent e)
          Data request by number report event.
protected  void fireSectionBegin(VKRepEvent e)
          Section begin report event.
protected  void fireSectionCheck(VKRepEvent e)
          Section check report event.
protected  void fireSectionComplete(VKRepEvent e)
          Section complete report event.
protected  void fireSectionEnd(VKRepEvent e)
          Section end report event.
protected  void fireSectionPrepare(VKRepEvent e)
          Section prepare report event.
protected  void fireStartReport(VKRepEvent e)
          Start report event.
protected  void flushOutBuffer()
          Write full output buffer to output stream and set outputBufferCount to zerro.
 java.io.InputStream getBlankInputStream()
          Access method by read of blankInputStream property.
protected  void getBytes(byte[] b)
          Read bytes from input blank (stream).
 byte getCharByName()
          Access method by read of charByName property.
 byte getCharByNum()
          Access method by read of charByNum property.
 java.lang.String getInputBlank()
          Access method by read of inputBlank (blank file name) property.
protected  int getInt(byte[] b, int pos)
          Read int value from byte array b with position pos.
 VKRepListener getListener()
          Property method by read of listener object.
protected  long getLong(byte[] b, int pos)
          Read long value from byte array b with position pos.
 java.lang.String getOutputReport()
          Access method by read of outputReport (output report file name) property.
 java.io.OutputStream getReportOutStream()
          Access method by read of reportOutStream property.
protected  short getShort()
          Read short value from input blank (stream).
protected  short getShort(byte[] b, int pos)
          Read short value from byte array b with position pos.
 int getStreamBufferSize()
          Access method by read of streamBufferSize property.
static boolean isInt(int p)
          Determine is XLS4 RC cell content Integer or Double.
 boolean openInputStream()
          Open input stream.
 boolean openOutputStream()
          Open output stream.
protected  void outByte(byte byteForOut)
          Out byte to the output stream.
protected  void outBytes(byte[] bytesForOut)
          Out byte array to the output stream.
protected  void outBytes(byte[] bytesForOut, int offset, int len)
          Out piece byte array to the output stream.
protected  void outDouble(java.lang.Double doubleForOut)
          Out Double value to the output stream.
protected  void outInteger(int intForOut)
          Out integer value to the output stream.
 void outSection(int SectionNum)
          Out report section to the output report (file or stream) by the number of section.
 void outSection(java.lang.String SectionName)
          Out report section to the output report (file or stream) by the name of section.
protected abstract  void outSectionInternal(int SectionNum, boolean defaultOut)
          Abstract method for override in inheritance classes for output report section.
protected  void outShort(short shortForOut)
          Out Short value to the output stream.
protected  void outShorts(short[] shortsForOut)
          Out Short array value to the output stream.
protected  void outSpecial()
          Virtual auxiliary method.
protected  void outVariant(TReportAbstract.TBiffRec pp, int row, int col)
          Out in output stream BIFF record with any value depends of rptEvent object.
protected  void outXLSDouble(java.lang.Double value, short cellFormat, int row, int col)
          Out in output stream XLS4 Double BIFF record.
protected abstract  boolean prepareFileFooter()
          Abstract method for override in inheritance classes for parse file footer section.
protected abstract  boolean prepareFileHeader()
          Abstract method for override in inheritance classes for parse file header section.
 int prepareSection(java.lang.String SectionName)
          When you define your own section, you describe it in input blank.
protected abstract  int prepareSectionInternal(java.lang.String SectionName, int SectionNum)
          Abstract method for override in inheritance classes for parse report section.
private  void readObject(java.io.ObjectInputStream ois)
          Implements Serializable interface.
static java.lang.String removeAllBlanks(java.lang.String inStr)
          Removs all blanks from the string.
 void removeVKRepListener(VKRepListener l)
          Remove listener in standard Java event system.
 void run()
          Implements runable interface, call execute() method in Thread.
 void setBlankInputStream(java.io.InputStream blankInputStream)
          Access method by write of blankInputStream property.
 void setCharByName(byte charByName)
          Access method by write of charByName property.
 void setCharByNum(byte charByNum)
          Access method by write of charByNum property.
 void setInputBlank(java.lang.String inputBlank)
          Access method by write of inputBlank (blank file name) property.
 void setListener(VKRepListener lster)
          Property method by write of listener object.
 void setOutputReport(java.lang.String outputReport)
          Access method by write of outputReport (output report file name) property.
 void setReportOutStream(java.io.OutputStream reportOutStream)
          Access method by write of reportOutStream property.
protected  void setShort(byte[] b, int pos, short value)
          Write short value to byte array b with position pos.
 void setStreamBufferSize(int newStreamBufferSize)
          Access method by write of streamBufferSize property.
private  void writeObject(java.io.ObjectOutputStream oos)
          Implements Serializable interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILE_HEADER

public static final int FILE_HEADER
Number of 'FILE HEADER' section.

See Also:
Constant Field Values

REPORT_HEADER

public static final int REPORT_HEADER
Number of 'REPORT HEADER' section.

See Also:
Constant Field Values

GROUP_HEADER

public static final int GROUP_HEADER
Number of 'GROUP HEADER' section.

See Also:
Constant Field Values

SUBGROUP_HEADER

public static final int SUBGROUP_HEADER
Number of 'SUBGROUP HEADER' section.

See Also:
Constant Field Values

SUBSUBGROUP_HEADER

public static final int SUBSUBGROUP_HEADER
Number of 'SUBSUBGROUP HEADER' section.

See Also:
Constant Field Values

SUPERSUBGROUP_HEADER

public static final int SUPERSUBGROUP_HEADER
Number of 'SUPERSUBGROUP HEADER' section.

See Also:
Constant Field Values

BODY

public static final int BODY
Number of 'BODY' section.

See Also:
Constant Field Values

SUPERSUBGROUP_FOOTER

public static final int SUPERSUBGROUP_FOOTER
Number of 'SUPERSUBGROUP FOOTER' section.

See Also:
Constant Field Values

SUBSUBGROUP_FOOTER

public static final int SUBSUBGROUP_FOOTER
Number of 'SUBSUBGROUP FOOTER' section.

See Also:
Constant Field Values

SUBGROUP_FOOTER

public static final int SUBGROUP_FOOTER
Number of 'SUBGROUP FOOTER' section.

See Also:
Constant Field Values

GROUP_FOOTER

public static final int GROUP_FOOTER
Number of 'GROUP FOOTER' section.

See Also:
Constant Field Values

REPORT_FOOTER

public static final int REPORT_FOOTER
Number of 'REPORT FOOTER' section.

See Also:
Constant Field Values

FILE_FOOTER

public static final int FILE_FOOTER
Number of 'FILE FOOTER' section.

See Also:
Constant Field Values

LAST_DYN_SECTION

public static final int LAST_DYN_SECTION
The number which is begining of your own section definition.

See Also:
Constant Field Values

MAX_SECTION_NUM

public static final int MAX_SECTION_NUM
Maximum number of sections.

See Also:
Constant Field Values

REQUEST_DATA_BY_NUM_SYMBOL

public static final int REQUEST_DATA_BY_NUM_SYMBOL
Default symbol for data request by number. In an input blank (stream) you can define mark request data by number like that: &0001, &0002... or @0001, @0002. The symbol '&' or '@' is symbol request data by number. The number after this symbol must be 4 digits. This number pass to the RequestByNum event in VKRepEvent object and you should return with this object the real data for report. Symbol '&' use in XLS4 reports and '@' in TXT, HTML, RTF reports.

See Also:
Constant Field Values

REQUEST_DATA_BY_NAME_SYMBOL

public static final int REQUEST_DATA_BY_NAME_SYMBOL
Default symbol for data request by name. In an input blank (stream) you can define mark request data by name like that: ~Name1~, ~Name2~... The symbol '~' is symbol request data by name. This Data Name closed this symbol pass to the RequestByName event in VKRepEvent object and you should return with this object the real data for report.

See Also:
Constant Field Values

RTF_SECTION_BEGIN_BREAKED

public static final int RTF_SECTION_BEGIN_BREAKED
Used for RTF report. Define begin RTF section breaked.

See Also:
Constant Field Values

RTF_SECTION_END_BREAKED

public static final int RTF_SECTION_END_BREAKED
Used for RTF report. Define end RTF section breaked.

See Also:
Constant Field Values

MAX_LABEL_NAME_LEGTH

public static final int MAX_LABEL_NAME_LEGTH
Maximum length of Data Name for request by name.

See Also:
Constant Field Values

STREAM_BUFFER_SIZE

public static final int STREAM_BUFFER_SIZE
VK Reports generator load input blank to the memory. STREAM_BUFFER_SIZE is the maximun size of this memory. It meens that you input blank (stream) must be less then STREAM_BUFFER_SIZE constant.

See Also:
Constant Field Values

VKRepListeners

private transient java.util.Vector VKRepListeners
Array with objects which implemented VKRepListener interface and connected to TReportAbstract object. This field is standard part of java event system. Work if listener field is not null.

See Also:
TReportAbstract.listener

listener

protected VKRepListener listener
Object which implements VKRepListener interface. It the same VKRepListeners array field, but it is not an array and if listener != null TReportAbstract prefer listener field instead of VKRepListeners field.

See Also:
TReportAbstract.VKRepListeners

sections

protected TReportAbstract.TSection[] sections
Array of TSection object. The maximum objects in this array defines MAX_SECTION_NUM constant.

See Also:
TReportAbstract.MAX_SECTION_NUM

lastDynSection

protected int lastDynSection
This variable hold last number dynamic user define section.


outputBufferCount

protected int outputBufferCount
Counter for output buffer.


charByName

protected byte charByName
Variable charByName hold symbol for data request by name.

See Also:
TReportAbstract.REQUEST_DATA_BY_NAME_SYMBOL

charByNum

protected byte charByNum
Variable charByName hold symbol for data request by num.

See Also:
TReportAbstract.REQUEST_DATA_BY_NUM_SYMBOL

inputBlank

protected java.lang.String inputBlank
File name for input blank. Used if blankInputStream is null.

See Also:
TReportAbstract.blankInputStream

outputReport

protected java.lang.String outputReport
File name for output report. Used if reportOutStream is null.

See Also:
TReportAbstract.reportOutStream

streamBufferSize

protected int streamBufferSize
Size of inputBuffer and outputBuffer. When invoke an execute() method VK Reports allocate two buffers. One for input (inputBuffer) and other is for output (outputBuffer). The size of both is streamBufferSize by default is STREAM_BUFFER_SIZE. Input buffer fill full input blank from inputBlank file or blankInputStream stream (prefer blankInputStream if not is null). Output buffer fill gradually (with incremented outputBufferCount variable) and flush to the output file (outputReport) or output stream (reportOutStream) (prefer reportOutStream if not is null) when the output buffer is full.

See Also:
TReportAbstract.inputBuffer, TReportAbstract.outputBuffer, TReportAbstract.STREAM_BUFFER_SIZE, TReportAbstract.inputBlank, TReportAbstract.outputReport, TReportAbstract.blankInputStream, TReportAbstract.reportOutStream, TReportAbstract.outputBufferCount, TReportAbstract.execute()

inputBuffer

protected byte[] inputBuffer
Input buffer. Input blank (file or stream) must be less then STREAM_BUFFER_SIZE.

See Also:
TReportAbstract.STREAM_BUFFER_SIZE, TReportAbstract.inputBlank, TReportAbstract.outputReport, TReportAbstract.blankInputStream, TReportAbstract.reportOutStream, TReportAbstract.outputBufferCount, TReportAbstract.streamBufferSize

outputBuffer

protected byte[] outputBuffer
Output buffer. Output buffer fill gradually (with incremented outputBufferCount variable) and flush to the output file (outputReport) or output stream (reportOutStream) (prefer reportOutStream if not is null) when the output buffer is full.

See Also:
TReportAbstract.STREAM_BUFFER_SIZE, TReportAbstract.inputBlank, TReportAbstract.outputReport, TReportAbstract.blankInputStream, TReportAbstract.reportOutStream, TReportAbstract.outputBufferCount, TReportAbstract.streamBufferSize

realInputBlankLength

protected int realInputBlankLength
Real input blank (file or stream) length. Fill after the input blank load to the input buffer inputBuffer. realInputBlankLength must be less then STREAM_BUFFER_SIZE constant.

See Also:
TReportAbstract.STREAM_BUFFER_SIZE, TReportAbstract.inputBlank, TReportAbstract.outputReport, TReportAbstract.blankInputStream, TReportAbstract.reportOutStream, TReportAbstract.outputBufferCount, TReportAbstract.streamBufferSize

blankInputStream

protected java.io.InputStream blankInputStream
Blank input stream. If defined then prefer blankInputStream instead of inputBlank file name for source blank.

See Also:
TReportAbstract.inputBuffer, TReportAbstract.outputBuffer, TReportAbstract.STREAM_BUFFER_SIZE, TReportAbstract.inputBlank, TReportAbstract.outputReport, TReportAbstract.reportOutStream, TReportAbstract.outputBufferCount

reportOutStream

protected java.io.OutputStream reportOutStream
Report output stream. If defined then prefer reportOutStream instead of outputReport file name for result report.

See Also:
TReportAbstract.inputBuffer, TReportAbstract.outputBuffer, TReportAbstract.STREAM_BUFFER_SIZE, TReportAbstract.inputBlank, TReportAbstract.outputReport, TReportAbstract.blankInputStream, TReportAbstract.outputBufferCount

rptEvent

protected VKRepEvent rptEvent
This is Event object that pass to all Event handlers.


offsetXLSInput

protected int offsetXLSInput
It is work variable input XLS4 file counter. For read information from XLS4 input stream.


BOutStreamA

protected TReportAbstract.BOutStream BOutStreamA
Horisontal XLS4 report consist of two parts. This pats merge in output stream in end work. BOutStreamA is first of this part.

See Also:
TReportAbstract.BOutStreamB

BOutStreamB

protected TReportAbstract.BOutStream BOutStreamB
Horisontal XLS4 report consist of two parts. This pats merge in output stream in end work. BOutStreamB is second of this part.

See Also:
TReportAbstract.BOutStreamA

outCase

protected int outCase
Horisontal XLS4 report consist of two parts. First part BOutStreamA, the second BOutStreamB. The variable outCase define in which stream in that moment will be out of output report.


XLSDimension

protected short[] XLSDimension
Dimantion XLS4 BIFF record.


XLSCOL

protected short[] XLSCOL
Column XLS4 BIFF record.


XLSRow

protected short[] XLSRow
Row XLS4 BIFF record.


XLSBlank

protected short[] XLSBlank
Null (or blank) XLS4 BIFF record.


XLSRK

protected short[] XLSRK
RK XLS4 BIFF record. This is intricate BIFF record with integer or float number.


XLSNumber

protected short[] XLSNumber
Float number XLS4 BIFF record.


XLSLabel

protected short[] XLSLabel
Label XLS4 BIFF record.


XLSBool

protected short[] XLSBool
Boolean XLS4 BIFF record.

Constructor Detail

TReportAbstract

public TReportAbstract()
Constructor. Initialise object.

Method Detail

writeObject

private void writeObject(java.io.ObjectOutputStream oos)
                  throws java.io.IOException
Implements Serializable interface.

Parameters:
oos -
Throws:
java.io.IOException

readObject

private void readObject(java.io.ObjectInputStream ois)
                 throws java.lang.ClassNotFoundException,
                        java.io.IOException
Implements Serializable interface.

Parameters:
ois -
Throws:
java.lang.ClassNotFoundException
java.io.IOException

addVKRepListener

public void addVKRepListener(VKRepListener l)
Add listener in standard Java event system.

Parameters:
l - object which inmplements VKRepListener interface.
See Also:
VKRepListener interface, TReportAbstract.listener

removeVKRepListener

public void removeVKRepListener(VKRepListener l)
Remove listener in standard Java event system.

Parameters:
l - object which inmplements VKRepListener interface.
See Also:
VKRepListener interface, TReportAbstract.listener

getListener

public VKRepListener getListener()
Property method by read of listener object.

Returns:
listener object field.
See Also:
TReportAbstract.listener

setListener

public void setListener(VKRepListener lster)
Property method by write of listener object.

Parameters:
lster - The new value of listener object field.
See Also:
TReportAbstract.listener

fireStartReport

protected void fireStartReport(VKRepEvent e)
Start report event. This event fire when report is start. When listener object is not null invoke his startReport mothod. If not, switch on standard Java fire event throw VKRepListeners variable. In income VKRepEvent object impotant field: nothing There is no to set in income VKRepEvent object.

Parameters:
e - VKRepEvent event object.
See Also:
TReportAbstract.listener, TReportAbstract.VKRepListeners

doStartReport

public void doStartReport(VKRepEvent e)
This public method only invoke TReportAbstract.fireStartReport(VKRepEvent e). You can override this method in descendant classes and handle this event in you method.

Parameters:
e - VKRepEvent event object.
See Also:
TReportAbstract.fireStartReport(VKRepEvent e)

fireEndReport

protected void fireEndReport(VKRepEvent e)
End report event. This event fire when report is end. When listener object is not null invoke his endReport mothod. If not, switch on standard Java fire event throw VKRepListeners variable. In income VKRepEvent object impotant field: nothing There is no to set in income VKRepEvent object.

Parameters:
e - VKRepEvent event object.
See Also:
TReportAbstract.listener, TReportAbstract.VKRepListeners

doEndReport

public void doEndReport(VKRepEvent e)
This public method only invoke TReportAbstract.fireEndReport(VKRepEvent e). You can override this method in descendant classes and handle this event in you method.

Parameters:
e - VKRepEvent event object.
See Also:
TReportAbstract.fireEndReport(VKRepEvent e)

fireReportError

protected void fireReportError(VKRepEvent e)
Report error event. This event fire when error occured during report build process. When listener object is not null invoke his reportError mothod. If not, switch on standard Java fire event throw VKRepListeners variable. In income VKRepEvent object impotant field: There is no to set in income VKRepEvent object.

Parameters:
e - VKRepEvent event object.
See Also:
TReportAbstract.listener, TReportAbstract.VKRepListeners

doReportError

public void doReportError(VKRepEvent e)
This public method only invoke TReportAbstract.fireReportError(VKRepEvent e). You can override this method in descendant classes and handle this event in you method.

Parameters:
e - VKRepEvent event object.
See Also:
TReportAbstract.fireReportError(VKRepEvent e)

fireMoveTop

protected void fireMoveTop(VKRepEvent e)
Move top data source for report event. This event fire when report build process try to move data source for report to the top. When listener object is not null invoke his fireMoveTop mothod. If not, switch on standard Java fire event throw VKRepListeners variable. In income VKRepEvent object impotant field: You should set in income VKRepEvent object eof variable to determinate achieve end of data source for report.

Parameters:
e - VKRepEvent event object.
See Also:
TReportAbstract.listener, TReportAbstract.VKRepListeners

doMoveTop

public void doMoveTop(VKRepEvent e)
This public method only invoke TReportAbstract.fireMoveTop(VKRepEvent e). You can override this method in descendant classes and handle this event in you method.

Parameters:
e - VKRepEvent event object.
See Also:
TReportAbstract.fireMoveTop(VKRepEvent e)

fireMoveNext

protected void fireMoveNext(VKRepEvent e)
Move next row of data source for report event. This event fire when report build process try to move current row of data source for report to the next row. When listener object is not null invoke his fireMoveNext mothod. If not, switch on standard Java fire event throw VKRepListeners variable. In income VKRepEvent object impotant field: You should set in income VKRepEvent object eof variable to determinate achieve end of data source for report.

Parameters:
e - VKRepEvent event object.
See Also:
TReportAbstract.listener, TReportAbstract.VKRepListeners

doMoveNext

public void doMoveNext(VKRepEvent e)
This public method only invoke TReportAbstract.fireMoveNext(VKRepEvent e). You can override this method in descendant classes and handle this event in you method.

Parameters:
e - VKRepEvent event object.
See Also:
TReportAbstract.fireMoveNext(VKRepEvent e)

fireSectionBegin

protected void fireSectionBegin(VKRepEvent e)
Section begin report event. This event fire when report build process try to copy report section to the output stream. When listener object is not null invoke his fireSectionBegin mothod. If not, switch on standard Java fire event throw VKRepListeners variable. In income VKRepEvent object impotant field: This event only notify main proccess that report process try to copy report section to the output stream and you should not to set any field in VKRepEvent object.

Parameters:
e - VKRepEvent event object.
See Also:
TReportAbstract.listener, TReportAbstract.VKRepListeners, TReportAbstract.fireSectionBegin(VKRepEvent e), TReportAbstract.fireSectionCheck(VKRepEvent e), TReportAbstract.fireSectionComplete(VKRepEvent e), TReportAbstract.fireSectionEnd(VKRepEvent e)

doSectionBegin

public void doSectionBegin(VKRepEvent e)
This public method only invoke TReportAbstract.fireSectionBegin(VKRepEvent e). You can override this method in descendant classes and handle this event in you method.

Parameters:
e - VKRepEvent event object.
See Also:
TReportAbstract.fireSectionBegin(VKRepEvent e)

fireSectionEnd

protected void fireSectionEnd(VKRepEvent e)
Section end report event. This event fire when report build process end to copy report section to the output stream. This event trigger always, independently it was copy report section to the output stream or not. When listener object is not null invoke his fireSectionEnd mothod. If not, switch on standard Java fire event throw VKRepListeners variable. In income VKRepEvent object impotant field: This event only notify main proccess that report process end to copy report section to the output stream and you should not to set any field in VKRepEvent object.

Parameters:
e - VKRepEvent event object.
See Also:
TReportAbstract.listener, TReportAbstract.VKRepListeners, TReportAbstract.fireSectionBegin(VKRepEvent e), TReportAbstract.fireSectionCheck(VKRepEvent e), TReportAbstract.fireSectionComplete(VKRepEvent e), TReportAbstract.fireSectionEnd(VKRepEvent e)

doSectionEnd

public void doSectionEnd(VKRepEvent e)
This public method only invoke TReportAbstract.fireSectionEnd(VKRepEvent e). You can override this method in descendant classes and handle this event in you method.

Parameters:
e - VKRepEvent event object.
See Also:
TReportAbstract.fireSectionEnd(VKRepEvent e)

fireSectionComplete

protected void fireSectionComplete(VKRepEvent e)
Section complete report event. This event fire when report build process complete to copy report section to the output stream. This event trigger only if report section was realy copy to the output stream. When listener object is not null invoke his fireSectionComplete mothod. If not, switch on standard Java fire event throw VKRepListeners variable. In income VKRepEvent object impotant field: This event only notify main proccess that report process complete to copy report section to the output stream and you should not to set any field in VKRepEvent object.

Parameters:
e - VKRepEvent event object.
See Also:
TReportAbstract.listener, TReportAbstract.VKRepListeners, TReportAbstract.fireSectionBegin(VKRepEvent e), TReportAbstract.fireSectionCheck(VKRepEvent e), TReportAbstract.fireSectionComplete(VKRepEvent e), TReportAbstract.fireSectionEnd(VKRepEvent e)

doSectionComplete

public void doSectionComplete(VKRepEvent e)
This public method only invoke TReportAbstract.fireSectionComplete(VKRepEvent e). You can override this method in descendant classes and handle this event in you method.

Parameters:
e - VKRepEvent event object.
See Also:
TReportAbstract.fireSectionComplete(VKRepEvent e)

fireSectionCheck

protected void fireSectionCheck(VKRepEvent e)
Section check report event. This event fire when report build process try to copy report section to the output stream and wants to know it will be realy need to copy or not. When listener object is not null invoke his fireSectionCheck mothod. If not, switch on standard Java fire event throw VKRepListeners variable. In income VKRepEvent object impotant field: When you catch this event you should to set VKRepEvent.check field to true if you want to copy report section in present time or false if not.

Parameters:
e - VKRepEvent event object.
See Also:
TReportAbstract.listener, TReportAbstract.VKRepListeners, TReportAbstract.fireSectionBegin(VKRepEvent e), TReportAbstract.fireSectionCheck(VKRepEvent e), TReportAbstract.fireSectionComplete(VKRepEvent e), TReportAbstract.fireSectionEnd(VKRepEvent e)

doSectionCheck

public void doSectionCheck(VKRepEvent e)
This public method only invoke TReportAbstract.fireSectionCheck(VKRepEvent e). You can override this method in descendant classes and handle this event in you method.

Parameters:
e - VKRepEvent event object.
See Also:
TReportAbstract.fireSectionCheck(VKRepEvent e)

fireDataRequest

protected void fireDataRequest(VKRepEvent e)

Data request report event.

This event fire when report build process need a data for report. Generaly data request event used in grid based reports like a XLS4 report (TXLS4ReportVertical, TXLS4ReportHorizontal). For this type reports data request event query data for a cells of grid. For a text based reports (txt, html, rtf - TWordReport) this event not used.

When listener object is not null invoke his fireDataRequest mothod. If not, switch on standard Java fire event throw VKRepListeners variable.

In income VKRepEvent object impotant field:

In respond of this event you should fill data for out and set check to true (check = true let knows VK Reports that you want to fill cell with a new value) and fill dataOutput field or outData/outDataLen pair. If you want to clear output cell (assign to null) you should set dataOutput = null and outDataLen = 0. The String and any binary data much better to pass into output report with outData/outDataLen pair. In Excel 4 maximum length of cell is 255 bytes. The maximum length of outData array define in VKRepEvent class. If dataOutput != null and outDataLen != 0 then VK Reports prefer dataOutput field.

Parameters:
e - VKRepEvent event object.
See Also:
TReportAbstract.fireRequestByName(VKRepEvent e), TReportAbstract.fireRequestByNum(VKRepEvent e)

doDataRequest

public void doDataRequest(VKRepEvent e)
This public method only invoke TReportAbstract.fireDataRequest(VKRepEvent e). You can override this method in descendant classes and handle this event in you method.

Parameters:
e - VKRepEvent event object.
See Also:
TReportAbstract.fireDataRequest(VKRepEvent e)

fireRequestByName

protected void fireRequestByName(VKRepEvent e)

Data request by name report event.

This event fire when report build process need a data for report. Data request event by name used in grid based reports like a XLS4 report (TXLS4ReportVertical, TXLS4ReportHorizontal). For this type reports data request event query data for a part of cells of grid.

And used for a text based reports (txt, html, rtf - TWordReport).

When listener object is not null invoke his fireDataRequest mothod. If not, switch on standard Java fire event throw VKRepListeners variable.

In income VKRepEvent object impotant field:

In respond of this event you should fill outData/outDataLen pair. If you want to clear output data (assign to null) you should set outDataLen = 0. The maximum length of outData array define in VKRepEvent class.

Parameters:
e - VKRepEvent event object.
See Also:
TReportAbstract.fireDataRequest(VKRepEvent e), TReportAbstract.fireRequestByNum(VKRepEvent e)

doRequestByName

public void doRequestByName(VKRepEvent e)
This public method only invoke TReportAbstract.fireRequestByName(VKRepEvent e). You can override this method in descendant classes and handle this event in you method.

Parameters:
e - VKRepEvent event object.
See Also:
TReportAbstract.fireRequestByName(VKRepEvent e)

fireRequestByNum

protected void fireRequestByNum(VKRepEvent e)

Data request by number report event.

This event fire when report build process need a data for report. Data request event by number used in grid based reports like a XLS4 report (TXLS4ReportVertical, TXLS4ReportHorizontal). For this type reports data request event query data for a part of cells of grid.

And used for a text based reports (txt, html, rtf - TWordReport).

When listener object is not null invoke his fireDataRequest mothod. If not, switch on standard Java fire event throw VKRepListeners variable.

In income VKRepEvent object impotant field:

In respond of this event you should fill outData/outDataLen pair. If you want to clear output data (assign to null) you should set outDataLen = 0. The maximum length of outData array define in VKRepEvent class.

Parameters:
e - VKRepEvent event object.
See Also:
TReportAbstract.fireDataRequest(VKRepEvent e), TReportAbstract.fireRequestByName(VKRepEvent e)

doRequestByNum

public void doRequestByNum(VKRepEvent e)
This public method only invoke TReportAbstract.fireRequestByNum(VKRepEvent e). You can override this method in descendant classes and handle this event in you method.

Parameters:
e - VKRepEvent event object.
See Also:
TReportAbstract.fireRequestByNum(VKRepEvent e)

fireSectionPrepare

protected void fireSectionPrepare(VKRepEvent e)

Section prepare report event.

This event fire when report build process has made parse input blank(stream) and need to know would you like to define your own sections extra of 13 standards. You can define them to invoke prepareSection(String SectionName) method with supply it your own section name which you describe in input blank (stream).

When listener object is not null invoke his fireSectionPrepare mothod. If not, switch on standard Java fire event throw VKRepListeners variable.

In income VKRepEvent object there is no impotant field for this event.

Parameters:
e - VKRepEvent event object.
See Also:
TReportAbstract.prepareSection(String SectionName)

doSectionPrepare

public void doSectionPrepare(VKRepEvent e)
This public method only invoke TReportAbstract.fireSectionPrepare(VKRepEvent e). You can override this method in descendant classes and handle this event in you method.

Parameters:
e - VKRepEvent event object.
See Also:
TReportAbstract.fireSectionPrepare(VKRepEvent e)

outSection

public void outSection(java.lang.String SectionName)
Out report section to the output report (file or stream) by the name of section. You can use this method when you define your own order sections in your report instead of standard order. You can out any section (including your own, prepared in SectionPrepare event or method) in any time.

Parameters:
SectionName - Section Name
See Also:
TReportAbstract.fireSectionPrepare(VKRepEvent e), TReportAbstract.doSectionPrepare(VKRepEvent e), TReportAbstract.outSection(int)

outSection

public void outSection(int SectionNum)
Out report section to the output report (file or stream) by the number of section. You can use this method when you define your own order sections in your report instead of standard order. You can out any section (including your own, prepared in SectionPrepare event or method) in any time.

Parameters:
SectionNum - Number of section
See Also:
TReportAbstract.fireSectionPrepare(VKRepEvent e), TReportAbstract.doSectionPrepare(VKRepEvent e), TReportAbstract.outSection(java.lang.String)

execute

public void execute()
Method execute start process of build report.


run

public void run()
Implements runable interface, call execute() method in Thread.

Specified by:
run in interface java.lang.Runnable
See Also:
TReportAbstract.execute()

getBlankInputStream

public java.io.InputStream getBlankInputStream()
Access method by read of blankInputStream property.

Returns:
Value of blankInputStream property.
See Also:
TReportAbstract.blankInputStream

setBlankInputStream

public void setBlankInputStream(java.io.InputStream blankInputStream)
Access method by write of blankInputStream property.

Parameters:
blankInputStream - Input stream of blank report.
See Also:
TReportAbstract.blankInputStream

getReportOutStream

public java.io.OutputStream getReportOutStream()
Access method by read of reportOutStream property.

Returns:
Value of reportOutStream property.
See Also:
TReportAbstract.reportOutStream

setReportOutStream

public void setReportOutStream(java.io.OutputStream reportOutStream)
Access method by write of reportOutStream property.

Parameters:
reportOutStream - Output stream for result report.
See Also:
TReportAbstract.reportOutStream

clearSections

protected void clearSections()
Initialize array of sections.


clearVars

protected void clearVars()
Virtual auxiliary method.


getStreamBufferSize

public int getStreamBufferSize()
Access method by read of streamBufferSize property.

Returns:
Value of streamBufferSize property.
See Also:
TReportAbstract.streamBufferSize

setStreamBufferSize

public void setStreamBufferSize(int newStreamBufferSize)
Access method by write of streamBufferSize property.

Parameters:
newStreamBufferSize - New value of streamBufferSize property.
See Also:
TReportAbstract.streamBufferSize

getCharByName

public byte getCharByName()
Access method by read of charByName property.

Returns:
Value of charByName property.
See Also:
TReportAbstract.charByName

setCharByName

public void setCharByName(byte charByName)
Access method by write of charByName property.

Parameters:
charByName - New value of charByName property.
See Also:
TReportAbstract.charByName

getCharByNum

public byte getCharByNum()
Access method by read of charByNum property.

Returns:
Value of charByNum property.
See Also:
TReportAbstract.charByNum

setCharByNum

public void setCharByNum(byte charByNum)
Access method by write of charByNum property.

Parameters:
charByNum - New value of charByNum property.
See Also:
TReportAbstract.charByNum

getInputBlank

public java.lang.String getInputBlank()
Access method by read of inputBlank (blank file name) property.

Returns:
Value of inputBlank (blank file name) property.
See Also:
TReportAbstract.inputBlank

setInputBlank

public void setInputBlank(java.lang.String inputBlank)
Access method by write of inputBlank (blank file name) property.

Parameters:
inputBlank - New value of inputBlank (blank file name) property.
See Also:
TReportAbstract.inputBlank

getOutputReport

public java.lang.String getOutputReport()
Access method by read of outputReport (output report file name) property.

Returns:
Value of outputReport (output report file name) property.
See Also:
TReportAbstract.outputReport

setOutputReport

public void setOutputReport(java.lang.String outputReport)
Access method by write of outputReport (output report file name) property.

Parameters:
outputReport - New value of outputReport (output report file name) property.
See Also:
TReportAbstract.outputReport

prepareSection

public int prepareSection(java.lang.String SectionName)
When you define your own section, you describe it in input blank. Then, in doSectionPrepare method or in fireSectionPrepare event you should call prepareSection method for parse section for further output.

Parameters:
SectionName - Your own section name for prepare.
Returns:
new section number (greater then last section number) and increment the last section number.

flushOutBuffer

protected void flushOutBuffer()
Write full output buffer to output stream and set outputBufferCount to zerro.


closeOutBuffer

protected void closeOutBuffer()
Close output buffer. Flow together two auxiliary streams used in XLS4 horisontal report and flush output stream.


outXLSDouble

protected void outXLSDouble(java.lang.Double value,
                            short cellFormat,
                            int row,
                            int col)
Out in output stream XLS4 Double BIFF record.

Parameters:
value - Double value for output.
cellFormat - reference to the cell format.
row - row of cell.
col - column for cell.

outVariant

protected void outVariant(TReportAbstract.TBiffRec pp,
                          int row,
                          int col)
Out in output stream BIFF record with any value depends of rptEvent object.

Parameters:
pp - BIFF record from input blank.
row - row of cell.
col - column for cell.

getBytes

protected void getBytes(byte[] b)
Read bytes from input blank (stream).

Parameters:
b -

getShort

protected short getShort()
Read short value from input blank (stream).

Returns:
short value from input blank (stream).

getLong

protected long getLong(byte[] b,
                       int pos)
Read long value from byte array b with position pos.

Parameters:
b - array of bytes for read.
pos - position to read with.
Returns:
Long value.

getInt

protected int getInt(byte[] b,
                     int pos)
Read int value from byte array b with position pos.

Parameters:
b - array of bytes for read.
pos - position to read with.
Returns:
Int value.

getShort

protected short getShort(byte[] b,
                         int pos)
Read short value from byte array b with position pos.

Parameters:
b - array of bytes for read.
pos - position to read with.
Returns:
Short value.

setShort

protected void setShort(byte[] b,
                        int pos,
                        short value)
Write short value to byte array b with position pos.

Parameters:
b - array of bytes for write.
pos - position to write with.
value - value to write.

byteAsShort

protected short byteAsShort(byte b)
Convert byte to short.

Parameters:
b - byte
Returns:
short value.

ass2Number

public static java.lang.Object ass2Number(int j)
Convert value from XLS4 RC format to number (Integer or Double).

Parameters:
j - 4 bytes XLS4 RC number format.
Returns:
Integer or Double object represents of content RC cell.

isInt

public static boolean isInt(int p)
Determine is XLS4 RC cell content Integer or Double.

Parameters:
p - XLS4 RC cell content.
Returns:
true - Value is integer; false - Value is double.

exp2

public static double exp2(int x)
2 power by x.

Parameters:
x -
Returns:

removeAllBlanks

public static java.lang.String removeAllBlanks(java.lang.String inStr)
Removs all blanks from the string.

Parameters:
inStr - String with blanks.
Returns:
String without blanks.

outInteger

protected void outInteger(int intForOut)
Out integer value to the output stream.

Parameters:
intForOut - value for output.

outDouble

protected void outDouble(java.lang.Double doubleForOut)
Out Double value to the output stream.

Parameters:
doubleForOut - value for output.

outShorts

protected void outShorts(short[] shortsForOut)
Out Short array value to the output stream.

Parameters:
shortsForOut - value for output.

outBytes

protected void outBytes(byte[] bytesForOut)
Out byte array to the output stream.

Parameters:
bytesForOut - value for output.

outBytes

protected void outBytes(byte[] bytesForOut,
                        int offset,
                        int len)
Out piece byte array to the output stream.

Parameters:
bytesForOut - byte array.
offset - offset.
len - length for out.

outByte

protected void outByte(byte byteForOut)
Out byte to the output stream.

Parameters:
byteForOut - value for output.

outShort

protected void outShort(short shortForOut)
Out Short value to the output stream.

Parameters:
shortForOut - value for output.

openInputStream

public boolean openInputStream()
Open input stream. You do not invoke this function directly. Method execute invoike this function.

Returns:
open success.

closeInputStream

public void closeInputStream()
Close input stream. You do not invoke this function directly. Method execute invoike this function.

Returns:
close success.

openOutputStream

public boolean openOutputStream()
Open output stream. You do not invoke this function directly. Method execute invoike this function.

Returns:
open success.

closeOutputStream

public void closeOutputStream()
Close output stream. You do not invoke this function directly. Method execute invoike this function.

Returns:
close success.

outSpecial

protected void outSpecial()
Virtual auxiliary method.


prepareFileHeader

protected abstract boolean prepareFileHeader()
Abstract method for override in inheritance classes for parse file header section. For different formats (RTF, HTML, XLS4) this methos should do different work.

Returns:
success of operation.

prepareFileFooter

protected abstract boolean prepareFileFooter()
Abstract method for override in inheritance classes for parse file footer section. For different formats (RTF, HTML, XLS4) this methos should do different work.

Returns:
success of operation.

prepareSectionInternal

protected abstract int prepareSectionInternal(java.lang.String SectionName,
                                              int SectionNum)
Abstract method for override in inheritance classes for parse report section. For different formats (RTF, HTML, XLS4) this methos should do different work.

Parameters:
SectionName - section name for prepare.
SectionNum - section number for prepare.
Returns:
section number.

outSectionInternal

protected abstract void outSectionInternal(int SectionNum,
                                           boolean defaultOut)
Abstract method for override in inheritance classes for output report section. For different formats (RTF, HTML, XLS4) this methos should do different work.

Parameters:
SectionNum - section number for out.
defaultOut - default logic value means outed it by default or not.