|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--VKRep.TReportAbstract
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:
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 |
public static final int FILE_HEADER
public static final int REPORT_HEADER
public static final int GROUP_HEADER
public static final int SUBGROUP_HEADER
public static final int SUBSUBGROUP_HEADER
public static final int SUPERSUBGROUP_HEADER
public static final int BODY
public static final int SUPERSUBGROUP_FOOTER
public static final int SUBSUBGROUP_FOOTER
public static final int SUBGROUP_FOOTER
public static final int GROUP_FOOTER
public static final int REPORT_FOOTER
public static final int FILE_FOOTER
public static final int LAST_DYN_SECTION
public static final int MAX_SECTION_NUM
public static final int REQUEST_DATA_BY_NUM_SYMBOL
public static final int REQUEST_DATA_BY_NAME_SYMBOL
public static final int RTF_SECTION_BEGIN_BREAKED
public static final int RTF_SECTION_END_BREAKED
public static final int MAX_LABEL_NAME_LEGTH
public static final int STREAM_BUFFER_SIZE
private transient java.util.Vector VKRepListeners
protected VKRepListener listener
protected TReportAbstract.TSection[] sections
protected int lastDynSection
protected int outputBufferCount
protected byte charByName
protected byte charByNum
protected java.lang.String inputBlank
protected java.lang.String outputReport
protected int streamBufferSize
protected byte[] inputBuffer
protected byte[] outputBuffer
protected int realInputBlankLength
protected java.io.InputStream blankInputStream
protected java.io.OutputStream reportOutStream
protected VKRepEvent rptEvent
protected int offsetXLSInput
protected TReportAbstract.BOutStream BOutStreamA
protected TReportAbstract.BOutStream BOutStreamB
protected int outCase
protected short[] XLSDimension
protected short[] XLSCOL
protected short[] XLSRow
protected short[] XLSBlank
protected short[] XLSRK
protected short[] XLSNumber
protected short[] XLSLabel
protected short[] XLSBool
Constructor Detail |
public TReportAbstract()
Method Detail |
private void writeObject(java.io.ObjectOutputStream oos) throws java.io.IOException
oos
-
java.io.IOException
private void readObject(java.io.ObjectInputStream ois) throws java.lang.ClassNotFoundException, java.io.IOException
ois
-
java.lang.ClassNotFoundException
java.io.IOException
public void addVKRepListener(VKRepListener l)
l
- object which inmplements VKRepListener interface.public void removeVKRepListener(VKRepListener l)
l
- object which inmplements VKRepListener interface.public VKRepListener getListener()
public void setListener(VKRepListener lster)
lster
- The new value of listener object field.protected void fireStartReport(VKRepEvent e)
e
- VKRepEvent event object.public void doStartReport(VKRepEvent e)
e
- VKRepEvent event object.protected void fireEndReport(VKRepEvent e)
e
- VKRepEvent event object.public void doEndReport(VKRepEvent e)
e
- VKRepEvent event object.protected void fireReportError(VKRepEvent e)
e
- VKRepEvent event object.public void doReportError(VKRepEvent e)
e
- VKRepEvent event object.protected void fireMoveTop(VKRepEvent e)
e
- VKRepEvent event object.public void doMoveTop(VKRepEvent e)
e
- VKRepEvent event object.protected void fireMoveNext(VKRepEvent e)
e
- VKRepEvent event object.public void doMoveNext(VKRepEvent e)
e
- VKRepEvent event object.protected void fireSectionBegin(VKRepEvent e)
e
- VKRepEvent event object.public void doSectionBegin(VKRepEvent e)
e
- VKRepEvent event object.protected void fireSectionEnd(VKRepEvent e)
e
- VKRepEvent event object.public void doSectionEnd(VKRepEvent e)
e
- VKRepEvent event object.protected void fireSectionComplete(VKRepEvent e)
e
- VKRepEvent event object.public void doSectionComplete(VKRepEvent e)
e
- VKRepEvent event object.protected void fireSectionCheck(VKRepEvent e)
e
- VKRepEvent event object.public void doSectionCheck(VKRepEvent e)
e
- VKRepEvent event object.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:
e
- VKRepEvent event object.public void doDataRequest(VKRepEvent e)
e
- VKRepEvent event object.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:
e
- VKRepEvent event object.public void doRequestByName(VKRepEvent e)
e
- VKRepEvent event object.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:
e
- VKRepEvent event object.public void doRequestByNum(VKRepEvent e)
e
- VKRepEvent event object.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.
e
- VKRepEvent event object.public void doSectionPrepare(VKRepEvent e)
e
- VKRepEvent event object.public void outSection(java.lang.String SectionName)
SectionName
- Section Namepublic void outSection(int SectionNum)
SectionNum
- Number of sectionpublic void execute()
public void run()
run
in interface java.lang.Runnable
public java.io.InputStream getBlankInputStream()
public void setBlankInputStream(java.io.InputStream blankInputStream)
blankInputStream
- Input stream of blank report.public java.io.OutputStream getReportOutStream()
public void setReportOutStream(java.io.OutputStream reportOutStream)
reportOutStream
- Output stream for result report.protected void clearSections()
protected void clearVars()
public int getStreamBufferSize()
public void setStreamBufferSize(int newStreamBufferSize)
newStreamBufferSize
- New value of streamBufferSize
property.public byte getCharByName()
public void setCharByName(byte charByName)
charByName
- New value of charByName
property.public byte getCharByNum()
public void setCharByNum(byte charByNum)
charByNum
- New value of charByNum
property.public java.lang.String getInputBlank()
public void setInputBlank(java.lang.String inputBlank)
inputBlank
- New value of inputBlank (blank file name)
property.public java.lang.String getOutputReport()
public void setOutputReport(java.lang.String outputReport)
outputReport
- New value of outputReport (output report
file name) property.public int prepareSection(java.lang.String SectionName)
SectionName
- Your own section name for prepare.
protected void flushOutBuffer()
protected void closeOutBuffer()
protected void outXLSDouble(java.lang.Double value, short cellFormat, int row, int col)
value
- Double value for output.cellFormat
- reference to the cell format.row
- row of cell.col
- column for cell.protected void outVariant(TReportAbstract.TBiffRec pp, int row, int col)
pp
- BIFF record from input blank.row
- row of cell.col
- column for cell.protected void getBytes(byte[] b)
b
- protected short getShort()
protected long getLong(byte[] b, int pos)
b
- array of bytes for read.pos
- position to read with.
protected int getInt(byte[] b, int pos)
b
- array of bytes for read.pos
- position to read with.
protected short getShort(byte[] b, int pos)
b
- array of bytes for read.pos
- position to read with.
protected void setShort(byte[] b, int pos, short value)
b
- array of bytes for write.pos
- position to write with.value
- value to write.protected short byteAsShort(byte b)
b
- byte
public static java.lang.Object ass2Number(int j)
j
- 4 bytes XLS4 RC number format.
public static boolean isInt(int p)
p
- XLS4 RC cell content.
public static double exp2(int x)
x
-
public static java.lang.String removeAllBlanks(java.lang.String inStr)
inStr
- String with blanks.
protected void outInteger(int intForOut)
intForOut
- value for output.protected void outDouble(java.lang.Double doubleForOut)
doubleForOut
- value for output.protected void outShorts(short[] shortsForOut)
shortsForOut
- value for output.protected void outBytes(byte[] bytesForOut)
bytesForOut
- value for output.protected void outBytes(byte[] bytesForOut, int offset, int len)
bytesForOut
- byte array.offset
- offset.len
- length for out.protected void outByte(byte byteForOut)
byteForOut
- value for output.protected void outShort(short shortForOut)
shortForOut
- value for output.public boolean openInputStream()
public void closeInputStream()
public boolean openOutputStream()
public void closeOutputStream()
protected void outSpecial()
protected abstract boolean prepareFileHeader()
protected abstract boolean prepareFileFooter()
protected abstract int prepareSectionInternal(java.lang.String SectionName, int SectionNum)
SectionName
- section name for prepare.SectionNum
- section number for prepare.
protected abstract void outSectionInternal(int SectionNum, boolean defaultOut)
SectionNum
- section number for out.defaultOut
- default logic value means outed it by
default or not.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |