diff --git a/doc/src/technical/howto-create-a-new-report-in-navalplan.rst b/doc/src/technical/howto-create-a-new-report-in-navalplan.rst new file mode 100644 index 000000000..38db32e5e --- /dev/null +++ b/doc/src/technical/howto-create-a-new-report-in-navalplan.rst @@ -0,0 +1,446 @@ +.. sectnum:: + +How To Create A New Report In NavalPlan +======================================= + +.. contents:: + +NavalPlan uses **JasperReports** [1]_ to create reports in the application. This +document tries to explain how to create a new report in NavalPlan. + +During this tutorial you are going to create a report that will show the list of +resources in NavalPlan. + + +Add entry on NavalPlan menu +--------------------------- + +First of all, you are going to add a new entry on *Reports* menu in NavalPlan, +this option will link to a new ``.zul`` file inside +``navalplanner-webapp/src/main/webapp/reports/`` that will be the basic +interface for users before generate the report. + +Steps: + +* Modify ``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 NavalPlan, but the link is not going to +work as ``.zul`` page still does not exist. + + +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 + ``navalplanner-webapp/src/main/webapp/reports/``. With the following content: + +:: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +