|
|
|
|
|
- Overview
- The different sort criteria
- Adding a sort criterion
- How to?
- Modifying a sort criterion
- Modifying a sort criterion in a report based on a data file or on a memory area
- Modifying the sort direction of a criterion found in a report based on a query
- Deleting a sort criterion
- Deleting a sort criterion
- Sort procedure
The sort is used to organize the information displayed in the report. Several sorts can be performed simultaneously: these sorts will be performed according to the display order of the sort criteria. In the following example, in the wizard for report creation, the sort mode is defined: the data selected in the "Customer" file will be sorted according to the name of the country, then for each region, according to the name of the customer.
The sort criteria can be defined for a report based: - on a data file.
- on a query.
- on a memory zone.
The different sort criteria A sort criterion can correspond to: - an item. The sort will be performed on this item.
- a procedure name of the project (for example: "MyProc( )"). This procedure must return the value on which the sort will be performed. The procedure can accept parameters. This procedure can be global to the project or local to the report.
For more details, see Sort procedure. - an expression based on a WLanguage function (for example: "Left(Customer.ZipCode,2)"). This function must return the value on which the sort will be performed.
- a combination of the previous criteria.
Remark: The sorts will be performed according to the display order in the table that lists the sort criteria. Adding a sort criterion to a report can be done: - in the wizard for report creation.
- in the description of an existing report.
Remark: If the report is based on a query, a sort criterion can also be added from the query editor. For more details, see Sorting the query records. How to? - To add a sort criterion:
- in a report being created, go to the step of the wizard relative to sort criteria.
- in an existing report, on the "Modification" tab, in the "Report" group, click "Edit sorting". The list of sort criteria is displayed.
- Click the "New sort criterion" button (
). - To add:
- a sort item: Select "Sort on an item" and select the sort item.
The "<Multi-file>" option and the "Other" button are used to select an item via one or two cascading joins. - a sort procedure: select "Sort on WLanguage code" and enter the name of the sort procedure (for example: "MyProc( )").
For more details, see Sort procedure. - a WLanguage function: select "Sort on WLanguage code" and enter the name of the WLanguage function that returns the value on which the sort must be performed.
By default, the report editor proposes several WLanguage functions. To use one of these functions: - click the "Function" button, - select the requested function, - validate, - replace the parameters by the requested values.
- Validate the addition of the new sort criterion.
- Modify (if necessary) the sort direction of the criterion by clicking the "Sort direction" button or by clicking the arrow found in the table. If a break is defined on this sort criterion, the break will also be modified.
- Modify (if necessary) the order in which the sorts are performed via the arrow keys found on the right of the table. The sorts will be performed according to the display order of the sort criteria.
Modifying a sort criterion Modifying the sort in a report can be done: - in the wizard for report creation.
- in the description of an existing report.
Remarks: - A sort criterion can be modified from the editor for the reports based on a data file or on a memory zone.
- You also have the ability to modify the sort direction of a criterion found in a report based on a query.
Modifying a sort criterion in a report based on a data file or on a memory area To modify a sort criterion in a report based on a data file or on a memory area: - To modify a sort criterion:
- in a report being created, go to the step relative to sort criteria.
- in an existing report, on the "Modification" tab, in the "Report" group, click "Edit sorting". The list of sort criteria is displayed.
- Select the sort criterion to modify.
- To modify the selected sort criterion by adding:
- a sort item: click the "Item" button and select the item on which the sort will be performed.
To select an item linked to the base file of the report via one or two cascading joins, select "Multi File". - a sort procedure:
- click the sort criterion. The sort criterion automatically switches to edit. - enter the name of the sort procedure (for example: "MyProc( )"). For more details, see Sort procedure. - a WLanguage function:
- click the sort criterion. The sort criterion automatically switches to edit.
- enter the WLanguage function that returns the value on which the sort will be performed.
The report editors proposes several WLanguage functions used to perform sorts in the reports. To use one of the available functions:- click the "Function" button,
- select the requested function,
- validate,
- replace the parameters by the requested values.
- Modify (if necessary) the sort direction of the criterion by clicking the "Sort direction" button or by clicking the arrow found in the table. If a break is defined on this sort criterion, the break will also be modified.
- Modify (if necessary) the order in which the sorts are performed via the arrow keys found on the right of the table. The sorts will be performed according to the display order in the table that lists the sort criteria.
Modifying the sort direction of a criterion found in a report based on a query To modify the sort direction of a criterion found in a report based on a query: - On the "Modification" tab, in the "Report" group, click "Edit sorting". The list of sort criteria is displayed.
- Select the sort criterion to modify.
- Modify the sort direction of the criterion by clicking the "Sort direction" button or by clicking the arrow found in the table. If a break is defined on this sort criterion, the break will also be modified.
- Modify (if necessary) the order in which the sorts are performed via the arrow keys found on the right of the table. The sorts will be performed according to the display order in the table that lists the sort criteria.
Remark: The sort direction of a criterion can also be modified from the query editor. For more details, see Sorting the query records. Deleting a sort criterion Deleting a sort criterion from a report can be done: - in the wizard for report creation.
- in the description of an existing report.
Remark: If a break is defined for this sort criterion, the break will also be deleted. Deleting a sort criterion To delete a sort criterion: - To delete a sort criterion:
- in a report being created, go to the step relative to sort criteria.
- in an existing report, on the "Modification" tab, in the "Report" group, click "Edit sorting". The list of sort criteria is displayed.
- Select the sort criterion to delete.
- Click
.
A sort procedure can be implemented in a report based on a data file or in a report based on a memory area. This procedure can be used to modify the sort criteria dynamically. To implement a sort procedure: - On the "Modification" tab, in the "Report" group, click "Edit sorting". The list of sort criteria is displayed.
- Click the "New sort criterion" button (
). - Check "Sort on WLanguage code".
- Enter the name and value of the sort procedure parameters (for example: "SortVal("City")").
- Validate the addition of the new sort criterion.
- Create the sort procedure. This procedure must return the sort argument. For example:
PROCEDURE SortVal(Criterion) // Sort by NAME or by CITY SWITCH Criterion CASE "City": RESULT Customer.City CASE "Name": RESULT Customer.Name END
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|