Word report
Example report | child of Data to Word report | Singular obligatory |
Chapter 1: Main Dimensions | child of Example report | Singular obligatory |
Chapter 2: Deck data | child of Example report | Singular obligatory |
In entity Example report
, the main document will be created, which includes the separate documents of the entities Chapter 1: Main Dimensions
and Chapter 2: Deck data
.
Parameter name | Dimension | Determined by | Reference | In Class |
| [$] | USL: User of System/function | Report document | Word report |
| [$] | USL: User of System/function | Name of Word file | Word report |
| [$] | USL: User of System/function | Document tag | Word report |
| [$] | VR: User only | Word table style information Example: | Word report |
| [$] | USL: User of System/function | VBA Macro that is executed by MS Word | Word report |
| [BLN] | VR: User only | Mode for creating a VBA table macro by TELITAB2WORD() function. If Mode=1 is selected for manipulation by the knowledge engineer, it should be save using a PUT$() function | Word report |
| [BLN] | VR: User only | Orientation of Word table | Word report |
Chapter 1: Main Dimensions
: Loa
, Lpp
, Boa
, Dm
, Volume
, Document_Tag$
, Report_document$
and Word_file_name
.Volume
and remove @MODIFY because you do not want to allow this here.Chapter 1: Main Dimensions
:Loa = ENTITY#(xx).Loa
where “xx” is the value of QEntityID
of entity Main Dimensions
.
Lpp = ENTITY#(xx).Lpp
where “xx” is the value of QEntityID
of entity Main Dimensions
.
Boa = ENTITY#(xx).Boa
where “xx” is the value of QEntityID
of entity Main Dimensions
.
Dm = ENTITY#(xx).Dm
where “xx” is the value of QEntityID
of entity Main Dimensions
.
Volume = ENTITY#(xx).Volume
where “xx” is the value of QEntityID
of entity Hydrostatics
.
Document_Tag$ = "#" + Report_document$ + "#"
Word_file_name$ = "main_dimensions_" + STR$(TIME(0)) + ".doc"
Report_document$ = WINWORD$ Tutorial_taxonomy_maindimensions.rtf(Word_file_name$,0 , Boa, Dm, Loa, Lpp, Volume)
QEntityData
.In general, the function WINWORD$
opens and creates an RTF document, saves it as Word document and returns the name of the document. Normally, you have to create an RTF document and store it in the current applications directory (either of the knowledge base, located in Kbs\_<KnowledgeBaseName>\Applic, or the general Applic directory in My Knowledge).
We have created a multi level approach with one main document and several sub-documents. A time stamp is included in the filenames. See the wiki for a detailed description of the functions WINWORD$ and TIME().
For the second report chapter entity, do about the same as for the first chapter:
Chapter 2: Deck data
: Deck_data#
, Document_Tag$
, Report_document$
, Word_file_name
, Mode
, TableStyle$
, Transposed
and VBA_Macro$
.Chapter 2: Deck data
:Deck_data# = ENTITY#(xx).Deck_data#
where “xx” is the value of QEntityID
of entity Decks
.
Mode = 0
(0<EQ>Saves as WordMacro_TimeStamp_.bas on working directory and returns file name)
Transposed = 0
(0<EQ>Parameters per column)
Document_Tag$ = "#" + Report_document$ + "#"
Word_file_name$ = "deck_data_" + STR$(TIME(0)) + ".doc"
Report_document$ = WINWORD$ Tutorial_deck_data.rtf(Word_file_name$, 0, VBA_Macro$)
VBA_Macro$ = TELITAB2WORD$(Deck_data#, 1, TableStyle$, Transposed, Mode)
QEntityData
.The TELITAB2WORD$ function returns a MS Word macro to create a table in Word based on a given Telitab set, in this case Telitab “Deck_data#”. See the wiki for a detailed description of TELITAB2WORD$ function.
Parameter TableStyle$
contains the Word table style information.
TableStyle$ = TEXTITEM$(1)
Expression Data:
TEXTITEM1= |Formatted:=True ParameterBold:=True, ParameterBackColor:=wdColorGray25, Font:=Arial 8.5 OutsideBorder:=wdLineStyleSingle wdLineWidth100pt wdColorAutomatic InsideGrid:=wdLineStyleSingle wdLineWidth050pt wdColorAutomatic CaseNumbers:=True TableAlignment:=wdAlignRowLeft|
Expression Reference:
Word table style information Example: ParameterBold:=True, ParameterBackColor:=wdColorBlack, Font:=Arial 8.5 OutsideBorder:=wdLineStyleSingle wdLineWidth100pt wdColorAutomatic InsideGrid:=wdLineStyleSingle wdLineWidth050pt wdColorAutomatic CaseNumbers:=True TableAlignment:=wdAlignRowCenter
Finally on the top level we make the overall report:
Example report
: Report_document$
and Word_file_name$
.TODO: ----
You have to modify the total report report.rtf in order to let the overall summary report do its work.
In the template of the total report report.rtf we added #ENTITY#(xx).Document_Tag$#. This is the reference to the parameters Document_Tag$# in the relevant Entities. You have to check whether the QEntityID of the two references in the template are correct. If you modify the RTF document, please remember to check it in Quaestor using the Tools>RTF Template Check... option.
----
Example report
:Word_file_name$ = "Report_" + STR$(TIME(0)) + ".doc"
Report_document$ = WINWORD$ Report.rtf(Word_file_name$, 0 , ENTITY#(xx).Document_Tag$, ENTITY#(xxx).Document_Tag$
) where “xx” is the value of
of entityQEntityID
and “xxx” of entityChapter 1: Main Dimensions
Chapter 2: Deck data
.
QEntityData
.