VKRep
Class TXLS4ReportVertical

java.lang.Object
  |
  +--VKRep.TReportAbstract
        |
        +--VKRep.TReportVertical
              |
              +--VKRep.TXLS4ReportVertical
All Implemented Interfaces:
java.lang.Runnable, java.io.Serializable

public class TXLS4ReportVertical
extends TReportVertical

Title:

Description: Main class for all vertical XLS4 based reports.

Build report processing.

First of all you should make blank for you report in XLS4 format. The simplest way to do this - open MS Excel and design required blank. Save your blank in XLS format of 4 virsion.

The blank may consists of report sections. There are 11 standard sections and 2 special sections. In addition you can define your own report sections.

11 standard sections for XLS4:

2 special sections:

All sections have a name and a number. All standard sections have a predefined name and numbers from 0 to 12. When you define your own section you give name this section and when you register this section in reporter ( method int prepareSection(String SectionName) ) you supplied number of section (returned from prepareSection). You can invoke prepareSection only in doSectionPrepare or in prepareSection event.

The section definition in XLS4 format - it is simply named range of cells. For vertical XLS4 report the best way to give names for range rows of cells. The names of sections is standards names without blanks:

You shouldn't define FILE_HEADER and FILE_FOOTER. Your own sections names shouldn't have blanks within.

Properly speaking, all reporter to do is only copy BIFF recors from input blank to the output report according the following schema:


   copy FILE_HEADER (always)
   copy REPORT_HEADER (try always)
     doMoveTop  //move your data source to the top
     loop ( not end of your data source )
       copy GROUP_HEADER
       copy SUBGROUP_HEADER
       copy SUBSUBGROUP_HEADER
       copy SUPERSUBGROUP_HEADER
       copy BODY (try always)
       copy SUPERSUBGROUP_FOOTER
       copy SUBSUBGROUP_FOOTER
       copy SUBGROUP_FOOTER
       copy GROUP_FOOTER
       doMoveNext //move your data source to the next row
     end loop
   copy REPORT_FOOTER (try always)
   copy FILE_FOOTER (always)

 

Process of copy any section is accompany following events:


   doSectionBegin            //notify event
   doSectionCheck            //qury event to ask copy section or not
   if SectionCheck == true then
     copy content of section with query data from your data source
     doSectionComplete       //notify event
   end if
   doSectionEnd              //notify event

 

As you see, you can define in program youself when to copy section exactly (group sections should copy only for definite condition).

The data for report is supplied by mark and by consists of cell. There are two types of marks: mark by name and mark by number. First, in OnDataRequest event you can define data for concrete cell. Then (if you not handle event OnDataRequest) try replace all mark (by name and by nember) in OnRequestByName and OnRequestByNum events.

Mark by name looks like:

   ...
   ~field_name1~    ~field_name2~  ....
   ...
 

Mark by number looks like:

   ...
   @0001    @0002  ....
   ...
 

When reporter copy section it copy one cell by cell. When reporter copy cell in output stream (file) the OnDataRequest event is fire where you can define new content of cell. If you not define data in OnDataRequest event (rptEvent.check = false) reporter try to find marks (by name or by number) in a cell. The reporter determinate data request mark it fire event for delivery data. Your programm should handle this event and return data corresponding to mark.

Note that XLS4 format support only 255 charster length in cell.

The navigation within data source realize throw two events: onMoveTop and onMoveNext.

Create blank for you XLS4 report.

Create blank process include 1 steps in general !!!! Open MS Excel and make your blank with sections what you need and numerate cells for reflect on OnDataRequest event. Save blank as XLS 4 format. That is all...

Copyright: Copyright (c) 2003

Company:

Version:
1.0
Author:
not attributable
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class VKRep.TReportAbstract
TReportAbstract.BOutStream, TReportAbstract.TBiffRec, TReportAbstract.TBiffRecHeader, TReportAbstract.TSection
 
Field Summary
private  java.util.Vector biffBody
           
private  int currRow
           
private  int lastHandle
           
 
Fields inherited from class VKRep.TReportAbstract
blankInputStream, BODY, BOutStreamA, BOutStreamB, charByName, charByNum, FILE_FOOTER, FILE_HEADER, GROUP_FOOTER, GROUP_HEADER, inputBlank, inputBuffer, LAST_DYN_SECTION, lastDynSection, listener, MAX_LABEL_NAME_LEGTH, MAX_SECTION_NUM, offsetXLSInput, outCase, outputBuffer, outputBufferCount, outputReport, realInputBlankLength, REPORT_FOOTER, REPORT_HEADER, reportOutStream, REQUEST_DATA_BY_NAME_SYMBOL, REQUEST_DATA_BY_NUM_SYMBOL, rptEvent, RTF_SECTION_BEGIN_BREAKED, RTF_SECTION_END_BREAKED, sections, STREAM_BUFFER_SIZE, streamBufferSize, SUBGROUP_FOOTER, SUBGROUP_HEADER, SUBSUBGROUP_FOOTER, SUBSUBGROUP_HEADER, SUPERSUBGROUP_FOOTER, SUPERSUBGROUP_HEADER, XLSBlank, XLSBool, XLSCOL, XLSDimension, XLSLabel, XLSNumber, XLSRK, XLSRow
 
Constructor Summary
TXLS4ReportVertical()
           
 
Method Summary
protected  void clearSections()
          Initialize array of sections.
protected  void clearVars()
          Virtual auxiliary method.
protected  void outSectionInternal(int SectionNum, boolean defaultOut)
          Abstract method for override in inheritance classes for output report section.
protected  boolean prepareFileFooter()
          Abstract method for override in inheritance classes for parse file footer section.
protected  boolean prepareFileHeader()
          Abstract method for override in inheritance classes for parse file header section.
protected  int prepareSectionInternal(java.lang.String SectionName, int SectionNum)
          Abstract method for override in inheritance classes for parse report section.
 
Methods inherited from class VKRep.TReportAbstract
addVKRepListener, ass2Number, byteAsShort, closeInputStream, closeOutBuffer, closeOutputStream, doDataRequest, doEndReport, doMoveNext, doMoveTop, doReportError, doRequestByName, doRequestByNum, doSectionBegin, doSectionCheck, doSectionComplete, doSectionEnd, doSectionPrepare, doStartReport, execute, exp2, fireDataRequest, fireEndReport, fireMoveNext, fireMoveTop, fireReportError, fireRequestByName, fireRequestByNum, fireSectionBegin, fireSectionCheck, fireSectionComplete, fireSectionEnd, fireSectionPrepare, fireStartReport, flushOutBuffer, getBlankInputStream, getBytes, getCharByName, getCharByNum, getInputBlank, getInt, getListener, getLong, getOutputReport, getReportOutStream, getShort, getShort, getStreamBufferSize, isInt, openInputStream, openOutputStream, outByte, outBytes, outBytes, outDouble, outInteger, outSection, outSection, outShort, outShorts, outSpecial, outVariant, outXLSDouble, prepareSection, removeAllBlanks, removeVKRepListener, run, setBlankInputStream, setCharByName, setCharByNum, setInputBlank, setListener, setOutputReport, setReportOutStream, setShort, setStreamBufferSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

biffBody

private java.util.Vector biffBody

lastHandle

private int lastHandle

currRow

private int currRow
Constructor Detail

TXLS4ReportVertical

public TXLS4ReportVertical()
Method Detail

clearSections

protected void clearSections()
Description copied from class: TReportAbstract
Initialize array of sections.

Overrides:
clearSections in class TReportAbstract

clearVars

protected void clearVars()
Description copied from class: TReportAbstract
Virtual auxiliary method.

Overrides:
clearVars in class TReportAbstract

prepareFileHeader

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

Specified by:
prepareFileHeader in class TReportAbstract
Returns:
success of operation.

prepareFileFooter

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

Specified by:
prepareFileFooter in class TReportAbstract
Returns:
success of operation.

prepareSectionInternal

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

Specified by:
prepareSectionInternal in class TReportAbstract
Parameters:
SectionName - section name for prepare.
SectionNum - section number for prepare.
Returns:
section number.

outSectionInternal

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

Specified by:
outSectionInternal in class TReportAbstract
Parameters:
SectionNum - section number for out.
defaultOut - default logic value means outed it by default or not.