Custom Reporting -- Exporting Reports From the Command Line: Difference between revisions

From IHRIS Wiki
No edit summary
No edit summary
Line 1: Line 1:
En ocasiones puede que desee exportar informes de la línea de mando de forma constante. Este documento explica como ejecutar comandos de la línea de mando para lograr esto. También puede incluir estos comandos en un script en un cron job si lo desea.  '''Nota:''' Actualmente esto requiere la revisión 3014 de I2CE que repara algunos problemas con los informes de líneas de mando. Esto está siendo desarrollado, pero estará en la versión 4.1.4.
Sometimes you may want to export reports from the command line on a regular basis. This document will explain how to run commands from the command line to do this. You can also include these commands in a script in a cron job if you'd like.  '''Note:''' This currently requires revision 3014 of I2CE that fixes some issues with command line reports. This is currently in development, but will be in the 4.1.4 release.


== El Directorio de Páginas ==
== The Pages Directory ==


Antes de ejecutar cualquiera de estos comandos debe estar en el directorio de páginas de su sitio. Reemplace PATH con el PATH a su directorio de sitio.
Before running any of these commands you'll need to be in the pages directory for your site. Replace PATH with the PATH to your site directory.


<source lang="bash">
<source lang="bash">
Line 9: Line 9:
</source>
</source>


== Actualizar el Informe en Caché ==
== Update the Report Cache ==


El informe en caché se actualiza basándose en lo fijado las veces en las que se accede al sitioSin embargo, puede que quiera poner en caché cualquier informe antes de ejecutarlos en la línea de mando. Para esto se utiliza el nombre "report", no la vista de reporteReemplace REPORT con el nombre de su reporte.
The report cache is updated based on the times you've set when the site is accessedHowever, you may want to cache any reports before running them on the command line. You use the "report" name for this, not the report viewReplace REPORT with your report name.


<source lang="bash">
<source lang="bash">
Line 17: Line 17:
</source>
</source>


== Exportar un Informe como CSV ==
== Export Report as CSV ==


Para exportar su informe como un archivo CSV, ejecute este comando y reemplace REPORTVIEW con la vista de reporte que desee visualizar.
To export your report as a CSV file, run this command and replace REPORTVIEW with the report view you wish to see.


<source lang="bash">
<source lang="bash">
Line 25: Line 25:
</source>
</source>


== Exportar un Informe como PDF ==
== Export Report as PDF ==


Para crear un PDF de su informe , ejecute este comando y reemplace REPORTVIEW con la vista de reporte que desee visualizar.
To create a PDF of your report, run this command and replace REPORTVIEW with the report view you wish to see.


<source lang="bash">
<source lang="bash">

Revision as of 21:12, 30 September 2013

Sometimes you may want to export reports from the command line on a regular basis. This document will explain how to run commands from the command line to do this. You can also include these commands in a script in a cron job if you'd like. Note: This currently requires revision 3014 of I2CE that fixes some issues with command line reports. This is currently in development, but will be in the 4.1.4 release.

The Pages Directory

Before running any of these commands you'll need to be in the pages directory for your site. Replace PATH with the PATH to your site directory.

<source lang="bash"> cd PATH/pages </source>

Update the Report Cache

The report cache is updated based on the times you've set when the site is accessed. However, you may want to cache any reports before running them on the command line. You use the "report" name for this, not the report view. Replace REPORT with your report name.

<source lang="bash"> php index.php --page=/CustomReports/generate/REPORT </source>

Export Report as CSV

To export your report as a CSV file, run this command and replace REPORTVIEW with the report view you wish to see.

<source lang="bash"> php index.php --page=/CustomReports/show/REPORTVIEW/Export --post=export_style=CSV > FILENAME.csv </source>

Export Report as PDF

To create a PDF of your report, run this command and replace REPORTVIEW with the report view you wish to see.

<source lang="bash"> php index.php --page=/CustomReports/show/REPORTVIEW/PDF --post='paper_size=LETTER&paper_orientation=P' > FILENAME.pdf </source>