Quick Start: Create a report
Creating a report involves setting up a project to store the report files, developing a report application, designing the report, and testing the report.
Before you begin: Ensure that you have set the report environment correctly.
This procedure is provided to give you a quick start, or overview, for creating a report application.
-
Create the project.
A project contains the nodes for storing and managing your report application files.
- Select File > New > Genero > Simple Project (.4pw) and click OK.
- Select File > Save as and complete the dialog to save your project.
The project tree should have a Group node, and the Group node should contain an Application node, a Databases node, and a Library node. You can rename these nodes to more meaningful names. -
Set up the project's Application node.
- Right-click on your Application node to create the files and folders. For example, create two virtual folders named src and reports.
-
Set the Language property of the Application
node to
Genero (no link)
.
-
Create your report application. For example, right-click on the src
node, select New File > Genero > Source (.4gl), and create a file named myreport.4gl.
Note:
The Genero report application (4gl) is responsible for reading data from a database (or alternate data source) and streaming it to the Genero Report Engine. For more information, see Writing the Genero BDL report program.
-
Generate the data schema by selecting the 4gl source file and setting its
Compiler options property to
--build-rdd
.Note:The data schema (rdd) file identifies the fields and the grouping of data streamed by the Genero reporting application to the Genero Report Engine. It is used by the report design document, giving the designer the ability to select fields for placement on a report and setting report triggers. For more information, see Generate a data schema from a Genero BDL report program.
-
Create a report design document (.4rp).
-
Select File > New > Report from Template, select one of the available templates, and click OK.
Note:
You can also start with an empty report design document using File > New > Reports > Empty Report (.4rp) or > List Report (.4rp), and then select the data schema (rdd) on the Data View tab.
-
Follow the steps in the New Report from Template wizard to select a data schema and add fields.
You can now see the report design document in the main work area and the data on the Data View tab. For further information, see Create a report from an existing template.
- Report output can be output in various formats. Select File > Report properties > Output configuration to change the default output for the report.
-
Save the report design document and add it to the reports virtual folder in your application
node.
For more information on working with the report design document, see Create a report design document.
-
Select File > New > Report from Template, select one of the available templates, and click OK.
-
Open the source (.4gl) file and add the necessary code to your report application.
Tip:
Use the code from Creating a simple report as a basis.
Ensure that your code:- References the data schema.
- References the report design document.
-
Build the report application.
Right-click the report application node or the report group node in the Genero Studio Projects tab and select Build to compile and link the application.