{{sidenavigation.sidenavigationExpandLabel}}
{{getMsg('Help_YouAreHere')}}: {{page.title}} {{page.title}}
{{$root.getMsg("downLoadHelpAsPdf")}} {{helpModel.downloadHelpPdfDataStatus}}

Report with Database Connection

Configure Data Sources

If this is the first time you start i-net Designer, you should first configure your Data Source Configurations that you will use in your report. To do this, select "Options | Data Source Manager...". This opens the Data Source Manager dialog with which you can create and/or modify the data sources.

Data Source Manager

If you would like to add a JDBC driver that you have not selected during setup, just copy the .jar file of the driver into the "lib/driver" directory and restart the i-net Designer.

Setting up a new Report

To create a new report in the i-net Designer you can click on the New button toolbar , on the menu item "File | New..." or you use the links in the welcome page.

The Database Wizard

Using the Database Wizard dialog you can define which database and which tables, views or stored procedures will be used in the report. This is what you should see on entering the Database Wizard for the first time:

Database Wizard

  • Click on the button "New Connection" on the top of the database browser on the left side of the dialog.
  • After you have selected the datasource to use (e.g. Sample Database), expand the nodes until you see a list of tables.
  • Select a table (e.g. [Employees]) and drag it onto the area on the right side of the wizard, or double click on the table name to add it
  • Similarly, add a second table (e.g. [Orders]).
  • To create a link between field(s) of the two tables you can drag with the mouse from the field [EmployeeID] in one table to the field in the other table.

Report Wizard - Database Wizard - Select Tables

  • Between the two tables you can see a line connecting both fields [EmployeeID]. This line has arrows and a symbol to represent the link type. If you move the tables then you can see it better. With the context menu you can change the link type. In most cases the EQ (equals) type is the best solution.

Report Wizard - Join Tables

Insert a Database Field

  • After you have added a table, stored procedure or you have created a command in the Database Wizard you can expand the node "Database Fields" in the Fields Browser. Let's say you choose the tables [Customers] and [Orders], then it would look like this:

Field Browser

  • Drag some database fields from the Field Browser into the Detail area of your report. For example, you could use the fields [CustomerID], [CompanyName] and [ContactName].
  • Click on the result tab and you can see the final report. You will notice that the width of [CompanyName] is too small.
  • Click on the Design tab and change the width of [CompanyName]. You can verify the result in the result tab.

Sort the report result

  • Now we will add some sorting to the report.
  • Open the dialog "Sort Records" with a click on the button "Sorting Records" in the toolbar or on the menu item "Report | Sort Records".
  • Add a field (e.g. [ContactName]) to the sorting list and set the sorting direction for this field. The default value is ascending.
  • Click "Ok" on the result tab.

Report Wizard - Sort Records

Create a dynamic Formula

  • Select the node "Formula Fields" in the Field Browser.
  • Click the New button of the Field Browser (not the New button in the toolbar of i-net Designer).
  • Enter a formula like the following in the text area of the formula editor:
if {Customers.ContactName} like "Alex*" then
    "Alex"
else
    "Other"
  • Enter a name for the formula in the field "Formula Name" and save the formula with a click on the "OK" button.

Formula Editor

  • Drag this formula field from the Field Browser into the report Detail area. In addition to the formula field you can add the database field [Customers.ContactName] into the Detail area to see the original name.

Designer - Design View 

  • On the result tab you can see the report preview in the Java viewer. All names starting with "Alex" will be displayed as "Alex" and all the others as "Other".

Designer - Result View

Formatting an element with a Formula

  • To open the dialog "Font Properties" right click on the element [Customers.ContactName] in the report (not in the Field Browser) and select the menu item "Font Properties" in the popup menu.
  • Click on the formula button of the property "Color"

Property Editor - Font Properties

  • and enter a formula, e.g.:
if CurrentFieldValue like "Alex*" then
    red
else
    green
  • On the result tab you can see the report preview in the Java viewer. All names in the element [Customers.ContactName] starting with "Alex" will be displayed in red and all the others in green.

Designer - Result View

i-net Clear Reports
This application uses cookies to allow login. By continuing to use this application, you agree to the use of cookies.


Help - Reports with Database Connection