Custom Reporting -- Creating Form Relationships: Difference between revisions

From IHRIS Wiki
No edit summary
 
(7 intermediate revisions by one other user not shown)
Line 1: Line 1:
==Generalidades==
==Overview==
===Uso para el que fue Diseñado===
===Intended Use===
Esto esta diseñado para un desarollador o administrador del sistema que tenga una idea clara de como se relacionan todos los formularios. Las posibles conecciones entre los diferentes formularios ya se encuentran mapeados en el sistema. Una relación es la descripción de una ruta entre los diferentes formularios en el sistema.
This is primarily intended for a developer or administrator of the system who has a good idea of how all the forms are related. The possible connections between the different forms are already mapped out in the system. A relationship is the description of a path between the various forms in the system.
 
En este instante, una relación es usada para [[Custom Reporting -- Creating Form Relationships|Custom Reports]]. También intendemos utilizarla para [[Custom Pages]].


Una relación de formularios es utilizada para construir consultas SQL usadas en un Reporte PersonalizadoAunque no necesite conocer ningún SQL para crear un informe, familiarizarse con bases de datos relacionadas será de ayuda.
A relationship is, at the moment, used for [[Custom Reporting -- Creating Form Relationships|Custom Reports]]We also intend to use it for [[Custom Pages]].


===Ejemplo===
A form relationship is used to build the SQL queries used in a Custom ReportAlthough you do not need to know any SQL to create a report, a passing familiarity with relational databases will help.
Necesita crear una realación de formularios en in iHRIS Manage que muestre todos los empleados actuales, sus salarios y sus supervisores. Aqui hay un equema de como definir esta relación:
*Inicie con el formulario primario 'person_position' y limitese a los puestos en los cuales el campo 'being_date' se sea nulo y el campo 'end_date' sea nulo.
*Adjunte al formulario primario el formulario 'person' donde el formulario 'person' es primario y el formulario 'person_position' secundario
*Adjunte al formulario primario el formulario 'salary' donde 'salary' es secundario a 'person_position' y donde el campo 'start_date' para 'salary' es máximo
*Adjunte al formulario primario el formulario 'position' donde el campo 'position' del formulario primario 'person_position' se mapea a ese puestoNombre a este formulario 'employee_position'.
*Adjunte al formulario 'position' el formulario 'position' donde el campro 'supervisor' del formulario 'position' se mapea a ese puesto. Nombre a este formulario conjunto 'supervisor_position'para distinguirlo del formulario 'employee_position'.
*Adjunte al 'supervisor_position' el formulario 'person_position' del cual el campo 'position' es el valor del formulario 'supervisor_position'.  Nombre a este 'supervisor_person_position'
*Adjunte el formulario 'supervisor_person_position' el formulario 'person' que es un formulario primario. Nombre a este 'supervisor'


===Alguna Terminología===
===Example===
*En ocaciones a una relación se le llama "relación de formulario" o "relación de informe"
You may wish to create a form relationship in iHRIS Manage that describes all current employees, their salaries,  and their supervisors.  Here is an outline of how to define this relationship:
*El "primary_form" es el punto inicial para describir el formulario en la relación.
*Start with the primary form 'person_position' and limit to those positions which the 'being_date' field is not null and the 'end_date' field is null.
*Un formulario puede ser mencionado varias veces en una relación. En el ejemplo anterior, el formulario, the person_position fue mencionado dos vecesUna vez se le dio el "nombre de informe del formulario" 'person_position' y una vez se le dio el "nombre de informe del formulario" 'supervisor_person_position'.  De forma similar, el formulario person fue mencionado dos veces y se le dieron los dos "nombres de informe del formulario" de 'person' y 'supervisor'
*Join to the primary form the 'person' form where the 'person' form is a parent of the 'person_position' form
*Alguna de la terminología, tal como 'adjuntar,' es tomada de SQL.
*Join to the primary form the 'salary' form where 'salary' is a child of 'person_position' and where the 'start_date' field for 'salary' is maximal
*Join to the primary form the 'position' form where the field 'position' of the primary 'person_position' form maps to that positionCall this the 'employee_position' form.
*Join to the 'position' form the 'position' form where the 'supervisor' field of the 'position' form maps to that positionCall this joined form the 'supervisor_position' to distinguish it from the 'employee_position' form.
*Join to the 'supervisor_position' the 'person_position' form whose 'position' field is the value of 'supervisor_position' form.  Call this the 'supervisor_person_position'
*Join to the 'supervisor_person_position' form the 'person' form which is a parent of the form. Call is the 'supervisor'


==Dando Inicio==
===Some Terminology===
Una relación de formulario puede ser creada siguiendo el "Sistema de Configuración" y luego el link "Editar Relación de Formulario" .
*A relationship is some times referred to as a "form relationship" or a "report relationship"
Los primeros pasos son:
*The "primary_form" is the starting point in describing the form in your relationship.
*seleccione "Display Name" para la relación,  el nombre de la relación para el usuario final.
*A form can be referenced several times in a relationship. In the example above, the person_position form was referenced twice.  Once we gave it the "report form name" 'person_position' and once we gave it the "report form name" 'supervisor_person_position'Similarly, the person form was referenced twice and given the two distinct "report form names" of 'person' and 'supervisor'
*seleccione un "Short Name" para el informe, lo cual es una manera de hacer referencia internamente a la relación y solo puede contener caracteres alfa-numericos y algunos signos limitados de puntuación tales como _ y -.   
*Some of the terminology, such as 'join,' is borrowed from SQL.
*Una descripción de la relación.
*Luego debe hacer una de las opciones siguientes:
**Escoger el "primary_form" para la realción
**Copiar los detalles existente de la relación de formulario a modificar


==Adjuntar un Formulario==
==Starting Out==
Una vez que un formulario, formA, está en una relación, se puede adjuntar a cualquiera de sus formularios realacionados. Debe asegurarse, al agregar un [[#Limiting Forms|limit]], que máximo una instancia del formB se adjunte a otra instancia del formA. Hay cuatro posibles formas para adjuntar:
A form relationship can be created following the "Configure System" and then the "Edit Form Relationship" linka.
*(Una instancia de) formA es primaria en relación al (una instancia de) formB.   
The first steps are to:
**puede que formA tenga varias instancias secundarias del formB.  Por ejemplo, un formulario 'person' puede tener un formulario 'salary' secundario.  
*select a "Display Name" for the relationshipthe name of the relationship for the end user.
*(Una instancia de) formA es secundaria al (una instancia de) formB. 
*select a "Short Name" for the report, which is a way to reference the relationship internally and can only contain alpha-numeric characters and some limited punctuation such as _ and -.   
**Nótese que un formulario, si tiene un formulario primario, es único, por lo que al adjuntarse de esta forma no se necesitan límites.
*A description of the relationship.
*(Una instancia de) formA contiene una [[Defining Forms#Map fields|mapped field]] cuyo valor se mapea al (una instancia de) formB.
*The you must do one of the following:
*(Una instancia de) formB contiene una [[Defining Forms#Map fields|mapped field]] uyo valor se mapea al (una instancia de) formA.
**Choose the "primary_form" for the relationship
**Copy the details existing form relationship to modify


==Limitando un Formulario==
==Joining a Form==
El formulario primario y cualquier formulario ajuntado en una relación puede ser limitado al usar la estructura [[Limiting Forms|limiting forms]] structure.  La relación de formulario brinda una interfaz agradable para construir límites de formularios.
Once a form, formA, is in a relationship, you can join to it any of its related forms.  You must ensure, by adding a [[#Limiting Forms|limit]], that at most one instance of the formB is joined to another an instance of formA.  There are four possible ways to join:
*(An instance of) formA is a parent of (an instance of) formB. 
**formA may have several child instances of formB.  For example, a 'person' form may have may child 'salary' forms.
*(An instance of) formA is a child of (an instance of) formB. 
**Note that a form, if it has a parent form, is unique, so no limits are needed when joining in this manner.
*(An instance of) formA contains a [[Defining Forms#Map fields|mapped field]] whose value maps to (an instance of) formB.
*(An instance of) formB contains a [[Defining Forms#Map fields|mapped field]] whose value maps to (an instance of) formA.
 
==Limiting a Form==
The primary form and any joined forms in a relationship may be limited by using the [[Limiting Forms|limiting forms]] structure.  The form relationship provides a nice interface to construct form limits.


==Adding in a SQL Function==
==Adding in a SQL Function==
Line 58: Line 58:




[[Category:Technical Overview]][[Category:Reports]][[Category:Forms]][[Category:Review2013]]
[[Category:Custom Reporting]][[Category:Review2013]]

Latest revision as of 14:23, 8 November 2013

Overview

Intended Use

This is primarily intended for a developer or administrator of the system who has a good idea of how all the forms are related. The possible connections between the different forms are already mapped out in the system. A relationship is the description of a path between the various forms in the system.

A relationship is, at the moment, used for Custom Reports. We also intend to use it for Custom Pages.

A form relationship is used to build the SQL queries used in a Custom Report. Although you do not need to know any SQL to create a report, a passing familiarity with relational databases will help.

Example

You may wish to create a form relationship in iHRIS Manage that describes all current employees, their salaries, and their supervisors. Here is an outline of how to define this relationship:

  • Start with the primary form 'person_position' and limit to those positions which the 'being_date' field is not null and the 'end_date' field is null.
  • Join to the primary form the 'person' form where the 'person' form is a parent of the 'person_position' form
  • Join to the primary form the 'salary' form where 'salary' is a child of 'person_position' and where the 'start_date' field for 'salary' is maximal
  • Join to the primary form the 'position' form where the field 'position' of the primary 'person_position' form maps to that position. Call this the 'employee_position' form.
  • Join to the 'position' form the 'position' form where the 'supervisor' field of the 'position' form maps to that position. Call this joined form the 'supervisor_position' to distinguish it from the 'employee_position' form.
  • Join to the 'supervisor_position' the 'person_position' form whose 'position' field is the value of 'supervisor_position' form. Call this the 'supervisor_person_position'
  • Join to the 'supervisor_person_position' form the 'person' form which is a parent of the form. Call is the 'supervisor'

Some Terminology

  • A relationship is some times referred to as a "form relationship" or a "report relationship"
  • The "primary_form" is the starting point in describing the form in your relationship.
  • A form can be referenced several times in a relationship. In the example above, the person_position form was referenced twice. Once we gave it the "report form name" 'person_position' and once we gave it the "report form name" 'supervisor_person_position'. Similarly, the person form was referenced twice and given the two distinct "report form names" of 'person' and 'supervisor'
  • Some of the terminology, such as 'join,' is borrowed from SQL.

Starting Out

A form relationship can be created following the "Configure System" and then the "Edit Form Relationship" linka. The first steps are to:

  • select a "Display Name" for the relationship, the name of the relationship for the end user.
  • select a "Short Name" for the report, which is a way to reference the relationship internally and can only contain alpha-numeric characters and some limited punctuation such as _ and -.
  • A description of the relationship.
  • The you must do one of the following:
    • Choose the "primary_form" for the relationship
    • Copy the details existing form relationship to modify

Joining a Form

Once a form, formA, is in a relationship, you can join to it any of its related forms. You must ensure, by adding a limit, that at most one instance of the formB is joined to another an instance of formA. There are four possible ways to join:

  • (An instance of) formA is a parent of (an instance of) formB.
    • formA may have several child instances of formB. For example, a 'person' form may have may child 'salary' forms.
  • (An instance of) formA is a child of (an instance of) formB.
    • Note that a form, if it has a parent form, is unique, so no limits are needed when joining in this manner.
  • (An instance of) formA contains a mapped field whose value maps to (an instance of) formB.
  • (An instance of) formB contains a mapped field whose value maps to (an instance of) formA.

Limiting a Form

The primary form and any joined forms in a relationship may be limited by using the limiting forms structure. The form relationship provides a nice interface to construct form limits.

Adding in a SQL Function

In addition to linking in forms to a report, we can define SQL functions that can be run on the data in the forms. To reference the field named $fieldName in the form named $reportFormName in the relationship you use:

`$reportFormName+$fieldName`

For example:

CONACT (SUBSTR(`supervisor+name`,1,1), '. ',  SUBSTR(`supervisor+surname`,1,1) , '.')

would return the initials of the supervisor.

To define a sql function, you need to define:

  • A (short) name use to reference the function. For example, 'supervisor_initials.'
  • A description of the function. For example, "The Initials of the Supervisor."
  • The form field that the result of the SQL function should take values in. For example, "STRING_LINE"