2.6    Data to Word report

 

Include the following Entities:

Example reportchild of “Data to Word report”Entity Type: singular obligatory
Chapter 1: Main Dimensionschild of “Example report”Entity Type: singular obligatory
Chapter 2: Deck datachild of “Example report”Entity Type: 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“.

Create the following parameters in the Knowledge Browser:

Parameter name

Dimension

Reference

Report_document$

[$]

Report document

Word_file_name$

[$]

Name of Word file

Document_Tag$

[$]

Document tag

TableStyle$

[$]

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

VBA_Macro$

[$]

VBA Macro that is executed by MS Word

Mode

[BLN]

Mode for creating a VBA table macro by TELITAB2WORD() function.
0<EQ>Saves as WordMacro_TimeStamp_.bas on working directory and returns file name
1<EQ>Returns the complete VBA macro text

If Mode=1 is selected for manipulation by the knowledge engineer, it should be save using a PUT$() function

Transposed

[BLN]

Orientation of Word table
0<EQ>Parameters per column 
1<EQ>Parameter per row

Include the following parameters in Entity “Chapter 1: Main Dimensions “: “Loa”, “Lpp”, “Boa”, “Dm”, “Volume”, “Document_Tag$”, “Report_document$”, “Word_file_name” and QEntityData”.

Create the following relations in Entity “Chapter 1: Main Dimensions”:

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 a RTF document and store it on the current applications directory (either of the knowledge base, located in Kbs\_<KnowledgeBaseName>\Applic, or the general Applic directory in My Knowledge). We have already created theTutorial_taxonomy_maindimensions.rtf document which you have to place in the right directory.  Download total tutorial

Do the same for the documents report.rtf, Tutorial_deck_data.rtf and excel file Example.xls.

We have created a multi level approach with one main document (report.rtf) and several sub-documents (Tutorial_taxonomy_maindimensions.rtf) and (Tutorial_deck_data.rtf). A time stamp is included in the filenames. See the wiki for a detailed description of both functions WINWORD$ and TIME().

For the second report chapter Entity we do the same as for the first chapter:

Include the following parameters in Entity “Chapter 2: Deck data“, “Deck_data#”, “Document_Tag$”, “Report_document$”, “Word_file_name”, “Mode”, “TableStyle$”, “Transposed”, “VBA_Macro$” and QEntityData”.

Create the following relations in Entity “Chapter 2: Deck data”:

 

Figure 84: Parameter TableStyle$

Finally on the top level we make the overall report:

Include the following parameters in Entity “Example report“: “Report_document$”, “Word_file_name” and QEntityData”.

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.

Finally create the following relations in Entity “Data to report”.

Back to content | Continue with Data to Excel >>