[Rendering Formats- DOCX Renderer]

Elixir can directly generate the DOCX template using the renderer. This doesn’t involve RML as Users can directly design the template through Microsoft Word by using some scripting that link with database /datasource. This Docx file will than be placed into the Repository and user can use the Docx Renderer to render the template output in DOCX format. This would be suitable for long docx reports with mail-merge kind of report that requires data handling.

Two Examples of generating docx:

1/ Sample.rml → Right-Click → Render As DocX(This mime-type options will appear if we can find the same .docx file name i.e. Sample.docx) → Backend process
2/ Instead of using Sample.rml to generate to docx, we call Sample.docx.
Sample.docx → Right-Click → Render As DocX

Although DocX is a new file format for Word from Microsoft Office 2007, users with Microsoft Office XP and Microsoft Office 2003 can also render a DocX file. To view a DocX file, install the File Compatibility Pack which can be downloaded from Microsoft Download Center, New Page. With OpenOffice, the Compatibility Pack is not required to view.

You cannot create a DocX file using Repertoire Designer or Remote Designer. Therefore, you will need a copy of Microsoft Office to create your template. After the template has been created you can put it in the Elixir Repository so the rendering engine can find it.

Once in the Elixir Repository, you can right-click on the DocX file and select View, the DocX file will open in Microsoft Office for editing or viewing (assuming you have Microsoft Office installed). Scripts need to be used for render-if element. Docx files in the repository that with data from datasource can be rendered directly by just clicking and select render.

For more information, please refer to

http://www.elixirtech.com/release/Rep8.4.0/Report-Designer/ch08.html#RenderDocX

*Note: Docx renderer support all operating systems and works in the Server, Designer and also Remote. But not to Report Runtime.

Generating DOCX template to PDF format

This is not supported.
However. in Professional Services side there is workaround by using a combination of third-party software and Elixir to convert .docx to .pdf.
It will be messy but transparent to end-users. The flow will be:

Generate Docx to a folder → Run Ant Script using Job to execute command to call this third party tool to perform the conversion from this docx to pdf(Transparent to users) → Write back to the same folder.

Refer to the attached sample.

Pre-requisites
1/ Download the attached sample and put in your repository
2/ Download PyODConverter: DocumentConverter.py [7.8kb]
3/ Install Open Office: http://download.openoffice.org/
4/ Copy and Paste "DocumentConverter.py into <C:\Program Files\OpenOffice.org 3\program>

Procedure
1/ Create a new folder “convert” in C directory
2/ Open the resource folder from the attached sample, copy “ElixirDocxSample.docx” into <C:/convert> folder
3/ Back to the resource folder, copy “test.txt” into C directory
4/ Rename “test.txt” to “test.bat”
5/ Open “test.bat” with text editor, ensure the path and version of OpenOffice is correct. eg. cd C:\Program Files\OpenOffice.org 3\program

This test.bat file contains the conversion command
reference: http://www.artofsolving.com/opensource/pyodconverter

6/ Back to the resource folder, open “execBat.xml”, ensure path of test.bat is correct. eg C:\test.bat
7/ Launch Remote Designer, open the Job file (attached sample)
8/ Select ANT, ensure the path of the .xml file is correct.
9/ Run the job

[Result] You will find the converted PDF file (test.pdf) in <C:/convert> directory.HowToExecuteBatFileUsingAnt.zip (67.2 KB)