Using MS Word as Report Tool with Baan
Formatting Baan output to MS Word
I borrowed the idea of using [Bookmark] feature I found on the net.
Created MSWord Template (as a .doc file)
Created Book marks in the template,where data from Baan will fill in the blanks .
create the output from Baan as follows:
1*Path of output file to be created in the Win-PC-Terminal
2*Path of the template file which should be located in the pc
3*Header, Detail, Footer Indicator
4*The book Mark to be located in the template
5*The value to be placed at the bookmark
The paths[1,2] are captured in the Report Session's Form
The above 5 fields are separted by "|"
The above output file
will be sent to a batch file residing in c:\windows say Baan2Word.bat
Baan2Word.bat will invoke a VB6 program Baan2Word.exe. <>Baan2Word.exe will open the template file
<>Locate the bookmarks and fill in the blanks.
When it senses the line type is detail it will handle the table row in the template file iteratively.
it will save the output doc file as suggested in field 1.
It can handle any number of output files to be created.
Finally it will create a batch file with a Start FileName.Doc for the user to see and print the output.
If you would like to try it
place cursor at some point
Insert+BookMark, provide a name
close the window.
Create as may BookMarks you need.
To view the book marks
Select tools menu, options check bookmarks on ok.
The placed Book marks will be visible as 'I'
download the attachment.
the attachment contains:
The Source code for the VB6 program
Copy of the templates
Sample output into ms word
Sample output from Baan for conversion to word
all for free, no strings attached, no warranty, no liability, no damages claimable from me.
You must ensure there is a "footer" line type
after (all of the) detail line type. The footer bookmark value may also be filled with " ".
Last edited by sitarammani : 4th April 2002 at 15:55.