How To Create A New Report In LibrePlan ======================================= .. sectnum:: :Author: Manuel Rego Casasnovas :Contact: mrego@igalia.com :Date: 11/09/2012 :Copyright: Some rights reserved. This document is distributed under the Creative Commons Attribution-ShareAlike 3.0 licence, available in http://creativecommons.org/licenses/by-sa/3.0/. :Abstract: LibrePlan uses **JasperReports** [1]_ to create reports in the application. This document tries to explain how to create a new report in LibrePlan. During this tutorial you are going to create a report that will show the list of resources in LibrePlan. .. contents:: Table of Contents Add an entry on LibrePlan menu ------------------------------ First of all, you are going to add a new entry on *Reports* menu in LibrePlan, this option will link to a new ``.zul`` file inside ``libreplan-webapp/src/main/webapp/reports/`` that will be the basic interface for users before generate the report. Steps: * Modify method ``initializeMenu()`` in ``CustomMenuController.java`` to add a new ``subItem`` inside the ``topItem`` *Reports*:: subItem(_("Resources List"), "/reports/resourcesListReport.zul", "15-informes.html") You will see the new entry if you run LibrePlan, but the link is not going to work as ``.zul`` page still does not exist. .. TIP:: If you want to run LibrePlan in development mode you need to follow the next instructions: * Create a PostgreSQL database called ``libreplandev`` with permissions for a user ``libreplan`` with password ``libreplan`` (see ``INSTALL`` file for other databases and more info). * Compile LibrePlan with the following command from project root folder:: mvn -DskipTests -P-userguide clean install * Launch Jetty from ``libreplan-webapp`` directory:: cd libreplan-webapp mvn -P-userguide jetty:run * Access with a web browser to the following URL and login with default credentials (user ``admin`` and password ``admin``): http://localhost:8080/libreplan-webapp/ Create basic HTML interface --------------------------- You need an interface were users could specify some parameters (if needed) for the report and then generate the expected result. This interface will be linked from the menu entry added before. For the moment, you are going to create a very basic interface, copying some parts from other reports. Steps: * Create a new file ``resourcesListReport.zul`` in ``libreplan-webapp/src/main/webapp/reports/``. With the following content: ::