Friday, May 22, 2009

Faster Html Reports Using Mako Templates

Hello EveryOne,
Now you can create your HTML reports using Mako Templates for faster and formatted output.OpenERP has added new type of report called mako2html. Mako is a template library written in Python. It provides a familiar, non-XML syntax which compiles into Python modules for maximum performance.

Advantages:
    • Fast: simple three-sectioned layout mako template report takes 1.10 ms
    • Control structures constructed from real Python code (i.e. loops, conditionals) Which will allow user to create reports faster.
    • Straight Python blocks, inline or at the module-level
      You can format the report as you need using HTML.

      Requirements:
      • Mako 0.2.4 should be installed on your system.
      • openERP-server : Trunk version
      • openERP-client : Trunk version
      • openERP-addons : Trunk version
      As an overview lets see a small example

      For your company header you need to include 
      <%include file="mako_header.html"/>
      for your company footer you need to include 
      <%include file="mako_footer.html"/>

      This files will bring the header and footer that you have defined for your company in the database.

      Sale Order

      For Complete Example of Sale_order please Refer the module sale_report_html from : https://code.launchpad.net/~openerp-community/openobject-addons/trunk-addons-community

      0 comments:

      Post a Comment