|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--VKRep.TReportAbstract | +--VKRep.TReportVertical | +--VKRep.TXLS4ReportVertical
Title:
Description: Main class for all vertical XLS4 based reports.
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 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:
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
|
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.util.Vector biffBody
private int lastHandle
private int currRow
Constructor Detail |
public TXLS4ReportVertical()
Method Detail |
protected void clearSections()
TReportAbstract
clearSections
in class TReportAbstract
protected void clearVars()
TReportAbstract
clearVars
in class TReportAbstract
protected boolean prepareFileHeader()
TReportAbstract
prepareFileHeader
in class TReportAbstract
protected boolean prepareFileFooter()
TReportAbstract
prepareFileFooter
in class TReportAbstract
protected int prepareSectionInternal(java.lang.String SectionName, int SectionNum)
TReportAbstract
prepareSectionInternal
in class TReportAbstract
SectionName
- section name for prepare.SectionNum
- section number for prepare.
protected void outSectionInternal(int SectionNum, boolean defaultOut)
TReportAbstract
outSectionInternal
in class TReportAbstract
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 |