|
- Overview
- Creating a report on an SQL query on file via a connection
- Printing a report based on an SQL query via a connection
- WINDEV and WEBDEV example
Report on an SQL query performed on a connection (ODBC, ...)
 Not available with these kinds of connection
Warning
From version 19, this type of report is not available in creation anymore. The existing reports continue to operate and they can be modified.
A report on an SQL query via a connection is used to print the records coming from a database accessible via a specific ODBC driver or via a Native Connector. This query is defined when creating the report. Remark: To optimize the resources used on a Mobile Device (Pocket PC), printing a report based on an SQL query via a connection is not available in WINDEV Mobile. Characteristics of a report based on an SQL query via a connection: - the connection parameters (name of the connection, name of the user, ...). These parameters allows you to access the records that will be printed in the report.
For an ODBC connection, the parameters are defined in the ODBC administrator (in the control panel of Windows). For a connection via Native Access, the parameters are defined when configuring the database. - the SQL code of the query associated with the report. This code must correspond to a Select query ("SELECT"). This query is used to specify the items that will be printed in the report.
Caution: The SQL code must be recognized by the database accessed. The creation of a report based on an SQL query via a connection is performed by the wizard for report creation. Once the report on an SQL query via a connection is created, you can: - modify the SQL code of query ("Data" tab in the report description).
- modify the parameters of the connection ("Data" tab of the report description).
- add or delete Item controls linked to the SQL query associated with the report.
Creating a report on an SQL query on file via a connection To create a report on an SQL query on file via a connection: - Select "File .. New .. Report". The report creation wizard starts.Click
among the quick access buttons.- Click "Report" in the wheel that is displayed. The element creation window appears: click "Report" then "Report".
- The report creation wizard starts.
- Choose the layout of your report (table, form, label, ...). See The different types of reports for more details.
- Select the data source of the report ("From a SQL query by connection").
- Select the type of connection to use (ODBC or Native Access)
- Specify the connection parameters:
- the connection name.
- the last user name.
- the user password.
- the name of database accessed (if there is more than one).
- Enter the SQL code of the query associated with the report.
Caution: The SQL code must be recognized by the database accessed. - To group the records, you have the ability to create breaks on the sort items. To create breaks, answer "Yes" to the question "Do you want to add breaks into the report".
The next step is used to select the sort items corresponding to the breaks. See Breaks in a report for more details. - For each query item displayed in the report:
- type the corresponding caption. This caption will be displayed:
- before the item. For example:
- in the column header (for the Table reports). For example: This caption can be modified in the report editor.
- select the block where the control associated with the item will be printed. The positions of different controls can be modified in the report editor. See Report blocks for more details.
- Modify (if necessary) the display order of controls in the report with the arrow buttons found on the right of table.
- Depending on the type of report currently created, indicate the specific options.
| | Type of report | Specific options |
---|
Type of report: Table + Chart | Type of chart, aspect of chart, ... Options presented in Table + Chart report | Chart report | Type of chart, aspect of chart, ... Options presented in Chart report | Report on form | Form image, printing the form image, ... Options presented in Report on form | Label report | Format of labels, number of identical copies, ... Options presented in Label report |
| | Type of report | Specific options |
---|
Report on form | Form image, printing the form image, ... Options presented in Report on form | Label report | Format of labels, number of identical copies, ... Options presented in Label report |
- Specify the format of sheet on which the report will be printed. The report is printed in A4 format by default.
- Select the skin template of report if necessary.
- Type the name and title of report (name of ".WDE" file corresponding to the report). This name will identify the report in your programs.
- Validate the report creation.
- The report editor automatically proposes to change the report format if the following conditions are fulfilled:
- the report currently created includes a table.
- the report format does not allow to display all table columns.
- Specify (if necessary) the mode for reducing the report size:
Versions 19 and laterPrint the report on several pages. In this case, the end user will have to group the pages. See Multi-page print for more details. New in version 19Print the report on several pages. In this case, the end user will have to group the pages. See Multi-page print for more details. Print the report on several pages. In this case, the end user will have to group the pages. See Multi-page print for more details.- Use the landscape mode.
- Reduce the report size. Caution: according to the reduction percentage, the printed report may become unreadable.
- The report currently created is displayed in the report editor.
Printing a report based on an SQL query via a connection To print a report based on a SQL query via a connection, you must: - Configure the report print destination:
- Specify the name of report to print with iPrintReport.
Remarks: To optimize the resources used on a mobile device, printing a report based on a SQL query via a connection is not available in WINDEV Mobile. - ..ODBCPassword, ..ODBCDatabaseName, ..ODBCConnectionName and ..ODBCUserName used in the report code allow you to find out and modify the connection parameters.
- ..ODBCSQLCode used in the report code allows you to find out and modify the SQL code of the SQL query.
This page is also available for…
|
|
|
| |
| Click [Add] to post a comment |
|
| |
|
| |
| |
| |
| |
| |
| |
| | |
| |