Generador de informes

El Generador de informes es una herramienta que crea informes de su base de datos. A diferencia del Asistente para informes, el Generador de informes le permite controlar el diseño del informe según sus preferencias. El informe generado es un documento de Writer que puede editar más adelante.

note

Para utilizar el Generador de informes, es necesario instalar el programa Entorno de ejecución de Java (JRE) y seleccionar este programa en LibreOffice.


Para instalar el programa JRE

El Generador de informes requiere un entorno de ejecución de Java (JRE) instalado.

  1. Vaya a  ▸ LibreOffice ▸ Avanzado.

  2. Espere hasta un minuto, mientras LibreOffice recopila información sobre el programa Java instalado en su sistema.

    Si se encuentra una versión reciente de JRE en su sistema, verá una entrada en la lista.

  3. Pulse el botón de opción delante de la entrada para habilitar esta versión de JRE para su uso en LibreOffice.

  4. Asegúrese de que la opción Utilizar un entorno de ejecución Java está activada.

Si no se encuentra ninguna versión de JRE en su sistema, abra su navegador web y descargue el programa JRE desde http://www.java.com. Instale el programa JRE. A continuación, reinicie LibreOffice y abra nuevamente - LibreOffice - Avanzado.

Para abrir el Asistente para informes

  1. Abra un archivo de Base o cree una nueva base de datos. La base de datos debe contener, al menos, una tabla con, al menos, un campo de datos y un campo de clave primaria.

  2. Pulse el icono Informes en el panel Base de datos, luego seleccione Crear informe en la vista de diseño.

    Se abre la ventana del generador de informes.

El generador de informes está dividido en tres partes. En la parte superior se encuentra el menú, con las barras de herramientas debajo.

A la derecha aparece la ventana Propiedades, con los valores de las propiedades del objeto actualmente seleccionado.

La parte izquierda de la ventana del Generador de informes muestra la vista del Generador de informes. La vista del Generador de informes está inicialmente dividida en tres secciones, de arriba a abajo:

  1. Cabecera de página - arrastra los campos de control con texto fijo al área Cabecera de página

  2. Detalle - arrastre y suelte los campos de la base de datos en el área Detalle

  3. Page Footer - drag control fields with fixed text into the Page Footer area

To insert an additional Report Header and Report Footer area choose Edit - Insert Report Header/Footer. These areas contain text that appears at the start and end of the whole report.

Click the "-" icon in front of an area name to collapse that area to one line in the Report Builder view. The "-" icon changes to a "+" icon, and you can click this to expand the area again.

You insert database fields by drag-and-drop into the Detail area. See the section "To insert fields into the report" below.

In addition, you can click the Label Field or Text Box icon in the toolbar, then drag a rectangle in the Page Header or Page Footer area, to define a text that is the same on all pages. You enter the text in the Label box of the corresponding Properties window. You can also add graphics by using the Graphics icon.

To connect the report to a database table

  1. Move the mouse to the Properties view. You see two tab pages General and Data.

  2. On the Data tab page, click Content to open the combo box.

  3. Seleccione la tabla para la que desea crear el informe.

  4. After selecting the table, press the Tab key to leave the Content box.

La ventana Añadir campos al informe se abre automáticamente y muestra todos los campos de la tabla seleccionada.

Añadir campos al informe

La ventana Añadir campo ayuda a insertar las entradas de la tabla en el informe.

After inserting fields in the Detail view, the report is ready for execution.

Para ejecutar un informe

Pulse en el icono Ejecutar informe en la barra de herramientas.

Icono Ejecutar informe

Icono Ejecutar informe

A Writer document opens and shows the report you have created, which contains all values of the database table which you have insert.

If the database contents did change, execute the report again to update the result report.

Para editar un informe

First decide if you want to edit the generated report, which is a static Writer document, or if you want to edit the Report Builder view and then generate a new report based on the new design.

The Writer document is opened read-only. To edit the Writer document, click Edit Document on the information bar, or choose Edit - Edit Mode.

If you want to edit the Report Builder view, you can change some of its properties.

Click in the Details area. Then in the Properties window, change some properties, for example the background color.

After finishing, click the Execute Report icon to create a new report.

Icono Ejecutar informe

Icono Ejecutar informe

If you close the Report Builder, you will be asked if the report should be saved. Click Yes, give the report a name, and click OK.

Ordenar el informe

Without sorting or grouping, the records will be inserted into the report in the order in which they are retrieved from the database.

  1. Abra el Generador de informes y, en la barra de herramientas, pulse en el icono Ordenar y agrupar. Verá el cuadro de diálogo Ordenar y agrupar.

Icono Ordenar y agrupar

Icono Ordenar y agrupar

  1. In the Groups box, click the field which you want as the first sort field, and set the Sorting property.

  2. Ejecute el informe.

Agrupación

  1. Abra el Generador de informes y, en la barra de herramientas, pulse en el icono Ordenar y agrupar. Verá el cuadro de diálogo Ordenar y agrupar.

  2. In the Groups box, open the Group Header list box and select to show a group header.

  3. Click the Add Field icon to open the Add Field window.

Icono Añadir campo

Icono Añadir campo

  1. Drag-and-drop the field entry that you want to group into the group header section. Then drag-and-drop the remaining fields into the Detail section.

  2. Execute the report. The report shows the grouped records.

Si quiere realizar ordenaciones o agrupamientos, abra la vista del Generador de informes y, a continuación, el cuadro de diálogo Ordenar y agrupar. Muestre la cabecera de grupo de los campos que quiera agrupar y oculte la cabecera de grupo de los campos que quiera ordenar. Cierre la ventana Ordenar y agrupar y ejecute el informe.

Actualizar e imprimir sus datos

Cuando inserte datos nuevos o modifique existentes en una tabla, un informe nuevo mostrará los datos nuevos.

Pulse en el icono Informes y pulse dos veces sobre el último informe guardado. Se creará un documento de Writer con los datos nuevos.

Icono Informes

Icono Informes

Para imprimir un informe, diríjase a Archivo ▸ Informes desde el documento de Writer.