Mechanism of action


1. Creating a template in XML


We design the document substantively and visually and the form of input data and output data. The template is responsible for the printing order of the elements in the output document (HTML, PDF). Allows you to place data in a precise location or in what order it should be generated. It allows to use predefined macros to change the input data in a desired way, e.g.: changing the date format adapted to a given country or the format of the displayed amount (currency symbol, decimal or thousands separator). All the above is saved in the UPU template file (XML format).

In the template we also define the appearance of the element, e.g.: its color, font type and size, border or spacing between the elements. We can define the style directly in the template or use additional style file (first.nxm_up_style).


2. Generating a publication assembly


UPUG (UPU Generator) reads XML template and C# code, and generates resultant C# code (upu_builder calls), which is then compiled (JIT or precompiled) into assembly (.DLL) form. This .DLL file can be reused many times.


3. Running / launching the publication assembly


For a given assembly, we supply the source data (idata_reader), the receiver of the resulting data (idata_writer), the UPU document to be completed (upu_document), and optionally the run parameters - interpreted by the upu_builder contained in this assembly.

The output is:

  • output data
  • upu_document

Depending on the generation option, we can request to generate only data, only document or both. Both of these elements can be saved (serialization) and then restored (deserialization) for later use without any contact with the source database.


4. Rendering


Renderer is fed with:

  • an upu_document
  • data source (idata_reader) with output data generated in previous step, or generated independently (only proper logical structure of document is important)
  • style dictionary (specifying appearance - fonts, colors, sizes)
  • optionally - rendering parameters (format, result location, etc.)

The result is a file/stream/link to a complete document that can be sent, archived, printed.