Printed Forms with Reports (ODT): Difference between revisions

From IHRIS Wiki
No edit summary
Line 1: Line 1:
El módulo de formularios impresos se utiliza para imprimir formularios "estandarizados" u "oficiales" basados en los informes en el sistemaPor ejemplo, puede ser el número de registro de una enfermera. Será exportado como un Documento de Open Office. Este documento puede fácilmente ser leído en Microsoft Word 2003.
The printed forms module is used to print "standardized" or "official" forms based upon the reports in the systemFor example, it might be the registration number for a nurse. The output will be an Open Office Document. This document can be read readily by Microsoft Word 2003.


Dependiendo de lo que necesite, puede que desee ver estos otros métodos para la creación de formularios estandarizados:
Depending on your needs, you may wish to look at these other methods for standardized form generation:
*[[Printed Forms]]
*[[Printed Forms]]
*[[Printed Forms form Relationships (ODT)]]
*[[Printed Forms form Relationships (ODT)]]
Line 7: Line 7:




== ¿Qué son los Formularios Impresos? ==
== What are Printed Forms? ==


Los Formularios Impresos permiten crear una plantilla de OpenDocument Text (ODT) que pude llenarse con los datos del informeEsto está basado en [[Standardized Letters (ODT)|Standardized Letters]] que pueden utilizarse para un registro individual.
Printed forms allow you to create an OpenDocument Text (ODT) template that can be filled in with your report dataThis is based on the [[Standardized Letters (ODT)|Standardized Letters]] that can be used for an individual record.


== Agregar un Formulario Impreso a una Visualización de Informe ==
== Adding a Printed Form to a Report View ==


Hay dos pasos para agregar un formulario impreso a una visualización de informe. Primero debe crear el archivo plantilla, luego crear un módulo con el archivo de plantilla y la configuración para a visualización de informe. Por ejemplo, puede buscar SampleStaffPrintedForm en el módulo de directorio de iHRIS Manage demo site.
There are two steps to adding a printed form to a report view. First you need to create the template file, then create a module with the template file and the configuration for the report view. For an example, you can look in the iHRIS Manage demo site modules directory for SampleStaffPrintedForm.


=== Crear una Plantilla ODT ===
=== Creating an ODT Template ===


El archivo plantilla necesita datos temporales para los campos que desee mostrar. También existen otros datos temporales para datos especiales. Todos los datos temporales se aplicaran al resultado final. Todos los datos temporales se encuentran rodeados de '''{{{''' and '''}}}'''.  Cualquier formato que se le aplique al dato temporal será aplicado el resultado final. También debe señalar donde está el bloque de texto que desea repetir para cada fila de la base de datos. Rodeará este bloque con '''[!-- BEGIN report_row --]''' y '''[!--END report_row --]'''.  Vea más adelante para los detalles para utilizar una tabla para su resultado final.
The template file needs placeholders for the fields you wish to display. There are also some other placeholders for special data. All the placeholders are surrounded by '''{{{''' and '''}}}'''.  Any formatting you apply to the placeholder will apply to the final output. You also need to signify where the block of text is that you want to repeat for each row of the database. You will surround this block with '''[!-- BEGIN report_row --]''' and '''[!--END report_row --]'''.  See below for details when using a table for your output.


Aquí se encuentran los datos temporales que se pueden utilizar en el informe. Datos temporales especiales inician con '''++'''.  Los datos temporales coinciden con el nombre '''form+field''' en la visualización de informeLos datos temporales de encabezados pueden ser utilizados es cualquier lugar del documentoAlgunos aplican sólo dentro o fuera del loop para el informe.
Here are the placeholders you can use in your file. Special placeholders being with '''++'''.  Field placeholders match the '''form+field''' name in the report viewThe header placeholders can be used anywhere in the documentSome may apply only inside or outside the loop for the report.


{| border="1" cellspacing="0" cellpadding="5" align="center"
{| border="1" cellspacing="0" cellpadding="5" align="center"
! Dato Temporal
! Placeholder
! Aplica
! Applies
! Descripción
! Description
|-  
|-  
| {{{++report_title}}}
| {{{++report_title}}}
| Loop Fila Externa
| Outside Row Loop
| El título del informe.
| The title of the report.
|-
|-
| {{{++report_description}}}
| {{{++report_description}}}
| Loop Fila Externa
| Outside Row Loop
| La descripción del informe.
| The description of the report.
|-
|-
| {{{++report_limit}}}
| {{{++report_limit}}}
| Loop Fila Externa
| Outside Row Loop
| Los límites de informe seleccionados cuando este informe fue creado.
| The selected report limits when this report was generated.
|-
|-
| {{{++user_name}}}
| {{{++user_name}}}
| Loop Fila Externa
| Outside Row Loop
| El nombre de usuario del usuario que creó este informe.
| The user name of the user who generated the report.
|-
|-
| {{{++time}}}
| {{{++time}}}
| Loop Fila Externa
| Outside Row Loop
| La hora en la que el informe fue ejecutado.
| The time the report was run.
|-
|-
| {{{++header+'''form+field'''}}}
| {{{++header+'''form+field'''}}}
| Cualquiera
| Any
| El encabezado del campo específico.
| The header for the given field.
|-
|-
| {{{++row_num}}}
| {{{++row_num}}}
| Inside Row Loop
| Inside Row Loop
| El número de fila actual del registro.
| The current row number for the record.
|-
|-
| {{{'''form+field'''}}}
| {{{'''form+field'''}}}
| Loop Fila Interna
| Inside Row Loop
| El valor de el campo específico en la visualización de informe.
| The value for the given field in the report view.
|-
|-
| {{{'''form+field+width=2.0in,maxheight=3.0in}}}
| {{{'''form+field+width=2.0in,maxheight=3.0in}}}
| Loop Fila Interna
| Inside Row Loop
| Si el campo del formulario es una imagen, puede brindarse información extra para el ajuste de las dimensiones.
| If the form field is an image, then extra dimensional formatting information can be provided.
|-
|-
| {{{'''++limit+form+mapfield'''}
| {{{'''++limit+form+mapfield'''}
| Loop Fila Interna
| Inside Row Loop
| Sí se ha puesto un límite para uno de los formularios es este informe a través de un MAP field, entonces este será el nombre de formulario al que el mapfield se mapee  que se mostrará.
| If a limit has been set for one of the the form in this report via a MAP field, then this is the display name of the form that mapfield maps to.
|-
|-
| {{{'''++limit+form+mapfield+field'''}
| {{{'''++limit+form+mapfield+field'''}
| Loop Fila Interna
| Inside Row Loop
| Sí se ha puesto un límite para uno de los formularios es este informe a través de un MAP field, entonces este será valor del campo al que el mapfield se mapee  que se mostrará.
| If a limit has been set for one of the the form in this report via a MAP field, then this is the display value of field for the mapped form that mapfield maps to.
|}
|}


Este es el ejemplo para el mismo módulo. Puede descargar el [http://bazaar.launchpad.net/~intrahealth+informatics/ihris-manage/4.1-dev/download/head:/staffform.odt-20120126055155-qjun6vhyfw79qnhf-4/StaffForm.odt source file] de esto para ver el formato.
This is the example from the sample module. You can download the [http://bazaar.launchpad.net/~intrahealth+informatics/ihris-manage/4.1-dev/download/head:/staffform.odt-20120126055155-qjun6vhyfw79qnhf-4/StaffForm.odt source file] for this to see the formatting.


<pre>
<pre>
Line 87: Line 87:
</pre>
</pre>


Cuando desee repetir una fila de una tabla para las filas de su informe, deberá cambiar las oraciones de BEGIN y END a '''[!-- BEGIN row.report_row --]''' y '''[!-- END row.report_row --]'''.  Vea el [http://bazaar.launchpad.net/~intrahealth+informatics/ihris-manage/4.1-dev/download/head:/stafftableform.odt-20120126055155-qjun6vhyfw79qnhf-5/StaffTableForm.odt table example] del módulo de muestraEl ejemplo siguiente ha sido recortado debido al espacio.
When you want to repeat a row in a table for the rows in your report, you need to change the BEGIN and END statements to be '''[!-- BEGIN row.report_row --]''' and '''[!-- END row.report_row --]'''.  See the [http://bazaar.launchpad.net/~intrahealth+informatics/ihris-manage/4.1-dev/download/head:/stafftableform.odt-20120126055155-qjun6vhyfw79qnhf-5/StaffTableForm.odt table example] from the sample module for an actual fileThe example below has been truncated for space.


{| border="1" cellspacing="0" cellpadding="5" align="center"
{| border="1" cellspacing="0" cellpadding="5" align="center"
Line 101: Line 101:
|}
|}


=== Creando el Módulo ===
=== Creating the Module ===


Una vez que haya creado el archivo de plantilla ODT, necesitará crear un módulo para poner en la fila y configurar los formularios impresos para su informeEl módulo necesita un directorio odt_templates donde se pone el archivo ODT al igual que el archivo de configuración del móduloDebería requerir el módulo CustomReports-PrintedReportsODT para que el botón ''Forms Print''aparezca en la visualización de su informe.
Once you have created the ODT template file, you'll need to create a module to place the file and configure the printed forms for your reportThe module needs an odt_templates directory where you can place your ODT file as well as the module configuration fileYou should require the CustomReports-PrintedReportsODT module so the ''Forms Print'' button will appear on your report view.


Para su archivo de configuración, necesitará crear un nodo bajo la visualización del informe al que aplica esta plantillaTodos los campos que utilice en la plantilla deben estar habilitados en la visualización de informe. Los nodos '''printed_forms''' deberán estar en el nivel superior de su visualización de informe y luego un nombre único para le plantilla de formulario impresoAbajo de eso necesita definir el '''template''' que es el nombre del archivo de plantilla en el directorio odt_templates y '''displayName''' para lo que aparece cuando el usuario desee ver esta plantillaLa configuración para el módulo de muestra está más adelante con dos formularios impresos definidosEsta muestra también requiere el módulo ihris-manage-CustomReports-staff-reports ya que ahí está definida la visualización del informe staff_directory.
For your configuration file, you will need to create a node under the report view this template applies toAll the fields you use in the template must be enabled in the report view. The '''printed_forms''' node should be in the top level of your report view and then a unique name for this printed form templateBelow that you need to define the '''template''' which is the name of the template file in the odt_templates directory and '''displayName''' for what appears when the user wants to view this templateThe configuration for the sample module is below with two printed forms definedThis sample also requires the ihris-manage-CustomReports-staff-reports module since that's where the staff_directory report view is defined.


<source lang="xml">
<source lang="xml">

Revision as of 20:14, 30 September 2013

The printed forms module is used to print "standardized" or "official" forms based upon the reports in the system. For example, it might be the registration number for a nurse. The output will be an Open Office Document. This document can be read readily by Microsoft Word 2003.

Depending on your needs, you may wish to look at these other methods for standardized form generation:


What are Printed Forms?

Printed forms allow you to create an OpenDocument Text (ODT) template that can be filled in with your report data. This is based on the Standardized Letters that can be used for an individual record.

Adding a Printed Form to a Report View

There are two steps to adding a printed form to a report view. First you need to create the template file, then create a module with the template file and the configuration for the report view. For an example, you can look in the iHRIS Manage demo site modules directory for SampleStaffPrintedForm.

Creating an ODT Template

The template file needs placeholders for the fields you wish to display. There are also some other placeholders for special data. All the placeholders are surrounded by {{{ and }}}. Any formatting you apply to the placeholder will apply to the final output. You also need to signify where the block of text is that you want to repeat for each row of the database. You will surround this block with [!-- BEGIN report_row --] and [!--END report_row --]. See below for details when using a table for your output.

Here are the placeholders you can use in your file. Special placeholders being with ++. Field placeholders match the form+field name in the report view. The header placeholders can be used anywhere in the document. Some may apply only inside or outside the loop for the report.

Placeholder Applies Description
{{{++report_title}}} Outside Row Loop The title of the report.
{{{++report_description}}} Outside Row Loop The description of the report.
{{{++report_limit}}} Outside Row Loop The selected report limits when this report was generated.
{{{++user_name}}} Outside Row Loop The user name of the user who generated the report.
{{{++time}}} Outside Row Loop The time the report was run.
{{{++header+form+field}}} Any The header for the given field.
{{{++row_num}}} Inside Row Loop The current row number for the record.
{{{form+field}}} Inside Row Loop The value for the given field in the report view.
{{{form+field+width=2.0in,maxheight=3.0in}}} Inside Row Loop If the form field is an image, then extra dimensional formatting information can be provided.
{{{++limit+form+mapfield} Inside Row Loop If a limit has been set for one of the the form in this report via a MAP field, then this is the display name of the form that mapfield maps to.
{{{++limit+form+mapfield+field} Inside Row Loop If a limit has been set for one of the the form in this report via a MAP field, then this is the display value of field for the mapped form that mapfield maps to.

This is the example from the sample module. You can download the source file for this to see the formatting.

{{{++report_title}}}
{{{++report_description}}}
{{{++report_limit}}}
Report printed by {{{++user_name}}} at {{{++time}}}.
[!-- BEGIN report_row --]
{{{++row_num}}}. {{{person+surname}}}, {{{person+firstname}}}
{{{++header+facility+name}}}: {{{facility+name}}}			{{{++header+work+telephone}}}: {{{work+telephone}}}
{{{++header+position+title}}}: {{{position+title}}}			{{{++header+work+email}}}: {{{work+email}}}
{{{++header+department+name}}}: {{{department+name}}}

[!-- END report_row --]

When you want to repeat a row in a table for the rows in your report, you need to change the BEGIN and END statements to be [!-- BEGIN row.report_row --] and [!-- END row.report_row --]. See the table example from the sample module for an actual file. The example below has been truncated for space.

# {{{++header+person+surname}}} {{{++header+person+firstname}}} {{{++header+work+email}}}
[!-- BEGIN row.report_row --]{{{++row_num}}} {{{person+surname}}} {{{person+firstname}}} {{{work+email}}}[!-- END row.report_row --]

Creating the Module

Once you have created the ODT template file, you'll need to create a module to place the file and configure the printed forms for your report. The module needs an odt_templates directory where you can place your ODT file as well as the module configuration file. You should require the CustomReports-PrintedReportsODT module so the Forms Print button will appear on your report view.

For your configuration file, you will need to create a node under the report view this template applies to. All the fields you use in the template must be enabled in the report view. The printed_forms node should be in the top level of your report view and then a unique name for this printed form template. Below that you need to define the template which is the name of the template file in the odt_templates directory and displayName for what appears when the user wants to view this template. The configuration for the sample module is below with two printed forms defined. This sample also requires the ihris-manage-CustomReports-staff-reports module since that's where the staff_directory report view is defined.

<source lang="xml"> <?xml version="1.0"?> <!DOCTYPE I2CEConfiguration SYSTEM "I2CE_Configuration.dtd"> <I2CEConfiguration name="sample-staff-list-printed-form">

 <metadata>
   <displayName>Sample Staff Printed Forms</displayName>
   <description>Sample staff printed forms generated from the staff_directory report view.</description>
   <requirement name="ihris-manage-CustomReports-staff-reports">
     <atLeast version="4.1" />
     <lessThan version="4.2" />
   </requirement>
   <requirement name="CustomReports-PrintedReportsODT">
     <atLeast version="4.1" />
     <lessThan version="4.2" />
   </requirement>
   <path name="odt_templates">
     <value>./odt_templates</value>
   </path>
 </metadata>
 <configurationGroup name="sample-staff-list-printed-form"     
                     path="/modules/CustomReports/reportViews/staff_directory/printed_forms">
   <configurationGroup name="staff_form">
     <configuration name="template">
       <value>StaffForm.odt</value>
     </configuration>
     <configuration name="displayName" locale="en_US">
       <value>Staff Form</value>
     </configuration>
   </configurationGroup>
   <configurationGroup name="staff_table">
     <configuration name="template">
       <value>StaffTableForm.odt</value>
     </configuration>
     <configuration name="displayName" locale="en_US">
       <value>Staff Table</value>
     </configuration>
   </configurationGroup>
 </configurationGroup>

</I2CEConfiguration> </source>