+ All Categories
Home > Documents > DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users...

DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users...

Date post: 20-Jul-2021
Category:
Upload: others
View: 14 times
Download: 0 times
Share this document with a friend
189
DataFlex Reports User Guide Create reports to get relevant information out of your data
Transcript
Page 1: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

DataFlex Reports

User Guide Create reports to get relevant information out of your data

Page 2: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 2 of 189 z

Business Software for a Changing WorldTM

Please forward all your findings (suggestions, bugs in the documentation) to [email protected].

Technical support:

Internet: http://www.dataaccess.com

Forums: http://support.dataaccess.com/forums

E-mail: [email protected]

Revision Date: December, 2014

DataFlex Reports User Guide

Page 3: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 3 of 189 z

Business Software for a Changing WorldTM

COPYRIGHT NOTICE

© 2009-2014 DATA ACCESS CORPORATION. All rights reserved.

No part of this publication may be copied or distributed, transmitted, transcribed, stored in a retrieval system,

or translated into any human or computer language, in any form or by any means, electronic, mechanical,

magnetic, manual, or otherwise, or disclosed to third parties without the express written permission of Data

Access Corporation, Miami, Florida, USA.

DISCLAIMER

Data Access Corporation makes no representation or warranties express or implied, with respect to this

publication, or any Data Access Corporation product, including but not limited to warranties of merchantability

or fitness for any particular purpose.

Data Access Corporation reserves to itself the right to make changes, enhancements, revisions and alterations of

any kind to this publication or the product(s) it covers without obligation to notify any person, institution or

organization of such changes, enhancements, revisions and alterations.

TRADEMARKS

DataFlex is a trademark of Data Access Corporation.

DB2 is a registered trademark of IBM Corporation.

Pervasive.SQL is a registered trademark of Pervasive Software, Inc.

Windows Server 2008, Windows Server 2003, Windows 7, Windows Vista, Windows XP, Windows ME, Windows

2000 and Windows 98 are registered trademarks of Microsoft Corporation.

All other company, brand, and product names are registered trademarks or trademarks of their respective

holders.

Page 4: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 4 of 189 z

Business Software for a Changing WorldTM

Table of Contents

1. Welcome to DataFlex Reports! ................................................................... 8

2. Getting started with DataFlex Reports ........................................................ 9

2.1 Creating a new report using the Report Creation Wizard ............................................... 10

2.2 Create a new report using a blank report......................................................................... 17

2.3 Create a new report based on an existing report ............................................................ 17

3. Charts ........................................................................................................ 18

3.1 Adding a chart .................................................................................................................... 18

3.2 Chart types ......................................................................................................................... 19

3.3 Modifying the layout and appearance of a chart ............................................................. 20

3.4 Changing the datasource of a chart .................................................................................. 23

4. The File menu ........................................................................................... 24

4.1 Export.................................................................................................................................. 24

4.2 Options ............................................................................................................................... 26

5. The Edit menu ........................................................................................... 29

5.1 Undo and Redo .................................................................................................................. 29

5.2 Cut, Copy, Paste and Delete .............................................................................................. 29

5.3 Select all .............................................................................................................................. 29

5.4 Find ..................................................................................................................................... 29

5.5 Go to page .......................................................................................................................... 29

5.6 Object ................................................................................................................................. 29

6. The View menu ......................................................................................... 30

6.1 Field explorer...................................................................................................................... 30

6.2 Report explorer .................................................................................................................. 32

6.3 Repository explorer............................................................................................................ 34

6.4 Arrange Objects ................................................................................................................. 34

7. The Insert menu ........................................................................................ 36

7.1 Field heading ...................................................................................................................... 36

7.2 Summary ............................................................................................................................. 36

Page 5: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 5 of 189 z

Business Software for a Changing WorldTM

7.3 Group .................................................................................................................................. 37

7.4 Function field...................................................................................................................... 37

7.5 Text object .......................................................................................................................... 38

7.6 Line, Box and Picture ......................................................................................................... 38

7.7 Chart object ........................................................................................................................ 38

7.8 Sub-report .......................................................................................................................... 39

8. The Format menu ..................................................................................... 40

8.1 Font ..................................................................................................................................... 40

8.2 Lock size/position ............................................................................................................... 40

8.3 Suppress field ..................................................................................................................... 40

8.4 Field properties .................................................................................................................. 40

8.5 Move ................................................................................................................................... 49

8.6 Align .................................................................................................................................... 50

8.7 Size ...................................................................................................................................... 50

9. The Database menu .................................................................................. 51

9.1 Database expert ................................................................................................................. 51

9.2 Check database .................................................................................................................. 56

9.3 Set datasource location ..................................................................................................... 58

9.4 Edit RDS Sample Data ........................................................................................................ 58

9.5 Browse data ........................................................................................................................ 59

9.6 Show SQL query ................................................................................................................. 59

9.7 Select distinct records ........................................................................................................ 59

10. The Report menu ...................................................................................... 60

10.1 Filter expert ........................................................................................................................ 60

10.2 Filter function ..................................................................................................................... 61

10.3 Page Layer Expert ............................................................................................................... 61

10.4 Section expert .................................................................................................................... 62

10.5 Function Explorer ............................................................................................................... 64

10.6 Group expert ...................................................................................................................... 65

10.7 Record sort expert ............................................................................................................. 66

Page 6: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 6 of 189 z

Business Software for a Changing WorldTM

10.8 Group sort expert ............................................................................................................... 67

10.9 Refresh report data ............................................................................................................ 67

10.10 Performance information .............................................................................................. 68

10.11 Report document properties ......................................................................................... 68

10.12 Report options ................................................................................................................ 69

11. The Language menu .................................................................................. 70

12. Functions .................................................................................................. 71

12.1 Syntax ................................................................................................................................. 71

12.2 Language elements ............................................................................................................ 71

12.3 Built-in functions ................................................................................................................ 78

12.4 Supported operations per data-type .............................................................................. 162

13. External Library Functions ....................................................................... 164

13.1 DLL location ...................................................................................................................... 164

13.2 Reference ......................................................................................................................... 164

13.3 Prewritten ELF functions ................................................................................................. 165

13.4 Creating your own ELF DLL .............................................................................................. 168

14. Parameters ............................................................................................. 169

15. Special Fields ........................................................................................... 170

16. Page layers .............................................................................................. 173

16.1 Create a new page layer .................................................................................................. 173

16.2 Using a page layer in a report.......................................................................................... 173

16.3 Hiding page layers ............................................................................................................ 173

16.4 Updating a page layer ...................................................................................................... 174

17. ANSI collation sequences ........................................................................ 175

17.1 ANSI code pages ............................................................................................................... 175

17.2 DataFlex Reports ANSI collation file ................................................................................ 175

17.3 Example ............................................................................................................................ 176

18. Automating DataFlex Reports ................................................................. 177

18.1 Close DataFlex Reports .................................................................................................... 177

18.2 Open a report ................................................................................................................... 177

Page 7: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 7 of 189 z

Business Software for a Changing WorldTM

18.3 Open a report preview..................................................................................................... 177

18.4 Start DataFlex Reports with a specific workspace .......................................................... 177

18.5 Print a report .................................................................................................................... 178

18.6 Export a report ................................................................................................................. 178

18.7 Using a command file ...................................................................................................... 179

19. Product support ...................................................................................... 182

20. Product registration and activation ......................................................... 183

21. Problems and solutions ........................................................................... 184

21.1 Cannot open the language database .............................................................................. 184

21.2 Unable to instantiate COM object .................................................................................. 184

Page 8: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 8 of 189 z

Business Software for a Changing WorldTM

1. Welcome to DataFlex Reports!

DataFlex Reports is a software tool for delivering timely, well organized reports and information to the people

who need it.

Designed to be used by end-users, power-users and professional software developers alike, DataFlex Reports

works with a wide variety of ODBC datasources including – but not limited to – Microsoft SQL Server, IBM DB2,

Oracle, MySQL, Pervasive SQL, PostgreSQL, Microsoft Access, the DataFlex embedded database and more.

The use of ODBC as the datasource is strongly advised when reports are created for a DataFlex based

application that has its data stored in an SQL environment (such as in MS SQL Server) rather than using the INT

files found in the application’s data folder.

DataFlex Reports’ Report Creation Wizard steps users through the entire process of creating a report from

selecting datasources to grouping, filtering, summarizing and sorting information. The wizard displays the

completed report in a visual, drag & drop WYSIWYG interface. Ready to view the results on-screen, print or make

further formatting changes and enhancements. A full range of text formatting (fonts, bold, italics, justification,

etc.) is available in DataFlex Reports along with a rich library of string, logical and math functions.

DataFlex Reports is developed in DataFlex, the state-of-art software development tool from Data Access

Worldwide.

For DataFlex developers, DataFlex Reports offers both seamless integration with their DataFlex development

environment and seamless integration of reports in Windows and web applications. When the developer edition

of DataFlex Reports is installed you have the option to install a report integration wizard and library for

integration of reports with applications made in the DataFlex Studio. More information about this integration

can be found in the DataFlex Reports Developer Guide.

For deployment, reports integrated in DataFlex Windows and web applications require only the installation of a

single OCX. Distribution of integrated reports and the OCX is royalty-free with the Developer Edition of DataFlex

Reports.

Page 9: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 9 of 189 z

Business Software for a Changing WorldTM

2. Getting started with DataFlex Reports

There are two things you may want to look at first.

Check the ‘Options’ from the ‘File’ menu and make sure that DataFlex Reports uses the defaults of your

preference. All possible options are covered in section 4.2 (Options). The second thing to do is to change the

language. For more information how to change the language read section 11 (The Language menu).

There are three ways to start creating a new report:

Use the Report Creation Wizard

Use a blank report

Use an existing report

Before creating a new report it is important to decide what data needs to be shown and how the information

will be grouped.

Let’s suppose that the report needs to show order-information and that the orders must be presented in groups

of order-lines per order-number. The data needed for making this report would be:

Per order-line:

o product-number

o product-description

o quantity

o price

Per order:

o For the ‘order header’:

order-number

order-date

customer-name

customer-address

payment- and shipping-conditions

o For the ‘order footer’:

total order amount

Next, determine which tables are needed to show the necessary information. Typically for a report that needs to

show order-information, the order-header, order-details, products or inventory, and customer table are needed.

These tables need to be related to each other. The relationship looks like this:

Other things to consider:

In which order must the data be presented? Will it be sorted by order-number? Or customer-number?

Must all orders be printed, or should it be possible to filter certain orders? What are the filtering criteria?

Order Detail Order Header Customer

Inventory

Page 10: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 10 of 189 z

Business Software for a Changing WorldTM

2.1 Creating a new report using the Report Creation Wizard The Report Creation Wizard supports the steps

that are needed to create the different parts of a

report. The wizard is started from the ‘File’ option

in the menu, followed by the ‘New’ and ‘Standard

Report Wizard’ options. Another way to start the

wizard is by using the Ctrl+N shortcut.

Click on the button ‘Next’ to select tables to be

used in the report.

2.1.1 Step 1: Select the tables The DataFlex ‘Order Entry’ sample workspace is

used for illustrating the use of the wizard. In

section 9.1.1 (Available datasources) on page 51

an in depth explanation of datasources is

provided, specifically, the access to data via ODBC.

After selecting ‘DataFlex’ in the treeview and

clicking the ‘Open’ button, select the

filelist.cfg file that comes with the Order

Entry workspace.

filelist.cfg is a DataFlex configuration file

where the (metadata of) tables are stored. It is

also possible to open DataFlex workspaces (.sws

or .ws files) and individual tables without using

filelist.cfg.

After selecting filelist.cfg, a ‘+’ symbol will

appear next to the DataFlex option. Click on the ’+’

symbol to show all tables.

A table can be added by double-clicking on it. By

using the buttons in the center of the dialog,

tables can be added or removed from the report.

The buttons with a single > or < symbol can be

used to add or remove a single table. The buttons

with << and >> apply to all tables.

Select the tables ‘OrderDtl’, ‘OrderHea’, ‘Invt’

and ‘Customer’. Click on the button ‘Next’ to

define the relationships between the tables.

Page 11: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 11 of 189 z

Business Software for a Changing WorldTM

2.1.2 Step 2: Defining relationships between tables If we use the tables of the DataFlex Order Entry

workspace, the relationships are automatically

recognized by the DataFlex file-system.

The boxes in the links viewer can be dragged

around or made smaller or larger.

Clicking "Auto-Arrange" reorganizes the display.

Read the section Relationships to create

relationships manually.

Click on the button ‘Next’ to select the database

fields used on the report.

2.1.3 Step 3: Select the fields As with the previous selection dialog, the buttons

in the middle section support adding or removing

one field or all at once.

The fields will be arranged in sequence as sorted

in the right panel. Change the order by selecting a

field and clicking the buttons with the Up or Down

arrow in the top right of the panel.

Click the ‘Browse Data’ button to see a sample of

the actual data in the fields. Click the ‘Find Field’

button to search for a field by name.

Add the fields ‘OrderHea.Order_Number’, ’OrderDtl.Qty_Ordered’, ’Invt.Description’, ’OrderDtl.Price’,

’OrderDtl.Extended_Price’, ’OrderHea.Terms’, ’OrderHea.Ship_Via’, ’OrderHea.Customer_Number’,

’Customer.Name’, ’Customer.Address’, ’Customer.Zip’ and ‘Customer.City’. Click on the button ‘Next’ to

group the data.

Page 12: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 12 of 189 z

Business Software for a Changing WorldTM

2.1.4 Step 4: Group the data After selecting the database fields for the report

the wizard continues with the option to group the

data. In the case of the ‘Order Entry’ sample data,

it makes sense to group by the order-header and

order-detail data. An in-depth explanation of this

can be found in section 10.6 (Group expert).

In order to create a new group, select the

database field in the treeview on the left. In that

tree view, find two options:

‘Report Objects’; showing the database fields

that have been selected in the previous page

of the wizard.

The second is an option for showing the

datasource with all tables and fields.

If a database field to be grouped on was already selected for the report, it can be found in both options. The

quickest way to select a field is to click on the ‘+’ symbol in front of the ‘Report Objects’ and click on the field.

When clicking the button with the ‘>‘ symbol in the center, the data will be grouped by that field.

The data in the report will be sorted in ascending order by default. In the bottom of the treeview on the right-

hand side, this can be changed. For each field that is grouped on, the sort order can be set to ascending or

descending.

The Group can easily be removed from the report by selecting it in the panel on the right-hand side and clicking

the button with the ‘<‘ symbol.

Group by the fields ‘OrderHea.Customer_Number’ and ‘OrderHea.Order_Number’. Click on the button

‘Next’ to add sum and total fields.

2.1.5 Step 5: Sum values; totaling Having defined the grouping, a dialog to select

fields to total on is displayed.

Similar to the previous steps, the appropriate

fields can be selected and moved to the other

panel to be designated totals.

By selecting the type of sum in the combo box,

several ways of totaling can be opted for. The

default choice is ‘sum’.

Select the fields ‘OrderDtl.Qty_Ordered’,

‘OrderDtl.Price’ to add a sum on those fields.

Click on the button ‘Next’ to add data filters.

Page 13: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 13 of 189 z

Business Software for a Changing WorldTM

2.1.6 Step 6: Define data filters The interface for selecting or removing fields is

quite similar to the previous dialogs. The fields to

filter on can be added to the column on the right.

Selecting the field in the right box will enable the

operator and value dropdown box.

If you click the drop-down arrow of the value

dropdown box you will get a sample set of data

from the datasource. This is the same as the

‘browse data’ button underneath the 'Available

Fields' list would produce. The difference is that

you can pick a value from the list.

A more complete description of applying filtering

criteria can be found in section 10.2 (Filter

function).

Select the field ‘OrderHea.Customer_Number’ and pick ‘is equal to’ from the operator dropdown box. Enter

‘1’ in the Value box. Click on ‘Next’ for the next wizard page.

2.1.7 Step 7: Report options After having defined the filtering criteria, the

wizard will continue to the options screen.

The first combo box lets you select the page size

for the report. Selecting a correct size here helps

you in the further design of the report. The new

report wizard divides the selected fields over the

width of the paper, selecting the desired page size

will give a different reduction in width if more

fields are selected than can be presented on one

row.

The work done to select the datasource and

create the data-model can be something that is

reusable for other reports in the future. By storing

this in the repository, it can be made immediately available at a later time. It helps to give it a meaningful name;

in this case ‘Order Information (DataFlex)’ would be right.

Click the 'Next' button to go to the Finish page. Here you can close the wizard by clicking on the ‘Finish’

button.

Page 14: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 14 of 189 z

Business Software for a Changing WorldTM

2.1.8 Step 8: Change the visual design of the report After closing the

wizard, the report is

presented in the visual

designer of DataFlex

Reports as shown.

The visual designer

consists of several

parts. A report always

has a minimum of the

following sections:

Report Header

Page Header

Details

Report Footer

Page Footer

For each group, two

extra sections are

added to a report:

Group Header

Group Footer

Section Will be printed Report Header First section of the report that gets printed Page Header At the beginning of every page Group Header At the beginning of each group Details For each row Group Footer At the end of each group Page Footer At the bottom of every page Report Footer Last section of the report that gets printed

On the left-hand side of the visual designer the labels of the various sections are shown.

A preview window can be opened to see what the result of the report will look like. Activating the preview

window can be done in several different ways:

Select the ‘Preview Report’ option in the menu under ‘View’

Click the ‘Print Preview’ icon in the button bar

Use the Ctrl+R shortcut

Click the ‘Refresh’ icon in the button bar to show and/or refresh the data

Use the F5 function key

Hide the report header and footer

In the ‘Section Expert’ sections can be hidden so that they do not get printed. Hiding can

be done always or conditionally based on the results of a function. Hover the mouse

cursor over the label of the ‘Report Header’ in the left part of the section and click the

right mouse button. A context menu shows the option to hide the section. The visual

designer will now show the hidden section in a grey, shaded area. The same action can

be repeated to hide the section of the ‘Report Footer’.

Page 15: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 15 of 189 z

Business Software for a Changing WorldTM

Moving and resizing of fields and objects

A field can be selected with the mouse, and dragged to the appropriate

position. Resizing a field can be done by hovering the cursor over the

border of the field. When the cursor shape changes, drag with the mouse

to resize the field.

Fields can be selected via a lasso. Hold the Shift key down

and drag with the mouse. Fields can also be moved by use

of the cursor keys on the keyboard. Resizing can be done

by keeping the Shift key pressed, while clicking a cursor

key. When multiple objects are selected with the lasso the order of selection depends on the order in the Report

Explorer.

The way the cursor keys react depends on the settings of the grid options. Read more about this in section 4.2

(Options).

A number of fields in the ‘Details’ section needs to be

moved to one of the ‘Header’ sections. Before starting to

move anything, it makes sense to enlarge the ‘Header’

sections. Move the cursor over the bottom separator of

the section. The cursor shape changes and the section

can be enlarged by holding the left mouse button down,

while dragging the separator down.

Multiple fields can be moved at once: select multiple

fields with the mouse while keeping the Ctrl key pressed.

Then move all selected fields to the ‘Group Header #1’

section by dragging the mouse while holding down the

left mouse button.

Replace ‘OrderHea.Order_Number’, ‘Orderhea.Terms’ and ‘Orderhea.Ship_Via’ to ‘Group Header #2’ and

‘OrderHea.Customer_Number’‘Customer.Name’, ‘Customer.Address’, ‘Customer.Zip’and ‘Customer.City’ to

the ‘Page Header’.

Page 16: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 16 of 189 z

Business Software for a Changing WorldTM

Changing the appearance of fields

Looking at the report in the preview window

you may want to change the formatting of

certain fields.

The appearance can be changed via field

properties. Numeric fields for example will

show 2 decimals per default. Start the field

properties dialog from the Format menu,

choosing the 'Field Properties' menu item or by

clicking the right mouse button on the field

and then selecting the 'Field Properties' option.

Select object ‘Sum of OrderDtl.Qty_Ordered’

and open the properties dialog. On the last

tab page, change the ‘Number format’ to

‘Custom Number’ to have zero decimals and

remove the ‘Thousand separator’. Click the

‘OK’ button to save this setting.

Add lines and text objects

There are several ways to add a ‘Text Object’ to a report:

Select the ‘Text Object’ option from the Insert menu.

Click the icon on the toolbar for adding a ‘Text Object’.

Click the right mouse button in the section and choose the

'Insert' option in the context menu, followed by selecting the ‘Text Object’ option.

Draw a ‘Text Object’ in the ‘Page Header’ section. Right click on the ‘Text Object’ and select ‘Edit text’ from

the popup menu. Type ‘Printed on’ into the box and click with the mouse outside the box. Move the Special

field ‘Print Date and Time’ from the ‘Report Header’ right after the text object.

In the ‘Group Header #2’ and ‘Group Footer #2’ separator lines are added. Select the line object in the

toolbar. The cursor changes into a pencil. Move the mouse to the position where the line should start and

drag the mouse, while pressing the left mouse button, to the position where the line should end.

Each order on a new page

To place each order from the order entry

system on a separate page we have to open

the Section Expert. You will find this on the

Report menu.

Select the ‘Group footer #2’ and check the

box ‘New page after this section’. Click the

‘OK’ button to save this setting.

The preview now shows that each order will be

printed on a new page.

Page 17: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 17 of 189 z

Business Software for a Changing WorldTM

2.1.9 Step 9: Storing a report The screenshot on the right shows the preview

of the report that was made using the wizard.

Save the report by choosing ‘Save’ from the

File menu, and enter a logical name so that

you can find the report again later. For

example "orders with details.dr". The

report can be stored anywhere on disk as the

datasource location is stored in the report. The

reports folder in a DataFlex workspace (e.g. c:\DataFlex Examples\Order Entry\Reports) is the preferred

location for report files. The integration wizard used to integrate reports in a DataFlex application will first look in

that folder.

2.2 Create a new report using a blank report Select the option ‘Blank Report’ from the File menu to create a new report. A tab page for the design of the new

report is now available.

The most important steps for making a new report are:

Select the datasource, using the Database expert.

Create groups, using the Group expert.

Add fields to the report, using the Field explorer.

Add other fields such as texts, totals and page-numbers.

Add filtering-criteria using the Filter Expert or add them manually, using the Filter Function.

Finish the visual design of the report.

2.3 Create a new report based on an existing report If the functionality of a new report is comparable to that of an existing report, you could consider taking the

existing report as a starting point. Open the existing report (File menu, ‘Open’) and save the report under a new

name. (File menu, ‘Save As’).

If it is likely that multiple reports will be using the same tables, the use of the repository is recommended, see

the 6.3 (Repository explorer).

Page 18: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 18 of 189 z

Business Software for a Changing WorldTM

3. Charts

A chart is a graphical representation of data, in which

the data is represented by symbols, such as bars in a bar

chart or lines in a line chart.

3.1 Adding a chart You can add a chart by clicking on the ‘Chart Object’ option in the Insert menu or by

clicking on the chart icon in the toolbar. The insert Chart wizard will appear.

After clicking on ‘Next’ in the welcome page you can select the type of chart you want to

use in your report. The different chart types are explained in section 3.2 (Chart types).

3.1.1 Datasource After selecting the chart type you must select

the datasource for the Category (X-axis) and

Value (Y-axis).

Page 19: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 19 of 189 z

Business Software for a Changing WorldTM

3.1.2 Labels and Appearance In the final page of the wizard you can change

the basic appearance of the chart.

The Palette color scheme defines the colors

used to draw the bars, lines, dots, etc. that

represent the values. The palette schemes

can't be changed and are predefined.

The Appearance color scheme defines the

colors to draw the lines and background of the

charts. The appearance schemes are

predefined but can be overridden. See section

3.3 (Modifying the layout and appearance).

3.2 Chart types

3.2.1 Area An area chart is very similar to a line chart. Data is displayed using different colors

in the "area" below the line. Area charts are commonly used to display

accumulated values over a period of time.

3.2.2 Bar A bar chart displays data with rectangular "bars" with lengths relative to the data

they symbolize. Generally a bar chart is used to display discontinuous data (data

that has a discrete value); however it can also be used for continuous data.

Examples of discontinuous data would be "car color" or "tire size"; examples of

continuous data would be "population" or "age".

3.2.3 Line A line chart is used to show a series of data points connected by straight line

segments. Charts of this type are generally used to illustrate trends in data over a

period of time.

Page 20: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 20 of 189 z

Business Software for a Changing WorldTM

3.2.4 Point A point chart displays data in a grid using Cartesian coordinates. Data is displayed

along the x and y axis, where x and y can represent any type of data. A point chart

is also referred to as a plot or scatter chart.

3.3 Modifying the layout and appearance of a chart When you click with the right mouse button on a chart, a popup menu comes up where

you can select the option "Chart properties". Within the Chart properties you can change

how the chart will be displayed.

At the left bottom corner you will find a button "Change datasource". This will start up the

chart wizard where you can change the chart type, datasource and the basic layout of the

chart.

3.3.1 Common In this tab page you can change the chart type,

see section 3.2 for the different chart types

you can select.

The Appearance and Palette options define the

default colors used in the chart where palette

defines the colors used to draw the bars, lines,

dots or slices that represent the values. The

appearance scheme defines the default colors

used to draw the lines and background that

makes up the chart.

The border defined in the Common tab page is

the border around the chart. Here displayed in

blue. When the color is set to default it takes the color defined in the Appearance scheme currently selected.

To display a label displaying the value of each bar, point, etc. check the "Label visible" checkbox.

Page 21: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 21 of 189 z

Business Software for a Changing WorldTM

3.3.2 Legend If you want to display a legend check the

"Legend Visible" checkbox on the "Legend" tab

page.

The text font used in the legend can be

changed by clicking on the button right

beside the "Legend Font" box.

The placement of the legend box is defined by

the Horizontal and Vertical select boxes. The

base point is in the left top corner. Where

"Near" is the position closest to this point (left

or top) and "Far Outside" the position farthest

away (right or bottom).

"Marker height" and "Marker width" define the size of the marker icon left of the legend text.

When the colors in this tab page are set to "Default", the colors defined in the Appearance scheme currently

selected are being used.

3.3.3 Titles On the "Titles" tab page you can define some

extra text that will be displayed with the chart:

a title and a subtitle.

The alignment of the titles is set in the reading

direction where "Near" is on the left side and

Far on the right side.

You can 'dock' each title on the "Top",

"Bottom", "Left" and "Right". The reading

direction of "Top" and "Bottom" is from left to

right, from bottom to top when docked on the

"Left" and top to bottom on the "Right" side.

3.3.4 Category The ‘Category’ tab defines options for the X-

Axis.

Unchecking the ‘Visible’ checkbox hides all

information about the X-axis from the chart.

With the "Reversed" checkbox the Axis can be

reversed were the last value becomes the first

value in the chart.

The position of the X-axis within the chart can

be changed using the ‘Alignment’ option.

Normally the axis is drawn at the bottom of

the chart (‘Near’ option), but it can be set to

the top by selecting the ‘Far’ option.

The text, font, and alignment of the title can be changed.

Page 22: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 22 of 189 z

Business Software for a Changing WorldTM

The category labels are displayed using a specific angle (default 45 degrees) and font. If the angle of the label is

set to 0, the label will be centered on the axis value.

When the colors in this tab page are set to "Default", the colors defined in the Appearance scheme currently

selected are being used.

3.3.5 Value The ‘Value’ tab defines options for the Y-Axis

and is similar to the Category tab above.

One difference is the position of the Y-axis

within the chart. Normally the axis is drawn at

the left of the chart (‘Near’ option), but it can

be set to the right by selecting the ‘Far’ option.

The default angle for category labels is 0

degrees.

3.3.6 Lines The ‘Lines’ tab contains options for the grid

lines in the chart area.

Four types of grid lines exist: (major) vertical

lines, minor vertical lines, (major) horizontal

lines, and minor horizontal lines. The minor

lines cannot be displayed without the major

lines.

For each type the visibility, line style, and line

color can be defined.

When the colors in this tab page are set to

"Default", the colors defined in the

Appearance scheme currently selected are being used.

3.3.7 Scale In the ‘Scale’ tab a number of options for the

display scale of the axes can be defined.

When "Side margins" is checked, extra space is

drawn on both sides of the chart. Uncheck

"Show zero level" if you want the chart to start

with the first value instead of zero.

With "Tick spacing", which becomes available

when you uncheck "Auto spacing", you can

define when the chart draws a 'major' tick with

a label. In the example shown here, every 2

values a tick is drawn. The "Minor ticks"

defines the amount of ticks to be drawn

between the 'Major' ticks.

Page 23: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 23 of 189 z

Business Software for a Changing WorldTM

3.4 Changing the datasource of a chart If you want to change the data of the chart you can click on the button "Change datasource". The chart wizard

will be reopened where you can change the datasource. See section 3.1 (Adding a chart).

Page 24: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 24 of 189 z

Business Software for a Changing WorldTM

4. The File menu

The ‘File’ menu offers several options for opening, saving and printing

reports. For most of these choices, a button is available on the button

bar as well.

The option ‘New’ offers several options: ‘Standard Report Wizard’,

‘Blank Report’, and ‘Page layer’, see sections 2.1, 2.2, and 16.1.

Use the option ‘Open…’ to open a report. The option opens a Windows

common file dialog from which you can select a DataFlex Reports

report file. The file extension is .dr for reports and .dpl for page

layers.

To close the active report or all reports, the options ‘Close’ and ‘Close

All’ are available.

The options ‘Save’ and ‘Save As…’ are self-explanatory.

The option ‘Lock report design’ requires the entry of a password. This

password must be entered every time the report is opened in DataFlex

Reports. Users can use such reports by integration with your DataFlex

application without the password.

Besides printing reports, it is possible to export report data to different file-formats such as PDF, RTF, CSV, Excel

and HTML or to an image file (JPG, GIF, TIF or PNG). This option is discussed in paragraph 4.1 below.

To modify the page setup, choose ‘Page Setup’.

The ‘Options’ for DataFlex Reports are explained in section 4.2 below.

The 10 most recently used reports are shown in the menu above the ‘Exit’ option. Simply select one of the listed

reports to open it.

Exiting DataFlex Reports while one or more unsaved reports are still open will display a request to save all

changes.

4.1 Export Reports can be exported to various formats.

This includes several formats aimed at human

reading (HTML, image, PDF, and RTF) and

some aimed at machine reading (CSV and

Excel).

Each format has a number of export options

which are discussed in the following

paragraphs. One common option that all

formats support is the selection of pages to

export. You can choose to export all pages1, or

a single specific page.

1 Most image formats allow only a single page. TIFF has built-in support for multiple pages and DataFlex Reports can use this.

Page 25: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 25 of 189 z

Business Software for a Changing WorldTM

After choosing a format and setting its options you will be asked to specify a location and filename. When you

chose to export all pages in a format that generates multiple files, this chosen filename is used as a basis for the

filenames. The actual files will have an appended dash and sequence number just before the file extension. For

instance report.html will generate report-1.html, report-2.html, etc.

4.1.1 HTML export When a report is exported to HTML this will generate one file for each page. Images are embedded within the

HTML file(s).

This format has no format-specific options.

4.1.2 RTF export The RTF export generates a single file containing all pages.

This format has no format-specific options.

4.1.3 PDF export The PDF format is widely used for distribution of documents and has some very interesting options.

A PDF document has limited control of how a PDF reading program will display the document by default. The

‘Page display’ options are:

Full screen

Display with outline

Display with thumbnails

Display without outline or thumbnails

PDF documents can also be secured using passwords. Setting an ‘Owner password’ makes sure that the

document cannot be manipulated without entering that password. Setting a ‘User password’ as well will require

readers to enter that password.

Many documents include images, which increases the file size a lot. In order to assure that PDF files are portable

images are compressed using an algorithm that drastically reduces the file’s size, but also reduces image quality.

You have a choice to increase the ‘Image quality’ setting from ‘Low’ to ‘High’, which results in better image

quality at the cost of a larger file size.

4.1.4 Image export DataFlex Reports supports exporting to the JPEG, GIF, TIFF, and PNG formats. It can export a single page to an

image file, or all pages when using TIFF.

4.1.5 CSV export The CSV (Comma Separated Values) format is widespread, but also knows numerous variations due to the lack of

standardization. DataFlex Reports has a number of options that allow you to generate the format you need.

The ‘Field separator’ in most CSV files is the comma, but implementations using semicolons or pipe characters

are also commonplace. In addition, because this character can occur in character values, a ‘character delimiter’

is needed. Usually this is a double quote.

CSV files often represent a single grid of rows and columns. The special sections in a report (report, page, and

group headers and footers) cannot easily be identified, so software programs (as well as people) reading the file

will have difficulty parsing the data. By default these sections are not exported to a CSV format file, but you can

choose to export them anyway using the three checkboxes ‘Export report sections’, ‘Export page sections’, and

‘Export group sections’.

Page 26: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 26 of 189 z

Business Software for a Changing WorldTM

4.1.6 Excel export The Excel export creates an XLS or XLSX file, depending on which ‘Excel version’ you choose. The default is XLS

(Excel 2003).

You can choose to put all data on a single worksheet, or to create one sheet for each page. Note that Excel

versions before 2010 have a maximum of 65,536 rows per worksheet.

By default the program attempts to export the file into a format that visually corresponds to the original report

(more or less). It uses the rows and columns of Excel as a drawing grid, which you can manipulate by changing

the ‘Column width’ setting. If you wish to export the report without any alignments and markup, the checkbox

‘Export data only’ allows you to do that.

In contrast to the CSV format Excel files have a lot of styling options, which makes report sections identifiable.

Therefore by default they are included in the export. If you do not want that, you can disable them.

4.2 Options The window containing the default settings for DataFlex Reports consists of three tab pages: ‘Options’, ‘Fonts’

and 'Formatting'.

4.2.1 Options tab-page By checking the option ‘Snap to Grid’ in the

‘Grid options’ group, objects will automatically

be aligned with the nearest line of the grid.

The distance between the grid-lines can be set

here as well.

The option ‘Show guidelines’ determines if

guidelines are displayed in the designer. These

guidelines can be created by clicking within the

rulers of the report designer.

By checking the option ‘Insert Detail Field

Headings’ in the ‘Field Options’ group the

name of a field will be automatically added as

a field-title in the ‘Page Header’ section of the

report.

The ‘Insert Group Name with Group’ setting

automatically places a group-name above a

new group.

In the group "Datasource options" the setting of the ‘Show tables’, ‘Show views’ and ‘Show stored procedures’

decides whether to list SQL Tables, SQL Views and SQL stored procedures in the Database Expert and New

Report Wizard.

When the option "Show information messages" is ticked, the product will show you informational messages

from the ODBC backend or messages like "Cannot open file".

The option ‘Always Sort Locally’ applies to reports with ODBC as a datasource. For the DataFlex database records

are always sorted locally. To sort records from an ODBC datasource using the selected collation instead of the

collation used in the ODBC backend you can check this option.

Page 27: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 27 of 189 z

Business Software for a Changing WorldTM

Checking the box offers the possibility of

performing a special sort order, defined in

the collating sequence configuration file

named df_collate.cfg. DataFlex Reports

copies the collating sequence configuration

file to its own environment during the

installation of your DataFlex. The sort order

defined in that file can be easily adjusted

using a text editor.

When using DataFlex as you datasource you

have to make sure that the contents of this

configuration file in your DataFlex

environment matches with the sort order defined in the indexes of the tables that you use. The contents of the

collating sequence file in the DataFlex Reports environment and in the DataFlex environment may differ from

each other, but if they do you will see a different sort order in the reports to that in the applications you

distribute, which may be confusing for readers and is therefore discouraged.

4.2.2 Fonts tab-page This page is reserved for the default fonts that

are to be used in a report, can be set for the

following sections: ‘Fields’, ‘Sum Fields’,

‘Group Name Fields’, ‘Text Objects’ and ‘Field

Titles’.

Click on the prompt button at the end of the

field of which you want to change the font to

select the default font, style, size and color.

Page 28: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 28 of 189 z

Business Software for a Changing WorldTM

4.2.3 Formatting tab-page This page contains the default formatting

options for 'Text', 'Number', 'Integer', 'Date'

and 'Time' fields when they are used in the

report.

For example if you like a date field to be

formatted using a custom date layout you can

click the prompt button at the end of the date

field formatting option and change the

defaults.

Page 29: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 29 of 189 z

Business Software for a Changing WorldTM

5. The Edit menu

The ‘Edit’ menu contains several options for manipulating objects in the

design window. If the preview window is active the 'Go To Page' option

is the only available option.

5.1 Undo and Redo Every change to an object can be undone by the ‘Undo …’ option. Re-

apply the change by using the ‘Redo …’ option. There are no limitations

on the maximum number of undo’s that can be performed.

5.2 Cut, Copy, Paste and Delete The options ‘Cut’, ‘Copy’, and ‘Delete’ are only available when at least

one object in the design windows is selected. Once an object is copied or

cut, the ‘Paste’ option will be available.

5.3 Select all Select all objects in the design window by choosing ‘Select All’. After that you can use options that can be

applied to multiple selected objects such as 'Bold', 'Italics' or 'Copy'.

5.4 Find In large reports it can happen that an object becomes more

difficult to find. Use the ‘Find’ option to find an object. The

name attribute of the object is used for the search. If the

object is found, it will be selected and easily visually

identifiable as such.

5.5 Go to page In the preview window, a quick way to go to a certain

page is by using the ‘Go to Page’ option.

Entering a page number larger than the last page of the

report jumps to the last page of the report.

5.6 Object The last item on the menu shows "Object" or "Edit Text",

"Edit Function" or "Edit Parameter". When it shows

"Object" the menu item is unavailable and cannot be chosen. For "Edit Text", click on a text object (such as a

column label). For "Edit Function" click on a function object in the report and the function editor dialog will be

presented. This is documented in chapter 12. For "Edit Parameter" click on a parameter object in the report and

the parameter dialog will be presented. This is documented in chapter 14.

Page 30: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 30 of 189 z

Business Software for a Changing WorldTM

6. The View menu

From the ‘View’ menu, several windows and panels that are available in DataFlex

Reports can be opened.

The ’Design’ and ‘Preview Report’ options switch between the design window and

the preview window.

If a window is opened, the active window can be closed using the ‘Close Current

View’ option. You can achieve the same result by clicking the 'X' in the report design

or preview tab-page.

The options for ‘Field Explorer’, ‘Report Explorer’, ‘Repository Explorer’ and ‘Arrange Objects’ are explained in

paragraphs below.

Clicking the option for the ‘Status Bar’ switches the status bar in

the bottom of the window to show, or not. The check-mark in

front of the option indicates that the status bar is activated.

The ‘Zoom’ option will represent the content of an active

window in a larger or smaller size.

6.1 Field explorer The Field Explorer is launched from the ‘View’ menu or the button from

the button bar. The Field Explorer is used for adding fields to a report.

The tree view shows five top-level branches: ‘Database Fields’,

'Parameter Fields', ‘Function Fields’, ‘Group Name Fields’ and ‘Special

Fields’.

Clicking the ‘+’ symbol for ‘Database Fields’ will expand the tree and

show the tables that are available for the report. Clicking on the ‘+’

symbol for a table will show the fields of that table. You can drag a field from the tree to the report.

Page 31: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 31 of 189 z

Business Software for a Changing WorldTM

Clicking the ‘+’ symbol for ‘Parameter Fields’ will expand the tree and

show all the parameter fields for the report. After selecting ‘Parameter

Fields’ in the tree view, the button ‘Create new’ in the button bar at the

top of the panel is enabled. The ‘Delete’, ‘Edit’ and ‘Rename’ buttons are

enabled when a parameter field is selected. The same options are

available in the context menu, which can be activated by clicking the

right mouse button while a parameter field is selected. Parameter fields

are detailed more fully in chapter 14 (Parameters).

Clicking the ‘+’ symbol for ‘Function Fields’ will expand the tree, and

show all the function fields for the report. After selecting ‘Function

Fields’ in the tree view, the button ‘Create new’ in the button bar at the

top of the panel is enabled. The ‘Delete’, ‘Edit’ and ‘Rename’ buttons are

enabled when a function field is selected. The same options are available

in the context menu, which can be activated by clicking the right mouse

button while a function field is selected. See more about function fields

in section 7.4 (Function field) and chapter 12 (Functions).

In the section named ‘Group Name Fields’, a field is listed for each group

in the report. See more about groups in section 10.6.

The section ‘Special Fields’ pertains to fields like report title, page number and print-date and -time. An

explanation of the special fields is listed in chapter 15 (Special Fields).

Add a field to a report as follows: activate the design window of the report and select the field to add. Drag the

field from the Field Explorer above the design window where the field needs to be placed, to drop it.

Remove a field from a report by selecting the field in the design window and pressing the Del key, or use the

context menu activated by a right mouse click, followed by choosing ‘Delete’.

Page 32: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 32 of 189 z

Business Software for a Changing WorldTM

6.2 Report explorer The Report Explorer is launched from the ‘View’ menu or by clicking the

button from the button bar. In a tree view it shows the several sections

of the report and provides opportunities to modify, reorder or remove

objects, or to add sections to a report.

Filters for showing or hiding data fields, functions, parameters, graphical

objects and sub-reports can be toggled by their buttons in the top of the

panel.

If a node is selected, a right mouse click presents a context menu,

offering several options. There are different context menus for different

nodes.

The floating menus for 'Report Header', 'Page Header', 'Details', 'Report

Footer' and 'Page Footer' offer the same options. The floating menus for

'Group Header' and 'Group Footer' also contain the same options.

The next paragraphs show what is available with a right-click on a couple

of tree nodes.

6.2.1 Report explorer floating menu Right-clicking on the node with the report name as the label produces a

floating menu containing the general report functions available.

The following table explains all the options of the floating menu for the

report node.

Function Description Refresh Report Data The datasource behind the report is requested to deliver the data again. You

need to confirm the action. Performance Information Opens the report performance dialog, see 10.10 (Performance information). Report Options Opens the report options dialog, see 10.12 (Report options). Report Document Properties Opens the report document properties dialog, see 10.11 (Report document

properties).

Page 33: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 33 of 189 z

Business Software for a Changing WorldTM

6.2.2 Group header/footer floating menu Right clicking on a node labeled 'Group Header' or 'Group Footer'

produces a floating menu as shown on the right.

The following table explains all the options of the floating menu for the

details section.

Function Description Group Expert Opens the group expert dialog, see 10.6 (Group expert). Delete Group Delete this group from the report. Hide Section Toggling the option to hide or show a section. Section Expert Start the Section Expert, see 10.4 (Section expert). Fit Section Changing the size of a section, automatically removing white-space in the

bottom of a section. Insert Section Below Insert a new section and place it below an existing section. Select All Section Objects Select all objects in a section. (For example to move, or Delete all at once).

6.2.3 Details section floating menu Right-clicking on the node labeled "Details" (or at 'Report Header', 'Page

Header', 'Details', 'Report Footer' and 'Page Footer') produces a floating

menu as shown on the right.

The following table explains all the options of the floating menu for the

details section.

Function Description Hide Section Toggling the option to hide or show a section. Section Expert Start the Section Expert, see 10.4 (Section expert). Fit Section Changing the size of a section, automatically removing white-space in the

bottom of a section. Insert Section Below Insert a new section and place it below an existing section. Select All Section Objects Select all objects in a section. (For example to move, or Delete all at once).

6.2.4 Database field floating menu Right-clicking on the database field node (such as a node labeled

"OrderHea.Customer_Number") produces a floating menu with database field

specific options as shown on the right.

The available options of the menu are explained in the following table.

Page 34: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 34 of 189 z

Business Software for a Changing WorldTM

Function Description Field Properties Setting the Field Properties, see 8.4 (Field properties). Browse Field Data Opens a panel that shows the content of the database field. Insert Sum Add a sum of a field Summary. Lock Size/Position Toggle the switch that enables or disabled movement and resizing of

objects. Suppress Toggle the switch to show or hide the object in a report. Forward Switch the position of the current field in the report layout with the next

field. This way the current field will be used/executed after the next field has been processed.

To Front In case objects overlap, an object can be made visible by moving it to the front. For example: Place text to the front, and a picture in the background.

Backward Switch the position of the current field in the report layout with the previous field. This way the current field will be used/executed after the previous field has been processed.

To Back In case objects overlap, an object can be moved to the back. Size to Font Resizes the object to fit the size of the used font

6.3 Repository explorer The repository explorer shows information about the datasource location. A

tree view shows the stored repositories.

Existing repositories can be renamed, viewed or removed from the system.

The screenshot below shows the information you get when you click the

properties button in the Repository Explorer’s toolbar. You can see the name

of the repository, the tables used, the database name, connection string, if applicable the schema name and

number of relationships.

You can create a new report based on

a stored repository. Repository records

are created during report construction

via the standard report wizard, or via

the Database expert.

6.4 Arrange Objects The Arrange Objects panel is used to manipulate the size or position of multiple

objects in the Report relative to each other.

6.4.1 Resizing objects Select one or more objects in the Report that you wish to change, select the

number of points that you wish to change in the width (X) and/or height (Y)

dimensions. Select the Resize button and click on the apply button to

Page 35: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 35 of 189 z

Business Software for a Changing WorldTM

change the object(s) sizes accordingly. If you do not enter a value into one of the X or Y dimensions then that

dimension is left unchanged.

6.4.2 Moving objects Select two or more objects in the Report that you wish to change, select the number of points that you wish to

change in the left/right (X) and/or top/bottom (Y) dimensions. Select the Distance button and click on the

apply button to change the object distances relative to each other. If you do not enter a value into one of the

X or Y dimensions then that dimension is left unchanged.

Note when you use the lasso to select multiple objects, the base object is the first selected object in the report

explorer.

Page 36: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 36 of 189 z

Business Software for a Changing WorldTM

7. The Insert menu

The ‘Insert’ menu lists several elements that can be inserted into a report, such as a

database field, text or graphical objects.

Except for the first option each choice is also available via a comparable button that can be

chosen from the insert button bar.

7.1 Field heading If a database field is selected in the design window and the option ‘Field Heading’ is clicked

from the ‘Insert’ menu, a text object is inserted in the 'Page Header' section. The caption is

automatically assumed to be the field name. Change the caption by a right mouse click on

the text object and selecting ‘Edit Text’ from the context menu.

See paragraph 4.2.1 for the default setting to automatically place a text object with caption in the 'Page Header'

section when a database field is added to the report.

7.2 Summary First select a field that needs to be summarized. Then choose ‘Sum’

from the ‘Insert’ menu. If we choose this for the field ‘qty_ordered’

from the orderdtl table we will see the dialog on the right.

The available summary options in this dialog are:

Function Description Sum Sums the values of the field (only works on numeric fields). Average Show the average value of the field (only works on numeric fields). Maximum Show the maximum value of the field (only works on numeric fields). Minimum Show the minimum value of the field (only works on numeric fields). Count Count the number of times that a certain value occurs. Distinct Count Count the distinct number of times a value occurs (only works on numeric

fields).

You can select where the 'Sum' field is placed. This is normally either a 'Group Footer' or a 'Report Footer'. All

possible locations are shown.

If your report does not contain a group – see next paragraph – and you would like to place the summary in a

group you can immediately create the group by clicking the 'Insert Group' button.

Page 37: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 37 of 189 z

Business Software for a Changing WorldTM

7.3 Group A ‘Group’ is used to divide data into specific sections and for sorting. For

example: Group all orders per customer. The panel for adding a group to

a report looks like displayed on the right.

The First combo box is used to select the field on which the grouping

takes place. The second combo box defines the sorting-order (ascending

or descending).

The ‘Group Name Field’ has per default the same value as the field upon

which the grouping takes place. Suppose that the Group is defined as on

customer number, but the ‘Group Name Field’ needs to be the customer

name this can be changed by checking the checkbox ‘Customize Group

Name Field’ to change it to the appropriate field.

By checking the checkbox ‘Repeat Group Header On Each Page’ the

section with the header-details are repeated on each page.

7.4 Function field A ‘Function Field’ is usually a field with content that is derived from another field. A ‘Function Field’ is a

calculation based on another field, or a different representation of text.

Select ‘Function Field’ from the ‘Insert' menu and move the mouse cursor to the place in the report where the

function field needs to be placed. Press the left mouse button down while dragging, to resize the object as

appropriate.

After the field has been placed in the report, the

‘Function editor’ window is activated.

The bottom half is the area for editing the

function. You can enter the name of the function

but it is not required. If you omit entering a name

the name will be "FunctionX", where "X" is the

number of the function. You can always change

the name later. After entering the function

contents you can validate the function by clicking

the ‘fx’ button.

Use the three panels in the top half to help in

building up the function. Double-clicking on an

element in the tree will automatically place the

appropriate piece of code in the editor below, in the function.

There is a tree view for selecting available fields (from report or database), one for selecting a specific type of

manipulation (expression or statement) and one for selecting functions.

If a function does not return a value (the 'return' statement is not present), the value returned from the function

is undetermined.

Example: If we want a function that returns the first 10 characters from the name of a customer we have to do

the following:

Double-click the ‘Return’ expression in the middle tree view. While not shown here the editor part

will contain "return" after this.

Page 38: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 38 of 189 z

Business Software for a Changing WorldTM

Double-click the function

‘Left(string,number)’ in the ’Available

Functions’ tree view. Make sure that the

insertion cursor is placed between the

brackets of the ‘Return’ statement.

Edit the second argument of the function

(the ‘Number’ behind the comma) to be 10.

Then edit the first argument (the ‘String’

before the comma) by double-clicking the

customer name field in the database fields.

Change the name of the function to a

meaningful name (e.g. CustomerName).

Check the function by clicking the function-check button in the tool-bar of the function editor

window. If no error occurs, the syntax of the function is correct and you can click the OK button to

store the function in the report.

7.5 Text object Select the option ‘Text Object’ and move the mouse cursor to the position in the report where the object needs

to go and keep the left mouse button pressed down to create the appropriate size of the object. After releasing

the mouse button, text can be edited. Changing the text afterwards can be done by clicking on the object with

the right mouse button and choosing ‘Edit Text’ from the context menu or by simply double clicking.

7.6 Line, Box and Picture Select the option ‘Line’ or ‘Box’ and move the mouse cursor to the position in the report where the line or box

has to appear and keep the mouse-button suppressed while giving the line or box the appropriate size.

For adding a picture in a report, first select the picture, then move it to the place in the report and release it in

the report by clicking the left mouse button. By default the picture will have the same aspect ratio as the

original, and it can now be resized using the mouse.

Images which are stored in a database can also be added. For this, the field which contains the images has to be

added to the report.

7.7 Chart object Select the option ‘Chart Object’ and move the mouse cursor to the position in the report where the chart has to

appear and keep the mouse-button suppressed while giving the chart the appropriate size. When the mouse is

being released the 'Insert Chart wizard' will appear. See paragraph 3.1 (Adding a chart).

Page 39: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 39 of 189 z

Business Software for a Changing WorldTM

7.8 Sub-report A sub-report is a report inside another report.

There are specific reasons for constructing

reports this way:

Show details of data that is not related to

each other. For instance because the

data is not related, the data-types do not

match, or because the data resides in

separate databases.

Combine two or more separate reports

into one report.

Showing the same data multiple times in

one report, but with different dimensions.

A sub-report can either be linked, or not be linked to the main report. If the reports are not linked, the

information is not related, data from one report is not filtered by reference to the data presented in the other

report.

It is possible to link reports by using global variables in the filter functions and function fields. The following

example shows a main report with order-header information, linked to a sub-report showing order-details.

Create a new report based on the table with order-header data and Group the data on order-number.

Create a second Detail section, the report now shows ‘Details-A’ and ‘Details-B’

Add a ‘Function field’ to the ‘Details - A’ section. The function will define a global variable named

“iOrder” that gets the value of the current order-number:

dim iOrder as global

let iOrder = {Orderhea.Order_Number}

return iOrder

Hide section ‘Details -A’. We do this

because the result of the function is not

meant to be printed in the report.

Add a sub-report by choosing 'Sub-

report' from the 'Insert' menu and place

it in section 'Details – B'. The ‘Report

Creation Wizard’ is activated for

creating the sub-report.

Select the appropriate order-detail fields (no grouping and filtering).

Open the sub-report by double clicking it. Add the following 'Filter Function':

dim iOrder as global

return ({OrderDtl.Order_Number} = iOrder)

Defining the global variable iOrder in the filter function is optional here, because it is already defined in the

main report, but it is good practice to leave it in for documentation purposes. The filter process will now

only use those order-detail records that belong to the current order record that was set in the main report.

Page 40: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 40 of 189 z

Business Software for a Changing WorldTM

8. The Format menu

Items in the ‘Format’ menu are for changing the visual representation of objects. For

most options, a comparable button is placed on the button bar.

8.1 Font The menu option 'Font' contains a sub-menu in which you can choose to make the field's

font bold, italic or underlined or to increase or decrease the font size. All five options also

have a button in the tool-bar to accomplish the same goal.

8.2 Lock size/position With this menu option – also available as tool-bar button – you can lock the size and position of the object. This

means you cannot move the field with the mouse or cursor keys. The chosen state is saved for the object in the

report.

8.3 Suppress field This option can be selected to suppress a selected field. The option is also available via a tool-bar button.

Remember that to conditionally suppress an object you can write a function via the field properties dialog.

8.4 Field properties Depending on the type of object that is selected, the panel to change settings will have different tab pages.

8.4.1 Common The first input field allows the name of

the object to be changed. The name of

the object does not need to be unique.

If the object refers to a function the

name of the function and the name of

the object might be different and it is

up to you to decide whether you want

to keep them in sync or not.

The second input field allows for

adding a tooltip text. A tooltip is the

text that will be visible when hovering

over the object with the mouse cursor.

A value is not required.

With the next four input controls you

can change the size and/or location of

an object. The value is internally stored

in TWIPS which means that the shown

value later is most likely to be slightly

different due to rounding.

Page 41: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 41 of 189 z

Business Software for a Changing WorldTM

The data in an object can be shown as aligned to the left, to the right or in the center. The setting can be

specified via the combo-form or via the result of a function. An example of a function to align the field is:

if ({OrderHea.Order_Number} < 150) then

return drHorzAlignmentLeft

else

return drHorzAlignmentRight

end

By checking the checkbox ‘Suppress’, the object can be hidden in the report. Suppression can be conditionally

realized by using a function. Click the button on the right-side and enter a function. An example of a function on

how to suppress a field:

if ({OrderDtl.Qty_Ordered} = 0) then

return true

else

return false

end

Checking the ‘Lock Position and Size’ option locks the object so that size and location cannot be changed until

the object is unlocked again.

8.4.2 HTML The ‘HTML’ tab page contains options that are specific for HTML output of reports.

‘Hyperlink id’ is meant for integration. Setting this value will create a DIV element when HTML output is chosen.

For further information on integration refer to the ‘DataFlex Reports Developer Guide’.

8.4.3 Border On the ‘Border’ tab page the settings of

the object border can be changed. This

tab page is not available for all objects.

The available settings of border line

styles are:

None (drBorderNone)

Single (drBorderSingle)

Double (drBorderDouble)

Dashed (drBorderDashed)

Dotted (drBorderDotted)

A border-line style can be conditionally

defined, using a function. Click the

button on the right-hand side to add

apply a function.

An example of using a function to

define a border:

Page 42: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 42 of 189 z

Business Software for a Changing WorldTM

if ({OrderDtl.Qty_Ordered} < 1) then

return drBorderSingle

else

return drBorderNone

end

Pick one of the predefined colors from the drop-down or select a custom color from the RGB color range to set

the color of the borders.

Setting the color can also be done by using a function. Click the button to add a function.

An example of a function or setting a color:

if ({OrderDtl.Qty_Ordered} < 1) then

return (drRed)

else

return (drBlack)

end

The background color can be set in the following styles:

Solid (drSolidGradient)

Horizontal (drHorizontalGradient)

Vertical (drVerticalGradient)

Setting the gradient style can also be done by using a function. Click the button to add a function.

An example of a function or setting a gradient style:

if ({OrderDtl.Qty_Ordered} < 1) then

return (drSolid)

else

return (drHorizontalGradient)

end

Pick one of the predefined colors from the drop-down or select a custom color from the RGB color range to set

the color of the background. When the background-style is set to ‘Solid’ only the primary color is used. When a

gradient is selected the ‘End color’ defines the color on the right or bottom of the gradient. Setting the colors

can also be done by using a function. See the example above.

The bottom of the panel presents a preview sample of the result.

Page 43: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 43 of 189 z

Business Software for a Changing WorldTM

8.4.4 Font The ‘Font’ tab page contains settings that

control fonts: Size, color and styles. This tab

page is not available for all objects.

The first three combo boxes in the panel are for

defining the font, size and color.

The font, the size and the color of the font can

be defined conditionally by using a function.

An example of changing font settings:

if ({OrderDtl.Qty_Ordered} < 1) then

return ("Courier")

else

return ("Verdana")

end

Note: make sure the named font is available on your development and/or the deployment machine.

For the styles, checkboxes can be used to display the font as ‘Bold’, ‘Italic’, ‘Underline’, and/or ‘Strikethrough’.

These setting can be conditionally defined by using a function as well.

An example of using a function for setting the font style:

if ({OrderDtl.Qty_Ordered} < 1) then

return (true)

else

return (false)

end

The bottom of the panel shows an example of the result.

Page 44: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 44 of 189 z

Business Software for a Changing WorldTM

8.4.5 Text field If the field contains text (character strings or

textbox objects) the field properties dialog

contains a tab-page for text related settings.

With the first combo-form you can change the

rotation of the text in steps of 90 degrees. The

text can be presented normal, vertical, up-side-

down or reversed vertical. This can also be set

using a function, which must return a valid angle:

0, 90, 180, or 270.

return 90

Checking the checkbox ‘Variable Height’ will allow the field to automatically grow in height, if the content of the

field in the report will be larger than the original size of the object. This setting can be conditionally defined by

using a function. Such a function should return false or true.

Checking the checkbox 'Rich Text Format (RTF)' tells the system that the data contains RTF instructions that need

to be converted from RTF to formatting. This setting can be conditionally defined by using a function. Such a

function should return false or true.

Checking the checkbox 'RTL (right-to-left) Text' is meant for languages where writing starts at the right hand side

and continues to the left (reversed writing when compared to Western languages). Do not turn on this checkbox

if your data and fonts are not ready for it.

8.4.6 Date field If the field contains a date (or a datetime) the

field properties dialog contains a tab-page for

formatting the date value.

The first combo box defines the date format:

Windows long (drWindowsLongDate)

Windows short (drWindowsShortDate)

Custom (drCustomDate)

Custom Mask (drCustomDateMask)

None (drNone)

The setting can also be defined conditionally by

using a function. An example of such a function

is:

Page 45: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 45 of 189 z

Business Software for a Changing WorldTM

Return ({User.DateFormat})

The ‘Custom’ option allows for several date settings. Depending on the settings, a ‘Date Mask’ of the object can

be set. The Date Mask determines how the date will be represented and can be designed manually or

conditionally by using a function.

The next table explains which codes can be used in a Date Mask.:

Code Representation d The number of the day: 1 – 31 dd The number of the day, 2-digits: 01-31 ddd Abbreviated name of the day: Sat - Sun dddd The full name of the day: Saturday - Sunday M The number of the month: 1-12 MM The number of the month, 2-digits : 01-12 MMM Abbreviated name of the month: Dec – Jan MMMM The full name of the month: December – January yy The year, 2-digits: 00-99 yyyy The year, 4-digits: 0000-9999 g Period/era string, usually A.D.

For example, to get the date string "Wed, Aug 31 94", a "ddd',' MMM dd yy" mask should be used. Be aware that

the string values, like ‘ddd’, are returned in the user’s locale.

8.4.7 Time field If the field is of the type time (or datetime) the

field properties dialog contains a tab-page to

format the time (part) of the data.

If the field’s data is a datetime value but the

time is not desired choose 'None' as your time

format. The same applies to the date part, you

can suppress the date.

With the first combo-form you select the

desired formatting from the following options:

Windows default (drWindowsTime)

Custom (drCustomTime)

Custom mask (drCustomTimeMask)

None (drNone)

The setting can also be defined conditionally by

using a function. An example of such a function

is:

Return ({User.TimeFormat})

The ‘Custom’ option allows for several date settings. Depending on the settings, a ‘Time Mask’ of the object can

be set. The Time Mask determines how the date will be represented and can be designed manually or

conditionally by using a function.

The next table explains which codes can be used in a Time Mask.:

Page 46: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 46 of 189 z

Business Software for a Changing WorldTM

Code Representation h Hours with no leading zero for single-digit hours; 12-hour clock hh Hours with leading zero for single-digit hours; 12-hour clock H Hours with no leading zero for single-digit hours; 24-hour clock HH Hours with leading zero for single-digit hours; 24-hour clock m Minutes with no leading zero for single-digit minutes mm Minutes with leading zero for single-digit minutes s Seconds with no leading zero for single-digit seconds ss Seconds with leading zero for single-digit seconds t One character time marker string, such as A or P tt Multicharacter time marker string, such as AM or PM

For example, to get the time string "11:29:40 PM", use the "hh':'mm':'ss tt" mask.

8.4.8 Number field If the field is of the type number (or

currency) the field properties dialog

contains a tab-page to format the

number.

The first combo-form allows selection

of the desired formatting from the

following options:

Windows default number

(drWindowsNumber)

Windows default currency

(drWindowsCurrency)

Custom number (drCustomNumber)

Custom currency

(drCustomCurrency)

The setting can also be defined

conditionally by using a function.

When a custom format is selected the

options to format the number will be enabled. If a custom mask format is selected the number mask entry will

be enabled.

The mask format is in the format LZ.ND;PF;NF;DS;TS;SY where:

LZ is Leading Zeros; give a 0 for a leading zero or leave empty

ND is Number of Decimals; give the amount of decimals in zeros or leave empty

PF is Positive number Format where $ is a placeholder for a symbol

NF is Negative number Format where $ is a placeholder for a symbol

DS is Decimal Separator

TS is Thousand Separator

SY is the Symbol

The mask can also be set using a function. An example of such a function is:

Page 47: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 47 of 189 z

Business Software for a Changing WorldTM

if ({Customer.Continent} = "Europe") then

//Format the number in EU (euro) format €1.000,00 / -€1.000,00

return "0.00;$1.1;-$1.1;,;.;€"

else

//Format the number in US (dollar) format 1,000.00$ / -1,000.00$

return "0.00;1.1$;-1.1$;.;,;$"

end

If ‘Suppress if Zero’ is checked DataFlex Reports will not print the number when the number equals zero, this can

also be set using a function.

8.4.9 Line field If the field is of the type line the field properties

dialog contains a tab-page to format the line.

You can select the line style from the following

options:

Solid (drLineSolid)

Dash (drLineDash)

Dot (drLineDot)

Dash Dot (drLineDashDot)

Dash Dot Dot (drLineDashDotDot)

None (drLineNone)

The setting can also be defined conditionally by

using a function.

An example of such a function is:

if (gbImportant) then

return 1

else

return 4

end

You can select the line width from the second combo-form that shows a range from 1 to 3.5 points. The values

returned by a function are in twips, 15 twips equals 1 point, so a 1 point line requires a return value of 15.

In the color combo-form you can select a color for the line. The color can also be set from a function returning a

constant, a color number or the result of an RGB(R,G,B) function call.

Finally you can set the variable height of a line to true via the checkbox. This is active for vertical lines and made

effective if the section containing this line grows in height because of a variable height text field.

Page 48: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 48 of 189 z

Business Software for a Changing WorldTM

8.4.10 Box field If the field is of the type box the field

properties dialog contains a tab-page

to format the box.

The first three formatting options are

the same as a line object.

The fourth option is the rounding of

the box corners in a percentage

number from 0 to 100%. Zero means

no rounding, 100% makes it a circle or

ellipsis. A function can be used to

return the rounding percentage as

well.

The background color can be set in the

following styles:

Solid (drSolidGradient)

Horizontal

(drHorizontalGradient)

Vertical (drVerticalGradient)

Setting the gradient style can also be done by using a function. Click the button to add a function.

An example of a function or setting a gradient style:

if ({OrderDtl.Qty_Ordered} < 1) then

return (drSolid)

else

return (drHorizontalGradient)

end

Pick one of the predefined colors from the drop-down or select a custom color from the RGB color range to set

the color of the background. When the background-style is set to a gradient using the combo box or by a

function the ‘End color’ will be enabled. Setting the colors can also be done by using a function. See the example

above.

Page 49: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 49 of 189 z

Business Software for a Changing WorldTM

8.4.11 Image field If the field is an image field the field properties

dialog contains a tab-page to specify the image

and format the image.

The first form allows you to specify the image to

be shown. Via the function button you can

specify a function to be called that returns the

name of an image.

By default the image is displayed using the

original aspect ratio and resized to fit inside the

field boundaries. This is the ‘Fit’ item of the

‘Image display’ option. It can be changed to ‘Fill’,

which ignores the aspect ratio and stretches or

compresses the image, or ‘Original’, which

keeps the original aspect ratio and size but clips

the image when it does not fit.

If the image name is a fixed location, the option

‘Embed image’ will include the image within the report file. This allows distribution of the report without

separate image files.

The ‘height’ and ‘width’ input boxes can be used to specify the exact dimensions of the image in pixels. The

‘horizontal scale’ and ‘vertical scale’ fields are useful for resizing an image by specific percentages.

8.5 Move The ‘Move ‘ option supports ‘Forward’, ‘To Front’, ‘Backward’ and ‘To Back’. It is meant for arranging objects,

deciding which one is on top, or in the background (i.e. behind others).

Suppose that there are three objects in a report that are overlapping: A

text object, a box and a picture. If the picture is the last object that was

added to the report, it will end up on top, covering the other objects.

This is probably an unwanted situation.

To explain this move option, to the right is a screenshot of the Report

Explorer where the tree view shows the order and the arrangement of

the objects.

In this situation the image object would cover the text and box objects.

To let the picture object to go to the back, first click on the picture

object and then choose the ‘To Back’ option in the ‘Move’ menu. The

report explorer’s tree view will then look as follows:

Next, the box needs to go behind the text object. Select the box object

and click ‘Backward’ in the ‘Move’ menu. The tree view will now appear

as shown on the right.

As a result, the picture will be placed, then the box on top of it, and finally the text.

To move objects in the other direction (to the top) the options ‘Forward’ and ‘To Front’ are available.

Page 50: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 50 of 189 z

Business Software for a Changing WorldTM

As well as managing the overlapping of objects the move object can be

used to cause a function field to be executed before another function

field or sub-report. If for example your sub-report needs to filter on the

value of a global variable that is set in a function you need to make sure

the function is executed before the sub-report is executed.

The tool-bar of the report explorer contains two buttons to move an

object forward or backward from its current order.

8.6 Align Aligning multiple objects can be done thru the Align pulldown menu. The starting point of

the alignment is the first selected object.

Tops, Middles Bottoms, Left, Centers and Rights will align the selected objects at the same

corresponding value of the first selected object.

Baseline aligns the baselines of the objects at the baseline of the first selected object. A

baseline is the imaginary line under the text.

'Top to Bottom' spreads the selected objects over the height of the section, 'Left to Right'

will spread the objects over the width of the section.

Note when you use the lasso to select multiple objects the starting point is the first selected object in the report

explorer.

8.7 Size When one or more fields are selected there are several options to manipulate the size. ‘Size to font’ changes the

size of each selected field to match the height of the font and the expected width of the field. ‘Size to section

height’ adjusts the position and height, so that each field covers the entire height of the section.

When multiple fields are selected they can easily be made the ‘same width’, ‘same height’, or both (using ‘same

size’).

Note that these options are unavailable when one of the selected objects has a locked position and size.

Page 51: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 51 of 189 z

Business Software for a Changing WorldTM

9. The Database menu

Items in the database menu can be chosen to perform actions on the used

database in the report.

The menu options are discussed in their own paragraph below.

9.1 Database expert The Database Expert is started from the ‘Database’ menu or by clicking the appropriate button in the button bar.

The window of the Database Expert is built up out of 3 parts: a tree view for selecting datasources, a tree view

with the selected tables and a graphic representation of the selected tables with the relationships.

9.1.1 Available datasources Per report, only one

datasource can be used. If a

datasource is selected, the

tables and optionally the

database views will be

presented in the first tree

view.

The arrows in the top of the

dialog are for selecting and

adding tables to the report.

To add a single table, select the

table on the left side, and click

on the button with the single

arrow pointing to the right. A

table can also be added by

double-clicking it.

By selecting the ‘Tables’ or

‘Views’ part in the left tree

view all tables can be added by

clicking on the button with the

double arrow, or by double-

clicking.

If you click the Find button ( )the name of a table can be entered and DataFlex Reports will try to find that

table in the tree with available datasources. The Find Next button ( ) can be used to find the next table with

the entered name. You can enter a full or a partial name (like ‘inv’ for ‘inventory’).

The tree view for the datasources consists of five elements: Current, DataFlex, ODBC, Runtime Datasource and

Repository.

Page 52: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 52 of 189 z

Business Software for a Changing WorldTM

Current

Current shows the currently selected datasource. This can greatly reduce the time spent on searching your

datasource if there are many.

DataFlex

Select ‘DataFlex’ in the left tree

view and click the ‘Open database’

button, or double-click the

‘DataFlex’ text to add a DataFlex

table as a datasource.

The DataFlex developer’s

environment uses ‘filelist.cfg’.

This is a configuration file that

captures all the tables that are

used in an application. In the

filelist.cfg relational links are

defined to other DataFlex tables

but also to other types of

databases, such as Microsoft SQL Server, Pervasive.SQL or IBM DB2. By choosing ‘DataFlex’ as the datasource it

is possible to combine data from different types of datasources.

Another option to using the filelist.cfg for opening tables is by opening a table directly or using a VDF

workspace. When using a VDF workspace (either a .sws or .ws file), the filelist accociated with the workspace is

automatically opened and DataFlex Reports uses the same search path as specified in the workspace file. When

opening tables directly both .dat and .int type files can be used.

ODBC

All databases, for which an ODBC driver is

available, can be used as a datasource for

DataFlex Reports. ODBC is short for Open

DataBase Connectivity and it’s a universal

way to access all sorts of databases. In order

to access a database via ODBC, the

appropriate driver needs to be installed.

The window for selecting an ODBC

datasource shows that there are three ways

of selecting an ODBC datasource:

Select one of the registered user or

system DSN’s.

Select a file DSN.

Provide a ‘Connection string’.

A DSN (Data Source Name) is a set of details

(parameters) necessary for an ODBC-driver to access a specific database. There are three kinds of DSN’s:

Type Description User The user DSN is stored in the Windows registry and is only accessible for a specific user. System The system DSN is stored in the Windows registry and is available for all users on the

computer.

Page 53: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 53 of 189 z

Business Software for a Changing WorldTM

Type Description File Details are not stored in the registry, but in a separate file on disk. From Windows Vista

and up the default location is your documents folder. Make sure that you select a folder accessible for all users.

If no DSN is available for a certain datasource, it can be defined using the ODBC Data Source Administrator. Read

more in the documentation of your Windows operating system about this.

If, for some reason, a DSN is not used, a Connection String can be used to connect to a datasource. An example

of a connection string: SERVER=(local);DRIVER=SQL Server;DATABASE=001;UID=sa. The connection string may be

different for each database driver. Refer to the documentation for your environment or attempt to find out the

right syntax via the ODBC Datasource manager.

Using ODBC views

If the ‘Show views’ option in the ‘Options’ dialog is checked all views defined in an ODBC datasource are

available in the ‘New Report Wizard’ and ‘Database Expert’. ODBC views work just like regular ODBC tables and

can be linked together.

Using ODBC stored procedures

If the ‘Show stored procedures’ option in the ‘Options’ dialog is checked,

the ‘New Report Wizard’ and ‘Database Expert’ will show all Stored

Procedures (SP’s) defined in an ODBC datasource. SP’s cannot be linked

to other tables or stored procedures. If an SP has input parameters, you

need to specify the values of them via the parameters branch in the field

explorer. Highlight the parameter and click the edit button or choose

'Edit' from the floating menu.

Parameters can also be set and retrieved from functions – like the filter

function – using the ‘{?ParamName}’ format where ‘ParamName’ is the

name of a input Parameter. For example, to set the value of a parameter in a filter function, use the following

code.

dim sOrder as global

let {?OrderID} = sOrder

return true // no further filtering

Page 54: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 54 of 189 z

Business Software for a Changing WorldTM

Runtime datasource

Instead of getting data from a 'real'

database DataFlex Reports can also retrieve

data from an array of data.

The array needs to be populated by the

programmer that integrates the report with

his application. Runtime Datasource adds

extra power to DataFlex Reports as the

programmer can get data from any

datasource, including virtual datasources.

If you select this option you will get a modal

dialog in which you enter the table name,

add column names and their types and

lengths. After OK'ing the dialog all the other

normal steps to create a report are applied.

9.1.2 Selected database and tables This part of the Database Expert dialog shows the database and tables in use for the report. You can remove one

or more tables. To remove one table select a table on the right side, and click the button with the single arrow,

pointing to the left.

After selecting the database (root) item, all tables can be removed at once by clicking the button with the double

arrows pointing left.

When you remove table(s) from the report you will get a question whether you really want to do this when the

report uses fields from the table. If you confirm the question the objects using the fields will be removed. The

designer will not enumerate all your functions and remove the database references. This means you must check

the functions in the report and change the references to the table(s) removed from the report.

9.1.3 Relationships To use multiple tables in a report,

relationships must be defined between

those tables. In most cases the relationship

between two tables is based on two

common fields pointing from the field in

one table to the field in the other table.

Sometimes a relationship between tables

requires multiple fields, which is supported

by DataFlex Reports. The example on the

right shows the relationship from the

‘Customer’ table to the ‘Orderhea’ table.

Here the relationship is made from the

customer table to the orderhea table; such

a relationship is called a 1 to N relationship,

where each record in the main table can

relate to multiple child records; one customer can have multiple orders. If the relationship is made from the

orderhea table to the customer table, there is a 1 to 1 relationship. For 1 record from the main table there can

be only parent record (1 orderhea record can only have one customer and vice versa).

Page 55: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 55 of 189 z

Business Software for a Changing WorldTM

For each report, the type of relationship between the tables needs to be defined. The way relationships are

made also influences performance, where such things as filtering criteria and indices on tables are an important

factor as well. The diamond symbol indicates that the given database field is (part of) an index.

A relationship is created by selecting the common field in the main file, and dragging the mouse while keeping

the left mouse button suppressed, towards the common field in the other, related table.

Relationships can only be made between two tables if the common fields are of the same type and length.

Clicking with the right mouse button on a field, offers the ‘Show Field Types’ option, showing the data-type and

field length.

For DataFlex tables the link to field needs to have a unique index.

The following table offers the options for the ‘Table Links’ buttons at the right hand side of the dialog.

Function Description Auto Link Automatically create relationships Auto Size Automatically create the size of table panel Auto Arrange Automatically arrange tables Minimize Tables Minimize the table panel Delete All Links Remove all the table links Delete Selected Link Remove the selected link Edit Link Properties Edit the properties of the selected link

By clicking on the line between two tables (the relationship) with the right mouse button shows the context

menu. Selecting the ‘Link Options’ choice or the button for the ‘Edit the link properties’ shows the panel for

changing the specific properties of the relationship.

When linking tables there can be only one starting point

(left-most table). For example in the Order Entry

workspace you can start from orderhea -> customer and

to salesp but you cannot go from customer and salesp at

the same time to orderhea.

In the following paragraphs the ‘Links Options’ are

explained.

Join type

The table below explains what the results are when the

different ‘Join Types’ of the relationships are used for the example of the customer and orders table. Fields from

the customer table as well as the orders table are used in the report, which is relevant because a relationship to

or from a table is ignored if no fields from that table are used in the report.

Join Type Description Result Inner Join Shows all records for which the content of the

related fields in both tables is exactly the same. For a DataFlex datasource, this is the standard join type.

All customers and their related orders, but NOT customers without orders and NO orders that are not related to a customer.

Left Outer Join Shows all records for which the content of the related fields in both tables is exactly the same AND the records of the main table even when the value of the common field does not exist in the related table.

All customers and all related orders, including customers without orders.

Page 56: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 56 of 189 z

Business Software for a Changing WorldTM

Join Type Description Result Right Outer Join Shows all records for which the content of the

related fields in both tables is exactly the same AND the records in the related table even when the value in the common field does not exist in the main table. This type is not applicable for a DataFlex datasource.

All orders and related customers, including orders that are not related to a customer.

Full Outer Join Shows all records of both tables This type is not applicable for a DataFlex datasource.

All customers and related orders, including customers that have no orders and orders that have no customers.

Enforce join

For reports that use an ODBC datasource, a SQL statement is prepared for fetching the data set. The table below

explains the influence of ‘Enforce Join’ on the SQL query.

Enforce Join Description Not Enforced The join is only executed if the main table as well as the child table are in the SQL Query. Enforced From The join is forced when the child table is in the SQL query. Enforced To The join is forced if the main table is in the SQL query. Enforced Both The join is forced if either the main table, or the child table are in the SQL query.

Link type

The table below explains each ‘Link Type’.

Link Type Description = Shows all records for which the related fields have the exact same value. This is the only

applicable type for a DataFlex datasource. > Shows all records for which the related field of the main table is larger than that of the

child table. >= Shows all records for which the related field of the main table is larger than or equal to

that of the child table. < Shows all records for which the related field of the main table is smaller than that of the

child table. <= Shows all records for which the related field of the main table is smaller than or equal to

that of the child table. != Shows all records for which the related field of the main table is unequal to that of the

child table.

9.2 Check database When you create a report the collected information about the structure of the datasource will be stored with

the report. This means that DataFlex Reports knows about information such as the number of fields, the order of

these fields, the type of the fields, the indexes etc.

When you change the structure of one or more tables after the report creation you should use the option Check

database to get the report lined up with the table structure again. If you do not do this errors can be reported or

wrong information can be printed.

This option also needs to be chosen if you want to change the definition (number of columns, column names,

column types) of an RDS datasource.

Selecting Check Database performs a test using the following matrix:

Page 57: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 57 of 189 z

Business Software for a Changing WorldTM

# Position Name Type Result 1 √ √ √ Match Position, name and type are same 2 X √ √ Match Name and type same, position

changed 3 √ X √ Match if others properties are the

same, otherwise, no match Position and type same, name changed

4 √ √ X No match (i.e. a string is changed to numeric, an automatic match seems inappropriate)

Position and name same, type changed

5 X X √ No match Only type same 6 X √ X No match Only name same 7 √ X X No match Only position same 8 X X X No match

If no changes are detected you will see the notification

message as shown on the right.

If there are changes you will see a dialog in which the

stored database definition is shown on the left hand side

and the newly read database definition on the right hand

side. The differences between the stored and read

information are shown in bold in both tree view objects.

The screenshot clearly shows the following changes:

The length of the field "SalesPerson_ID" has been changed from 4 to 5 characters.

The field "Order_Total" does not exist anymore.

A new field named "Processed" has been added with a length of 1 character.

Page 58: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 58 of 189 z

Business Software for a Changing WorldTM

The first change is "simple", the adjustment can be done

fully automatically. The only point of importance might be

that you want to enlarge the size of the object that

displays the data.

The second change might have more consequences.

When the field is used it will be removed from the report

layout. When the field is not in use it is an easy change, it

simply vanishes from the table definition in the report.

The third detected change is a new field in the database

definition. If you take no action in the check database

dialog the new field will be added to the available fields in

the report and that’s it. But you can also map the field to

an object used in the report. For example, you might know

that it is the replacement for the removed "Order_Total"

field. To find out what to do you should make use of the

"Browse Field Data" functionality. This is available via the

first button on the button bar at the right tree view and

lets you explore the contents of the new field.

9.3 Set datasource location This option under the ‘Database’ menu is for

changing the location of the datasource. To

do so, click the ‘Change location’ button and

select a new location for the datasource.

In the dialog you can browse the tables of

your current datasource (a DataFlex

database in this example) and alter the

information on the right hand side.

If the database is the DataFlex database and

the filelist was used to select tables you can

change the location of the filelist and/or the

connection string (which is the DataFlex DF_OPEN_PATH value). The location of the tables is relative to the

filelist which means that they are automatically relocated / found.

When the database is the DataFlex database but individual tables are selected the location of each of the tables

and/or the connection string can be changed.

When the database is an ODBC datasource you can change the datasource to be used and/or the connection

string used. If the current tree view item points at a table you can view the information but not alter it.

9.4 Edit RDS Sample Data This option can be used to edit the data in the Runtime Datasource, if this is used as the report datasource. See

section 9.1.1 for more information about datasources.

Page 59: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 59 of 189 z

Business Software for a Changing WorldTM

9.5 Browse data This option under the ‘Database’ menu is useful for

inspecting the content of a selected database field. The

option is also available from a floating menu on a field in

the report.

The dialog has a checkbox – labeled ‘Show unique values

only’ – to get distinct values.

9.6 Show SQL query This option under the ‘Database’ menu item is for showing

the SQL query that is used for fetching data from an ODBC

datasource.

The option is not selectable until the report has run at

least once in the preview window. The option is also not

selectable if the datasource is not an ODBC datasource.

It is not possible to change or replace the SQL script. You

can copy the information via the usual Windows copy key

(Ctrl+C) combination to an e-mail or into a script editor

window in for example Microsoft SQL Server Management Studio.

9.7 Select distinct records For reports that use an ODBC datasource, the SQL ‘Distinct’ clause can be applied. When selected a details row

will only be printed when the values of above rows are different.

If this option is selected, a check-mark shows in the appropriate item of the ‘Database’ menu.

The two pictures to

the left show the

result of the no

distinct vs distinct. In

the right hand side

list (distinct) the

double Madrid line is

taken out.

Page 60: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 60 of 189 z

Business Software for a Changing WorldTM

10. The Report menu

In the ‘Report’ menu we find the options to filter data, configure sections,

configure group, record and group sort ordering, refresh data, report

statistics, properties and options. Some of the options have a button in the

toolbar which starts the same operation.

10.1 Filter expert The Filter Expert is launched from the

‘Report’ menu or by clicking the

appropriate button in the button bar. It

allows for specifying which records to

show in a report. When an ODBC

datasource is used the selection

information is passed to the SQL select

statement.

When the DataFlex database is used

DataFlex Reports attempts to perform

a jump into, jump out of index

operation to limit the number of

records to read from the database.

For more complex filters, filter functions can be defined manually. See paragraph 10.2 below.

Adding a filter starts with selecting a database field in the available fields tree view. The tree view shows two

top-levels: ‘Report fields’ showing the fields that are used in the report and ‘Database fields’ showing all tables

and fields.

Click on the ‘Browse Data’ button in the button bar at the top of the tree view, to inspect the content of a

selected field.

By clicking the ‘Find Field’ button a fieldname can be found. This is particularly useful if the tree view contains

many entries.

After selecting a database field a filter can be added, by clicking the button with the single arrow, pointing to the

right.

Removing a filter is done in a similar fashion. Select the filter and click the button with the single arrow pointing

to the left to remove the filter.

A filter can be added by selecting the type from the combo box, for instance: ‘is greater than’. Next, the value

can be entered in the entry form, for example ‘1000’, or by selecting a value from a selection list, by clicking the

prompt button.

Note: for DataFlex datasources, only filters on the left-most table can be optimized.

Page 61: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 61 of 189 z

Business Software for a Changing WorldTM

10.2 Filter function The ‘Filter Function’ is

designed for complex

filters and can be created

from the ‘Report’ menu.

Simple filters should be

entered using the ‘Filter

Expert’, see section 10.1

above. The filter function

depends on the return of

a value of ‘True’ (<>0) or

False (=0).

Example of a filter

function:

return (Left({OrderDtl.Item_ID},3) = "ACE")

In this example, only records are selected that contain item ID’s starting with ‘ACE’.

More detailed explanations of functions are given in chapter 12.

Note: filters defined using the ‘Filter-Expert’ and ‘Filter-Function’ are both used when selecting records.

10.3 Page Layer Expert The Page Layer Expert can be used to add, delete, hide and manage page layers. Read more about page layers in

Chapter 16.

Page 62: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 62 of 189 z

Business Software for a Changing WorldTM

10.4 Section expert The 'Section Expert' can be started from the ‘Report’ menu, or by clicking the appropriate button in the button

bar, or by clicking the right mouse button left margin of the design window.

10.4.1 Available sections A report is built up of several sections: ‘Report Header, ‘Page Header’, ‘Details’, ‘Report Footer’ and ‘Page

Footer’. For each Group in the report, 2 extra sections are added: a ‘Group Header’ and a ‘Group Footer’.

Section Description Report Header The part of the report that is printed as the very first element Page Header Printed at the beginning of each page Group Header Printed at the beginning of each group Details Printed for each record Group Footer Printed at the end of each group Report Footer Printed at the very end of the report Page Footer Printed at the end of each page

The Section Expert is for changing settings, as well as adding new sections. The original sections cannot be

removed, though they can be hidden.

The sections of a report are shown in the available sections tree view. The button bar at the top of the panel is

for adding, merging or removing sections. At the right-hand side of the panel, options available for the selected

section are shown. For each option that supports conditionally switching the option on or off a button is

available.

Most options are self-explanatory. The 'Filler section' is available only for detail sections and can be used to fill

up the space between the last printed detail line and the group or page footer for example to draw vertical lines.

10.4.2 Sections In some cases it makes sense to split up one section into multiple sections.

Page 63: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 63 of 189 z

Business Software for a Changing WorldTM

Let’s suppose that the ‘Details’ section contains a field that can either have a value, or be empty. The empty field

could cause an unwanted white space in the report. By splitting up the Details section, the conditionally filled

field can be placed in that section. If the field is empty, the section can then be suppressed.

The image below shows a report with customer details split in ‘Details A’ showing data unconditionally, and

‘Details B’ showing details conditionally. The option ‘Hide this section' for the ‘Details B’ section is set by a

function to suppress that section in case the field is empty.

Another practical use of splitting sections is for supporting language dependencies. An extra section for each

language can be added. A section can then be suppressed or shown depending on a variable that indicates which

language should be used. Here is an example of a function for hiding a section based on a language code:

if ({Customer.Country} <> "USA") then

return (true)

else

return (false)

end

10.4.3 Options The several settings of each section can be toggled by selecting the appropriate checkbox. It can be toggled

conditionally, based on a function as well. Check the appropriate checkbox and click the ‘Function’ button,

followed by entering the function.

An example of a function for hiding a section:

Page 64: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 64 of 189 z

Business Software for a Changing WorldTM

if ({OrderDtl.Qty_Ordered}=0) then

return (true)

else

return (false)

end

The background color of a section can be set by choosing the preferred color in the combo box.

As mentioned before, functions are powerful. For example we can color each other row in the report output

through the results of a function. Use the following steps to create a report with output like:

Select the details section in the available sections tree view and click on function button of the background color.

Enter the following function, close the dialog and – if needed – refresh the report.

if (mod({&Record Number},2) = 0) then

return (rgb(255,255,255))

else

return (rgb(200,200,200))

end

10.5 Function Explorer DataFlex Reports uses a VB-Like scripting language for functions. The

Function Explorer can be used to manage and edit these functions.

The Function Explorer can be launched from the ‘Report’ menu or by

clicking the appropriate button in the button bar. The Function

Explorer is displayed on the left, with the Function Editor on the

right.

With the Function Explorer users can navigate easily through all the

functions in a report. The functions are displayed per report section.

Both user defined as well as built-in functions are displayed.

The filter button can be used to hide sections without functions.

10.5.1 Function Editor Functions selected in the Function Explorer can be edited in the Function Editor. More on functions can be found

in Chapter 12 (Functions).

Page 65: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 65 of 189 z

Business Software for a Changing WorldTM

10.6 Group expert The Group Expert can be

launched from the ‘Report’

menu or by clicking the

appropriate button in the

button bar.

In order to make complex

reports more readable, the

information can be split into

groups. By adding a new

Group to the report two extra

sections are added to the

report: a ‘Group Header’ and

a ‘Group Footer’.

For each group, a ‘Group

Name Field’ is created. The ‘Group Name Field’ has per default the same value as the field upon which the

grouping takes place, for instance customer number. But it is also possible to assign another value to it, for

instance the customer name or the result of a function.

Grouping can be based on a database field or based on a function.

Adding a group starts with selecting a database or function field in the available fields tree view. The tree view

shows three top-levels: ‘Report fields’ showing the database fields that are used in the report, ‘Function Fields’

showing the function fields defined in the report and ‘Database fields’ showing all tables and fields.

Click on the ‘Browse Data’ button in the button bar at the top of the tree view, to inspect the content of a

selected field.

By clicking the ‘Find Field’ button a fieldname can be found. This is particularly useful if the tree view contains

many entries.

After selecting a database or function field a Group can be added to the report by clicking the button with the

single arrow pointing to the right.

Removing a group works in a similar fashion; select the Group and then click the button with the single arrow

pointing to the left. Note that fields placed in the group header or footer will be removed from the report.

An additional group is placed under the already existing groups. The order in which the groups appear can be

changed by selecting a group and then clicking the ‘Up’ or ’Down’ button.

If a group is selected, clicking the ‘Properties’ button shows the panel for the settings for that Group:

The combo box ‘Sort order’ is for setting the sort order to ascending or descending.

The default value of the ‘Group Name field’ is the same as the value of the field on which grouping takes

place; it can be set to any other field by selecting that field in the corresponding combo box.

By checking the checkbox ‘Repeat Group Header On Each Page’ the ‘Group Header’ section is repeated on

each page of the report.

Page 66: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 66 of 189 z

Business Software for a Changing WorldTM

10.7 Record sort expert The Record Sort Expert can be

launched from the ‘Report’

menu or by clicking the

appropriate button in the

button bar.

Data can be sorted on the

value of one or more fields.

Adding a sort order starts

with selecting a database or

function field in the available

fields tree view. The tree view

shows three top-levels:

‘Report fields’ showing the

database fields that are used

in the report, ‘Function Fields’ showing the defined function fields and ‘Database fields’ showing all tables and

fields.

Click on the ‘Browse Data’ button in the button bar at the top of the tree view, to inspect the content of a

selected field.

By clicking the ‘Find Field’ button a fieldname can be found. This is particularly useful if the tree view contains

many entries.

After selecting a database or function field, a new sort order can be added by clicking the button with the single

arrow pointing to the right.

Remove a sort order by selecting it and clicking on the button with the single arrow pointing left.

A new sort order is placed under already existing sort orders. The order of each can be changed by selecting it

and clicking the ‘Up’ or ‘Down’ button.

The combo box in the button bar at the top of the right-panel is for setting the sort order of each sorting field (to

ascending or descending).

Note that a group sort executes before a record sort which means that the record sort is always within a group

(if present).

Page 67: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 67 of 189 z

Business Software for a Changing WorldTM

10.8 Group sort expert The Group Sort Expert can be

launched from the ‘Report’

menu or by clicking the

appropriate button in the

button bar.

Data can be sorted on one or

more sum fields, using the

various kinds of sorting types.

After selecting a group, the

group sort options can be set

in the panel at the right-hand

side. Setting the sort options

is only possible if there is at

least 1 sum field for the

group.

The combo box ‘Group sort type’ is for setting the sorting type to: ‘None’, ‘All’, ‘Top N’, ‘Bottom N’, ‘Top N

percent’ or ‘Bottom N percent’. For the last four types the entry form ‘Where N is’ is enabled for entering the

value of ‘N’. For sorting type ‘All’ the combo box ‘Group sort order’ is enabled for selecting an ascending or

descending ordering.

The combo box ‘Sum to sort on’ is for selecting the sum field to sort on.

Check the option ‘Include ties’ to accommodate groups whose summarized values are equal. The example below

explains what the results are when the ‘Include ties’ option is checked for sort type ‘Top N’ and N = 3.

Sum value Option ‘Include ties’ not selected Option ‘Include ties’ selected 1000 √ √ 750 √ √ 500 √ √ 500 - √ 500 - √ 250 - -

By checking the option ‘Include ties’, not three but five groups are selected.

10.9 Refresh report data The ‘Refresh Report Data’ option in the ‘Report’ menu rereads the information from the datasource and

previews the report. The same function can be found via a toolbar button or pressing F5 .

Page 68: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 68 of 189 z

Business Software for a Changing WorldTM

10.10 Performance information The ‘Performance Information’

option in the ‘Report’ menu

provides information about the

performance of the report.

Select ‘Report Definition’ in the

tree view to find out how many

fields, groups, pages, etc. are

present in the report.

Select ‘Performance’ in the tree

view to find out how much time

was spent for opening the report

and for reading and sorting the

records. The information about

the time needed to read records

is presented here only after the results have been previewed.

10.11 Report document properties The ‘Report Document Properties’ choice in

the ‘Report’ menu is for changing the

properties of the report.

The properties tab page is for entering a

title, subject, author, category and

keywords of this report.

Using the statistics tab page the version

number of the report can be entered and

the dates the report was created and saved

can be viewed.

The document properties can be used in the

report as special fields. See chapter 15 for

more information.

Page 69: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 69 of 189 z

Business Software for a Changing WorldTM

10.12 Report options The ‘Report Options’ choice in the

‘Report’ menu is for changing the

settings of the report.

The ‘Database character set’ combo

box is for selecting the correct

character-set, so that DataFlex Reports

can convert the data correctly. For the

DataFlex embedded database this is

normally OEM, for ODBC databases it

usually is ANSI.

When you have a printer that is capable

of printing from different paper trays

you can setup your report to use this

feature. In the dropdown list of ‘Default

source’ you can select the default paper tray to print from. This option will be saved in the report.

To print pages from different trays, such as printing the Report header and footer on a different paper type or

color, use a result from a function.

if {&Page Number} = 1 then

//Report Header, print from the upper bin

return drBinUpper

else

if {&Page Number} < {&Total Page Count} then

//Print from the middle bin

return drBinMiddle

else

//Report Footer, print from the lower bin

return drBinLower

end

end

It is possible to include a custom ANSI collation sequence in the report. This is loaded from a file and saved

within the report file. The custom collation sequence allows sorting based on character weight and includes the

code page for which the collation was created. See chapter 17 (ANSI collation sequences) for more information.

‘Always Sort Locally’ is only for reports using an ODBC datasource and is set to its default values as defined in the

global settings of DataFlex Reports, see paragraph 4.2.1.

Checking the checkbox ‘Suppress Printing If No Records’ avoids an empty page, showing just a header and footer

when no records were selected for the report.

The checkbox ‘Select Distinct Records’ is only for reports using an ODBC datasource. It forces a repeating

combination of certain values to be only shown once in a report. This setting can also be defined directly from

the ‘Database’ menu, see paragraph 9.7.

When the option ‘Add Ellipsis’ is set, DataFlex Reports will add ‘…’ before the last number in a numeric object

when the number exceeds the width of the object.

Page 70: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 70 of 189 z

Business Software for a Changing WorldTM

11. The Language menu

DataFlex Reports supports a number of languages. Before changing the language, make sure that the Windows

Regional Options are set to the language of your choice. This ensures that the correct (ANSI) code page is

selected in Windows. Change the Regional Options in the Windows Control Panel. For full language support you

must change both the ‘Standards and formats’ option to ensure correct date and number handling and the

‘Language for non-Unicode programs’ option.

The name of these options may differ in various versions of Windows. After changing the Windows Regional

Options you can change the language in DataFlex Reports by choosing a language from the ‘Language’ menu.

Page 71: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 71 of 189 z

Business Software for a Changing WorldTM

12. Functions

DataFlex Reports uses a VB-Like scripting language for functions these functions can be edited by clicking on the

function button when applicable.

Note: if a function does not return a value (the 'return' statement is not present), the value returned from the

function is undetermined.

12.1 Syntax When writing functions you need to comply with the syntax rules in this section.

Rule Example

Text must be between single or double quotation-marks. "Ok"

//or

'Ok'

Numbers must consist of one or more digits with a dot as decimal separator and negative values must be preceded by the minus sign.

(-0.75 * Amount)

Reference to a database column must be placed between curly brackets. {Customer.Name}

Reference to another function must be preceded by the ‘@’ character and it must be placed between curly brackets.

{@discount}

Reference to a (stored procedure) parameter must be preceded by the ‘?’ character and it must be placed between curly brackets.

{?MyParam}

Reference to a special field must be preceded by a ‘&’ character and it must be placed between curly brackets.

{&Total page count}

The arguments of functions must be placed between brackets. LTrim ({Customer.Name})

Comment is preceded by 2 forward slashes. // this is a comment

Multi line comment is possible by starting with a /* and ending with a */. /*

Commented out by: SomePerson

Commented out at: Juli 2013

Let x= -10

*/

12.2 Language elements The language elements are divided in the following functional groups:

Expressions

Statements

Constants

Page 72: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 72 of 189 z

Business Software for a Changing WorldTM

12.2.1 Expressions The following expressions can be used inside functions.

Logical or, operator “or”

The result will be true when one of the two operands is true.

if ({Customer.Credit_Limit} = 0 or {Customer.Purchases} = 0) then

return 'credit limit or purchases is zero'

else

return 'neither credit limit or purchases is zero'

end

Logical and, operator “and”

The result will be True if both operands are True.

if ({Customer.Credit_Limit} = 0 and {Customer.Purchases} = 0) then

return 'credit limit and purchases are zero'

else

return 'credit limit and purchases are NOT zero'

end

Logical not, operator “not”

The result of the operation is the reverse of expression value.

if (not ({orderhea.status} = ‘Y’)) then

return drGreen

else

return drBlack

end

Comparison greater than, operator “>”

With this operator you can compare two operands (numbers or strings) with each other where the result is true

when the value of the left operand is greater than the value of the right operand.

if ({Customer.CurrentSpeed} > {Road.MaxSpeed}) then

return "You get a ticket"

else

return "Pass"

end

Comparison less than, operator “<”

With this operator you can compare two operands (numbers or strings) with each other where the result is true

when the value of the left operand is less than the value of the right operand.

if ({Customer.Credit_Limit} < {Customer.Purchases}) then

return drRed

else

return drBlack

end

Comparison greater than or equal to, operator “>=”

With this operator you can compare two operands (numbers or strings) with each other where the result is true

when the value of the left operand is greater than or equal to the value of the right operand.

Page 73: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 73 of 189 z

Business Software for a Changing WorldTM

if ({Customer.Credit_Limit} >= {Customer.Purchases}) then

return drRed

else

return drBlack

end

Comparison less than or equal to, operator “<=”

With this operator you can compare two operands (numbers or strings) with each other where the result is true

when the value of the left operand is less than or equal to the value of the right operand.

if ({Customer.Credit_Limit} <= {Customer.Purchases}) then

return drRed

else

return drBlack

end

Comparison equal, operator “=”

With this operator you can compare two operands (numbers or strings) with each other where the result is true

when the value of the left operand is equal to the value of the right operand.

if ({Customer.Credit_Limit} = {Customer.Purchases}) then

return drRed

else

return drBlack

end

Comparison not equal, operator “<>”

With this operator you can compare two operands (numbers or strings) with each other where the result is true

when the value of the left operand is not equal to the value of the right operand.

if ({Customer.Credit_Limit} <> {Customer.Purchases}) then

return 'not equal'

else

return 'equal'

end

Arithmetic add, operator “+”

The operator is used to add two numeric values to each other.

return ({Customer.Credit_Limit} + {Customer.Balance})

Arithmetic subtract, operator “-”

The operator is used to subtract two numeric values from each other.

return ({Customer.Credit_Limit} - {Customer.Purchases})

Arithmetic multiply, operator “*”

The operator is used to multiply two numeric values.

Page 74: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 74 of 189 z

Business Software for a Changing WorldTM

return ({OrderHea.Order_Total} * 2)

Arithmetic divide, operator “/”

The operator is used to divide two numeric values by each other.

return ({OrderHea.Order_Total} / 10.1)

Unary negate, operator “-”

You use this operator to reverse a numeric value (of an expression).

return (-{OrderHea.Order_Total})

When used as:

let iNum = -10

return (-iNum)

The result is positive 10.

Unary plus, operator “+”

The operator does not force a sign conversion by itself; it is more a documentation item. If you find:

Let iNum = +10

is more clear than:

Let iNum = 10

you can use the unary plus operator.

12.2.2 Statements The function language has the following statements defined.

Let

For assigning a value to a variable, where the value can be a constant, a database field or an expression.

It is not necessary to declare the variable first, the type of variable is automatically determined based on the

content. The variable name must start with a letter, followed by a number of alpha-numeric characters

(including an underscore ‘_’).

let x = {OrderHea.Order_Total}

let y = 0.75

let z = (y * x)

In the above example, variable ‘x’ gets the value of the order amount (database field). The variable ‘y’ is a

constant (value 0.75) and variable ‘z’ is the outcome of the multiplication of 0.75 times the order amount

(expression).

If then end

For conditional execution of statements.

Page 75: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 75 of 189 z

Business Software for a Changing WorldTM

if ({OrderHea.Order_Total} > {Customer.Order_Limit}) then

return 300

end

The result in this example is 300 if the Total order amount is higher than the order limit of the customer.

If then else end

For conditionally executing statements.

if ({OrderHea.Order_Total} > {Customer.Order_Limit}) then

return "!"

else

return "v"

end

The result in this example is an exclamation point (‘!’) if the Total order amount is higher than the order limit of

the customer. Otherwise the result is a check-mark (‘v’).

let iRed = rgb(255,0,0)

let iGreen = rgb(0,255,0)

let iBlack = rgb(0,0,0)

if ({OrderHea.Order_Total} > 0) then

return iGreen

else

if ({OrderHea.Order_Total} < 0) then

return iRed

else

return iBlack

end

end

The above example illustrates that it is possible to nest statements. The result is green for an amount higher

than 0, red for an amount less than 0 and black for equal to 0.

Note: for rgb color-codes, constants drRed, drGreen and drBlack can be used.

Return

Ends the function and sets the result for the function.

return ({Customer.Purchases} - {Customer.Balance})

In the above example the result is the differential between the total amount of purchases of the customer and

the balance.

While do end

This command group can be used to execute a loop.

The example below tests if a variable consists only of numbers. The characters are tested one by one. If a

character is found that is not a number, the loop is exited.

Note: The while loop automatically terminates when it iterates for more than 1000 times in order to avoid

infinite recursion, which causes the program to become unresponsive.

Page 76: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 76 of 189 z

Business Software for a Changing WorldTM

let testval = "1234X5678"

let length = len(testval)

let testchar = ""

let stop = 0

let cnt = 1

// test if the variable ‘testval’ only consists of numbers

while ((cnt <= length) and (stop = 0)) do

let testchar = mid(testval,cnt,1)

let stop = (Not(instr("1234567890",testchar)))

let cnt = (cnt + 1)

end

if (stop = 0) then

return "variable consists only of numbers"

else

return "variable does not only consist of numbers"

end

Dim

This command declares a variable. The variable only exists inside the function. Declaring a variable is optional.

The ‘Let’ statement automatically declares a variable before assigning a value to it. The variable name must start

with a letter, followed by any number of alphanumeric characters, including the underscore (‘_’).

dim nAmt

let nAmt = ({OrderDtl.Extended_Price} * 0.75)

return nAmt

The result of this function is 75% of the amount.

Dim as global

This command declares a global variable. Global variables are persistent throughout the report. The name of the

variable must start with a letter, followed by any number of alpha-numeric characters, including an underscore.

dim gTotal as global

let gTotal = 1

return gTotal //The global variable is also available in other functions.

12.2.3 Constants This part of the language elements shows which constants are defined and accepted in functions.

Category Values Boolean True

False

Page 77: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 77 of 189 z

Business Software for a Changing WorldTM

Category Values Colors drAqua

drBlack

drBlue

drFuchsia

drGray

drGreen

drLime

drMaroon

drNavy

drOlive

drPurple

drRed

drSilver

drTeal

drWhite

drYellow Date drWindowsLongDate

drWindowsShortDate

drCustomDate

drCustomDateMask Time drWindowsTime

drCustomTime

drCustomTimeMask Number drWindowsNumber

drCustomNumber Currency drWindowsCurrency

drCustomCurrency Weekdays drWindowsDayOfWeek

drSunday

drMonday

drTuesday

drWednesday

drThursday

drFriday

drSaturday Miscellaneous drNone Border styles drBorderNone

drBorderSingle

drBorderDouble

drBorderDashed

drBorderDotted Line styles drLineNone

drLineSingle

drLineDouble

drLineDashed

drLineDotted Text alignments drHorzAlignmentLeft

drHorzAlignmentCentered

drHorzAlignmentRight

Page 78: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 78 of 189 z

Business Software for a Changing WorldTM

Category Values Sum types drSum

drAverage

drMaximum

drMinimum

drCount

drDistinctCount Sum start drReport

drGroup1 … drGroup9 Gradients drHorizontalGradient

drVerticalGradient

drSolid Paper trays drNone

drBinUpper

drBinLower

drBinMiddle

drBinManual

drBinEnvelope

drBinEnvManual

drBinAuto

drBinTractor

drBinSmallFmt

drBinLargeCapacity

drBinCassette

drBinFormSource

12.3 Built-in functions The built-in functions are divided in the following functional groups:

String functions

Conversion functions

Date and Time functions

Arithmetic functions

Miscellaneous functions

Database functions

Page 79: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 79 of 189 z

Business Software for a Changing WorldTM

12.3.1 String functions

Trim

Returns a string with leading and trailing spaces removed.

Syntax: trim(str)

Argument Description str Required. Any valid string expression from which the spaces will be

removed.

Returns: String

Notes: When str cannot be converted to a string, a runtime error is generated.

Sample: let sTest = " Hello World "

return trim(sTest) // returns "Hello World"

Page 80: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 80 of 189 z

Business Software for a Changing WorldTM

LTrim

Returns a string with leading spaces removed.

Syntax: ltrim(str)

Argument Description str Required. Any valid string expression from which the leading spaces

will be removed.

Returns: String

Notes: When str cannot be converted to a string, a runtime error is generated.

Sample: let sTest = " Hello World "

return ltrim(sTest) // returns "Hello World "

// four spaces at the end are still there

Page 81: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 81 of 189 z

Business Software for a Changing WorldTM

RTrim

Returns a string with the trailing spaces removed.

Syntax: rtrim(str)

Argument Description str Required. Any valid string expression from which the trailing spaces

will be removed.

Returns: String

Notes: When str cannot be converted to a string, a runtime error is generated.

Sample: let sTest = " Hello World "

return rtrim(sTest) // returns " Hello World"

// four spaces at the start are still there

Page 82: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 82 of 189 z

Business Software for a Changing WorldTM

Left

Returns a string containing a specified number of characters from the left side of the string.

Syntax: left(str, int)

Argument Description str Required. Any valid string expression from which the specified

number of characters are returned. int Required. Any valid integer expression. The number of characters

returned.

Returns: String

Notes: When str or int cannot be converted to the specified type a runtime error is generated. If int is 0, an empty string ("") is returned. If greater than or equal to the number of characters in str, the entire string is returned.

Sample: let sTest = "Hello World"

return left(sTest,5) // returns "Hello"

Page 83: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 83 of 189 z

Business Software for a Changing WorldTM

Right

Returns a string containing a specified number of characters from the right side of the string.

Syntax: right(str, int)

Argument Description str Required. Any valid string expression from which the specified

number of characters are returned. int Required. Any valid integer expression. The number of characters

returned.

Returns: String

Notes: When str or int cannot be converted to the specified type a runtime error is generated. If int is 0, an empty string ("") is returned. If greater than or equal to the number of characters in str, the entire string is returned.

Sample: let sTest = "Hello World"

return right(sTest,5) // returns "World"

Page 84: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 84 of 189 z

Business Software for a Changing WorldTM

Mid

Returns a string containing a specified number of characters from a string.

Syntax: mid(str, int1 [, int2])

Argument Description str Required. Any valid string expression from which the specified

number of characters are returned. int1 Required. Any valid integer expression. Starting position of the

characters in str to return. int1 is one based. int2 Optional. Any valid integer expression. Number of characters to

return.

Returns: String

Notes: When the arguments cannot be converted to the specified type a runtime error is generated. If int1 is greater than the number of characters in str, the function returns an empty string (""). If int2 is omitted or if greater than or equal to the number of characters in str from int1, the entire string from the start position is returned.

Sample: let sTest = "Mid Function Demo"

let sRet1 = mid(sTest, 1, 3) // = "Mid"

let sRet2 = mid(sTest, 14) // = "Demo"

let sRet3 = mid(sTest, 5, 8) // = "Function"

return (sRet1 * sRet2 * sRet3) // returns "Mid Demo Function"

Page 85: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 85 of 189 z

Business Software for a Changing WorldTM

UCase

Returns a string with all characters converted to uppercase.

Syntax: ucase(str)

Argument Description str Required. Any valid string expression which will be converted to

uppercase.

Returns: String

Notes: When str cannot be converted to a string, a runtime error is generated.

Sample: let sTest = "Hello World"

return ucase(sTest) // returns "HELLO WORLD"

Page 86: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 86 of 189 z

Business Software for a Changing WorldTM

LCase

Returns a string with all characters converted to lowercase.

Syntax: lcase(str)

Argument Description str Required. Any valid string expression which will be converted to

lowercase.

Returns: String

Notes: When str cannot be converted to a string, a runtime error is generated.

Sample: let sTest = "Hello World"

return lcase(sTest) // returns "hello world"

Page 87: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 87 of 189 z

Business Software for a Changing WorldTM

Len

Returns the number of characters in a string.

Syntax: len(str)

Argument Description str Required. Any valid string expression.

Returns: Integer

Notes: When str cannot be converted to a string, a runtime error is generated.

Sample: let sTest = "Hello World"

return len(sTest) // returns 11

Page 88: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 88 of 189 z

Business Software for a Changing WorldTM

InStr

Returns the starting position of the first occurrence of one string within another.

Syntax: instr(str1, str2 [,int [,bool]])

Argument Description str1 Required. Any valid string expression. The string being searched. str2 Required. Any valid string expression containing the search string. int Optional. Any valid integer expression containing the starting position

of the search. bool Optional. Any valid Boolean expression indicating if the search is case

insensitive.

Returns: Integer

Notes: When the arguments cannot be converted to the specified type a runtime error is generated. If int is omitted the search will begin with the first character. If bool is omitted the search will be case-sensitive. If str2 is not found the function returns 0.

Sample: let iPos = instr("AbraCadaBra", "b")

return iPos // returns 2

//Example starting point:

let iPos = instr("AbraCadaBra", "r", 3)

return iPos // returns 10

//Example case sensitive search:

let iPos = instr("AbraCadaBra", "B")

return iPos // returns 9

//Example case insensitive search:

let iPos = instr("AbraCadaBra", "B", 0, true)

return iPos // returns 2

Page 89: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 89 of 189 z

Business Software for a Changing WorldTM

InStrRev

Returns the starting position of the last occurrence of one string within another.

Syntax: instrrev(str1, str2 [,int [,bool]])

Argument Description str1 Required. Any valid string expression. The string being searched. str2 Required. Any valid string expression containing the search string. int Optional. Any valid integer expression containing the starting position

of the search. bool Optional. Any valid Boolean expression indicating if the search is case

insensitive.

Returns: Integer

Notes: When the arguments cannot be converted to the specified type a runtime error is generated. If int is omitted the search will begin with the first character. If bool is omitted the search will be case-sensitive. If str2 is not found the function returns 0.

Sample: //Example case sensitive search:

let iPos = instrrev("AbraCadaBra","A",5)

return iPos // returns 1

//Example case insensitive search:

let iPos = instrrev("AbraCadaBra","A",5, true)

return iPos // returns 6

Page 90: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 90 of 189 z

Business Software for a Changing WorldTM

Replace

Returns a string with all occurrences of substring replaced with another string.

Syntax: replace(str1, str2, str3 [,bool])

Argument Description str1 Required. Any valid string expression. The string in which the string

will be replaced. str2 Required. Any valid string expression containing the search string. str3 Optional. Any valid string expression containing the string which will

replace all occurrences of str2 in str1. bool Optional. Any valid Boolean expression indicating if the search is case

insensitive.

Returns: String

Notes: When the arguments cannot be converted to the specified type a runtime error is generated. If bool is omitted the search will be case-sensitive.

Sample: //Example case sensitive replace:

let sTest = replace("ABC123abc", "abc", "def" )

return sTest // returns "ABC123def"

//Example case insensitive replace:

let sTest = replace("ABC123abc", "abc", "def", 1)

return sTest // returns "def123def"

Page 91: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 91 of 189 z

Business Software for a Changing WorldTM

Asc

Returns the ANSI character code of the first characters in a string.

Syntax: asc(str)

Argument Description str Required. Any valid string expression.

Returns: Integer

Notes: When str cannot be converted to a string, a runtime error is generated.

Sample: return asc("a") // returns 97

return (asc (lcase (left ({Customer.Name},1))))

// depending on first character of customer name

Page 92: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 92 of 189 z

Business Software for a Changing WorldTM

Chr

Returns the character associated with the specified ANSI character code.

Syntax: chr(int)

Argument Description int Required. Any valid integer expression containing the ANSI character

code.

Returns: String

Notes: When int cannot be converted to an integer, a runtime error is generated. The range of int is between 0 and 255. Control characters (< 32) are allowed.

Sample: return Chr(97) // returns "a"

Page 93: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 93 of 189 z

Business Software for a Changing WorldTM

StrComp

Compares two strings and returns an integer indicating the result of the comparison.

Syntax: strcomp(str1, str2 [,bool])

Argument Description str1 Required. Any valid string expression. str2 Required. Any valid string expression. bool Optional. Any valid Boolean expression indicating if the compare is

case insensitive.

Returns: Integer

Return value Meaning -1 str1 is lesser than str2 0 str1 is equal to str2 1 str1 is greater than str2

Notes: When the arguments cannot be converted to the specified type a runtime error is generated. If bool is omitted the search will be case-sensitive.

Sample: //Example case sensitive compare:

let sStr1 = "ABCD"

let sStr2 = "abcd"

// This is a case sensitive comparison.

return strcomp(sStr1, sStr2, 0) // returns -1 (less than)

// Example case insensitive compare:

let sStr1 = "ABCD"

let sStr2 = "abcd"

// This is a case insensitive comparison.

return strcomp(sStr1, sStr2, true) // returns 0 (equal to)

Page 94: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 94 of 189 z

Business Software for a Changing WorldTM

StrReverse

Returns a string with the order of characters reversed.

Syntax: strreverse(str)

Argument Description str Required. Any valid string expression.

Returns: String

Notes: When str cannot be converted to a string, a runtime error is generated.

Sample: let sTest = "Hello World"

return strreverse(sTest) // returns "dlroW olleH"

return strreverse({customer.name})

// when in above the customer name is "True Value & Tool Comp"

// the result is: "pmoC looT & eulaV eurT"

Page 95: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 95 of 189 z

Business Software for a Changing WorldTM

String

Build up a string with repetitions of the passed string argument.

Syntax: string(int, str)

Argument Description int Required. Any valid integer expression. The number of characters

returned. str Required. Any valid string expression. You can use a number that

corresponds with an ASCII character.

Returns: String

Notes: When the arguments cannot be converted to the specified type a runtime error is generated.

Sample: return string(5, 42) // returns "*****"

return string(4, "a") // returns "aaaa"

return string(3, " sample ") // returns " sample sample sample "

Page 96: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 96 of 189 z

Business Software for a Changing WorldTM

Space

Returns a string that contains 1-256 space characters.

Syntax: space(int)

Argument Description int Required. Any valid integer expression. The number of spaces

returned.

Returns: String

Notes: When int cannot be converted to the specified type a runtime error is generated. The value of int needs to be between 1 and 256. Above or below you will get a runtime error.

Sample: return ("Hello" + Space(3) + "World") // returns "Hello World"

Page 97: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 97 of 189 z

Business Software for a Changing WorldTM

ProperCase

Formats a string by upper- and lowercasing the input value using optional rules.

Syntax: propercase(str1 [,str2])

Argument Description str1 Required. Any valid integer expression. str2 Optional. Overrides the default behavior of capitalizing the first alpha

character after each space. The first alpha character in string is capitalized when a non-alpha character is found that matches a non-alpha character in override string. When the override string contains an upper case alpha character all corresponding characters in string will be upper cased. If in override string a lower case alpha character is used all corresponding characters in string will be lower cased.

Returns: String

Notes: When the arguments cannot be converted to the specified type a runtime error is generated.

Sample: return ProperCase("JOHN DOE") // returns "John Doe"

return ProperCase("sentence one. sentence two", ".")

// returns "Sentence one. Sentence two"

return ProperCase("12ABcdef !gH", "aDE!") // returns "12abcDEf !Gh"

return ProperCase("1, string: ONE. 2, string: TWO.", ":t")

// returns "1, String: One. 2, String: two"

Page 98: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 98 of 189 z

Business Software for a Changing WorldTM

NumberToRoman

Returns a Roman presentation of an integer.

Syntax: numbertoroman(int)

Argument Description int Required. Any integer expression. The value to be converted to a

Roman presentation.

Returns: String

Notes: Roman numbers have a range from 1 to 3999, when passing a number greater than 3999 a runtime error is generated.

Sample: return NumberToRoman(459) // returns CDLIX

return NumberToRoman(year(now())) // returned MMXIII in 2013

Page 99: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 99 of 189 z

Business Software for a Changing WorldTM

12.3.2 Conversion functions

CInt

Returns an expression converted to an integer.

Syntax: cint(exp)

Argument Description exp Required. Any valid expression.

Returns: Integer

Notes: CInt rounds expressions. When the fractional part is exactly 0.5, CInt always rounds to the nearest even number. CInt uses the locale settings to convert expression to integer. When exp cannot be converted to an integer, a runtime error is generated.

Sample: let nTest = 2345.6789

return cint(nTest) // returns 2346

Page 100: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 100 of 189 z

Business Software for a Changing WorldTM

CBool

Returns an expression converted to a Boolean.

Syntax: cbool(exp)

Argument Description exp Required. Any valid expression.

Returns: Boolean

Notes: If exp evaluates to zero, CBool returns false (0); otherwise CBool returns true (-1). When exp cannot be converted to a Boolean, a runtime error is generated.

Sample: let A = 4

let B = 5

return cbool(A = B)

Page 101: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 101 of 189 z

Business Software for a Changing WorldTM

CByte

Returns an expression converted to a byte.

Syntax: cbyte(exp)

Argument Description exp Required. Any valid expression.

Returns: Byte

Notes: CByte rounds expressions. When the fractional part is exactly 0.5, CByte always rounds to the nearest even number. CByte uses the locale settings to convert exp to byte. When exp cannot be converted to a byte (0-255), a runtime error is generated.

Sample: let nTest = 125.5678

return cbyte(nTest) // returns 126

Page 102: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 102 of 189 z

Business Software for a Changing WorldTM

CCur

Returns an expression converted to a currency.

Syntax: ccur(exp)

Argument Description exp Required. Any valid expression.

Returns: Currency

Notes: CCur rounds expressions to four decimals and uses the locale setting for decimal and thousand separators. When exp cannot be converted to a Currency, a runtime error is generated.

Sample: let nTest = 125.5678

return ccur(nTest) // returns 543.2146 (4 decimal currency)

Page 103: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 103 of 189 z

Business Software for a Changing WorldTM

CDate

Returns an expression converted to a date.

Syntax: cdate(exp)

Argument Description exp Required. Any valid expression.

Returns: DateTime

Notes: CDate uses the locale settings to convert expression to date. When exp cannot be converted to a date, a runtime error is generated.

Sample: let sTest = "February 10 2010"

return cdate(sTest)

Page 104: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 104 of 189 z

Business Software for a Changing WorldTM

CDbl

Returns an expression converted to a double.

Syntax: cdbl(exp)

Argument Description exp Required. Any valid expression.

Returns: Double

Notes: CDbl uses the locale settings to convert expression to double. When exp cannot be converted to a double, a runtime error is generated.

Sample: let nTest = ccur(234.456784)

let nCurr = (nTest * 8.2 * 0.01)

return cdbl(nCurr) // returns 19.2254576

Page 105: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 105 of 189 z

Business Software for a Changing WorldTM

CLng

Returns an expression converted to a (long) integer.

Syntax: clng(exp)

Argument Description exp Required. Any valid expression.

Returns: Integer (32 bit)

Notes: CLng rounds expressions. When the fractional part is exactly 0.5, CLng always rounds to the nearest even number. CLng uses the locale settings to convert expression to integer. When exp cannot be converted to an integer, a runtime error is generated.

Sample: let nDouble = 75.3421115

return clng(nDouble) // returns 75

Page 106: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 106 of 189 z

Business Software for a Changing WorldTM

CSgn

Returns an expression converted to a single precision floating point.

Syntax: csgn(exp)

Argument Description exp Required. Any valid expression.

Returns: Single precision floating point number

Notes: CSgn uses the locale settings to convert expression to single. When exp cannot be converted to a numeric value, a runtime error is generated.

Sample: let nDouble = 75.342111568945835

return cstr(csgn(nDouble)) // returns 75.34211156894584

Page 107: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 107 of 189 z

Business Software for a Changing WorldTM

CStr

Returns an expression converted to a string.

Syntax: cstr(exp)

Argument Description exp Required. Any valid expression.

Returns: String

Notes: When exp cannot be converted to a string, a runtime error is generated.

Sample: let nTest = 123.456

return ("Amount: " + cstr(nTest)) // returns "Amount: 123.456"

Page 108: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 108 of 189 z

Business Software for a Changing WorldTM

12.3.3 Date and time functions

Now

Returns the current date and time.

Syntax: now()

Returns: DateTime

Notes:

Sample: let dtSys = now()

return dtSys // returns current date and time

Page 109: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 109 of 189 z

Business Software for a Changing WorldTM

Date

Returns the current date.

Syntax: date()

Returns: DateTime

Notes:

Sample: let dSys = date()

return dSys // returns current date

Page 110: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 110 of 189 z

Business Software for a Changing WorldTM

Time

Returns the current time.

Syntax: time()

Returns: DateTime

Notes: Time returns a DateTime variable with the date portion set to December 30, 1899.

Sample: let iTime = time()

return iTime // returns current time

Page 111: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 111 of 189 z

Business Software for a Changing WorldTM

Year

Returns the year from a datetime expression.

Syntax: year(date)

Argument Description date Required. Any valid datetime expression from which the year will be

returned.

Returns: Integer

Notes: When date cannot be converted to a datetime, a runtime error is generated.

Sample: // the following returns the current year

let dtSys = now()

return year(dtSys)

// the following returns the number of years between two dates

return (year(now) – year({Orderhea.Order_Date})

Page 112: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 112 of 189 z

Business Software for a Changing WorldTM

Month

Returns the month from a datetime expression.

Syntax: month(date)

Argument Description date Required. Any valid datetime expression from which the month will

be returned.

Returns: Integer

Notes: When date cannot be converted to a datetime, a runtime error is generated. When date is passed as string, your PC’s regional settings are used for the conversion to datetime. If that fails you get a runtime error.

Sample: // returns the month (2) of the year

return month("3 february 2010")

// returns the month of the order date

return month({orderhea.order_date})

// returns the month (2) of the constructed date via DateSerial

return month(dateserial(2000,2,3))

// returns the month of the static date string

return month("02/03/2000")

Page 113: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 113 of 189 z

Business Software for a Changing WorldTM

Day

Returns the day from a datetime expression.

Syntax: day(date)

Argument Description date Required. Any valid datetime expression from which the day will be

returned.

Returns: Integer

Notes: When date cannot be converted to a datetime, a runtime error is generated.

Sample: // returns the day of the month of the orderdate

return day({OrderHea.Order_Date})

Page 114: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 114 of 189 z

Business Software for a Changing WorldTM

Hour

Returns the hour from a datetime expression.

Syntax: hour(date)

Argument Description date Required. Any valid datetime expression from which the hour will be

returned.

Returns: Integer

Notes: When date cannot be converted to a datetime, a runtime error is generated.

Sample: let dtSys = now()

return hour(dtSys) // returns the hour of the current time

Page 115: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 115 of 189 z

Business Software for a Changing WorldTM

Minute

Returns the minute from a datetime expression.

Syntax: minute(date)

Argument Description date Required. Any valid datetime expression from which the minute will

be returned.

Returns: Integer

Notes: When date cannot be converted to a datetime, a runtime error is generated.

Sample: let dtSys = now()

return minute(dtSys) // returns the minute of the current time

Page 116: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 116 of 189 z

Business Software for a Changing WorldTM

Second

Returns the second from a datetime expression.

Syntax: second(date)

Argument Description date Required. Any valid datetime expression from which the second will

be returned.

Returns: Integer

Notes: When date cannot be converted to a datetime, a runtime error is generated.

Sample: let dtSys = now()

return second(dtSys) // returns the second of the current time

Page 117: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 117 of 189 z

Business Software for a Changing WorldTM

Weekday

Returns an integer indicating the day of the week from a datetime expression.

Syntax: weekday(date)

Argument Description date Required. Any valid datetime expression from which the weekday will

be returned.

Returns: Integer

Notes: When date cannot be converted to a datetime, a runtime error is generated. WeekDay does not use the locale settings to calculate the weekday – it always returns the same value for a specific day of the week.

Sample: // returns 1 (Sunday = 1 , Monday = 2 ...)

return weekday(dateserial(2014,5,30))

// Returns a text based on the compare if the weekday is monday

if (weekday ({OrderHea.Order_Date}) = drMonday) then

return "first day"

else

return "other day"

end

Page 118: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 118 of 189 z

Business Software for a Changing WorldTM

WeekdayName

Returns a string holding the day of the week from a datetime expression.

Syntax: weekdayname(date [,bool])

Argument Description date Required. Any valid datetime expression from which the weekday will

be returned. bool Optional. When a true value is passed the abbreviated name of the

weekday is returned (e.g. "mo" instead of "Monday").

Returns: String

Notes: When date cannot be converted to a datetime, a runtime error is generated. WeekDayName uses the locale settings to determine the name of the weekday.

Sample: // returns "Friday" when PC’s regional settings are set to English

return weekdayname(dateserial(2014,5,30))

Page 119: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 119 of 189 z

Business Software for a Changing WorldTM

MonthName

Returns a string holding the month from a datetime expression.

Syntax: monthname(date [,bool])

Argument Description date Required. Any valid datetime expression from which the month will

be returned. bool Optional. When true, the returned name is the abbreviated name of

the month (e.g. Sep vs September).

Returns: String

Notes: When date cannot be converted to a datetime, a runtime error is generated. MonthName uses the locale settings to determine the name of the month.

Sample: // returns "May" when PC’s regional settings are set to English

return weekdayname(dateserial(2014,5,30))

Page 120: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 120 of 189 z

Business Software for a Changing WorldTM

DateDiff

Returns the interval between two dates.

Syntax: datediff(str, date1, date2)

Argument Description str Required. One of the following letters, static or as result of an valid

expression:

D (day)

H (hour)

N (minute)

S (second) date1 Required. Any valid datetime expression. date2 Required. Any valid datetime expression.

Returns: Integer

Notes: When the arguments cannot be converted to the specified type a runtime error is generated.

Sample: // returns the number days between current date and time and the

// stored order date and time

return datediff('D', now(), {OrderHea.Order_Date})

Page 121: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 121 of 189 z

Business Software for a Changing WorldTM

DateAdd

Returns a date with the specified interval added.

Syntax: dateadd(str, int, date)

Argument Description str Required. Any valid string expression containing the interval:

D (day)

H (hour)

N (minute)

S (second) int Required. Any valid integer expression holding the amount to add. date Required. Any valid datetime expression to which the interval is

added.

Returns: DateTime

Notes: When the arguments cannot be converted to the specified type a runtime error is generated.

Sample: // Adds 2 days to the order date

return dateadd ('D', 2, {OrderHea.Order_Date})

// Print order date and date to pay

return ('Ordered at: ' + cstr({OrderHea.Order_Date}) +

', pay before: ' + cstr(dateadd ('D', 14, {OrderHea.Order_Date})))

Page 122: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 122 of 189 z

Business Software for a Changing WorldTM

DatePart

Returns the specified part from a date.

Syntax: datepart(str, date)

Argument Description str Required. Any valid string expression containing the interval:

D (day)

H (hour)

N (minute)

S (second)

Yyyy (year)

M (month)

Y (day of year)

W (weekday) date Required. Any valid datetime expression to which the interval is

added.

Returns: Integer

Notes: When the arguments cannot be converted to the specified type a runtime error is generated.

Sample: // Returns the day number of the order date

return datepart("D", {OrderHea.Order_Date})

// returns the difference between now and the order date in years,

// months and days. Days can be negative, no correction made on that.

let iYears = datepart("Yyyy", now())

- datepart("Yyyy", {OrderHea.Order_Date})

let iMonths = datepart('M', now())

- datepart('M', {OrderHea.Order_Date})

let iDays = datepart('D', now())

- datepart('D', {OrderHea.Order_Date})

return ("Difference: " + cstr(iYears) + ' years, '

+ cstr(iMonths) + ' months and '

+ cstr(iDays) + ' days')

Page 123: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 123 of 189 z

Business Software for a Changing WorldTM

DateSerial

Returns a date from the specified year, month and day.

Syntax: dateserial(int1, int2, int3)

Argument Description int1 Required. Any valid integer expression containing the year. int2 Required. Any valid integer expression containing the month. int3 Required. Any valid integer expression containing the day.

Returns: DateTime

Notes: When the arguments cannot be converted to the specified type a runtime error is generated. DateSerial returns a datetime with the time portion set to midnight. For int1 (the year), values between 0 and 99 are interpreted as the years 1900-1999.

Sample: // Constructs a new date by subtracting 10 years from the static year

1990

let dVar = dateserial(1990 - 10, 5, 31)

return dVar // returns 31 May, 1980

Page 124: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 124 of 189 z

Business Software for a Changing WorldTM

TimeSerial

Returns a time from the specified hour, minute and second.

Syntax: timeserial(int1, int2, int3)

Argument Description int1 Required. Any valid integer expression containing the hour. int2 Required. Any valid integer expression containing the minute. int3 Required. Any valid integer expression containing the second.

Returns: DateTime

Notes: When the arguments cannot be converted to the specified type a runtime error is generated. DateSerial returns a datetime with the time portion set to midnight. TimeSerial returns a datetime variable with the date portion set to December 30, 1899.

Sample: // returns Saturday, december 30, 1899 6:15:00 AM

let dtTime = timeserial((12 - 6), 15, 0)

return dtTime

Page 125: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 125 of 189 z

Business Software for a Changing WorldTM

DateValue

Returns a date from the specified expression.

Syntax: datevalue(str)

Argument Description str Required. Any valid string expression containing the date.

Returns: DateTime

Notes: When the arguments cannot be converted to the specified type a runtime error is generated. DateValue uses the locale settings to determine the date. DateValue returns a date with the time portion set to midnight.

Sample: // returns a fixed date; Saturday, June 05, 2010, 12:00:00 AM

return datevalue("06/05/2010")

// returns the date of now, so current date.

// The result is identical to Date()

return datevalue(now())

Page 126: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 126 of 189 z

Business Software for a Changing WorldTM

TimeValue

Returns a time from the specified expression.

Syntax: timevalue(str)

Argument Description str Required. Any valid string expression containing the time.

Returns: DateTime

Notes: When the arguments cannot be converted to the specified type a runtime error is generated. TimeValue uses the locale settings to determine the date. TimeValue returns a datetime variable with the date portion set to December 30, 1899.

Sample: // returns Saturday, december 30, 1899 12:34:00 PM

return timevalue("12:34")

// returns the time of now, so current time. The result is identical

to Time()

return timevalue(now())

Page 127: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 127 of 189 z

Business Software for a Changing WorldTM

InLeapYear

Returns whether the specified date expression resolves to a leap year or not.

Syntax: inleapyear(date)

Argument Description date Required. Any valid date expression.

Returns: Boolean

Notes: When the arguments cannot be converted to the specified type a runtime error is generated.

Sample: // Are we in a LeapYear?

if InLeapYear(now()) then

return "We are in a leap year"

else

return "We are not in a leap year"

end

Page 128: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 128 of 189 z

Business Software for a Changing WorldTM

WeekAgo

Returns a date and time minus 7 days from the specified date and time.

Syntax: weekago(datetime)

Argument Description datetime Required. Any valid date expression containing a date.

Returns: DateTime

Notes: When the arguments cannot be converted to the specified type a runtime error is generated. WeekAgo returns a datetime variable with the time portion set to 0:00:00 if no time value is given.

Sample: // returns Monday, march 25, 2013 00:00:00 PM

return WeekAgo("01-04-2013")

// returns the time of now minus 7 days with the current time.

return WeekAgo(now())

Page 129: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 129 of 189 z

Business Software for a Changing WorldTM

InLast7Days

Returns true if the specified date expression is in the last 7 days.

Syntax: inlast7days(date)

Argument Description date Required. Any valid date expression.

Returns: Boolean

Notes: When the arguments cannot be converted to the specified type a runtime error is generated.

Sample: // Placed in a Font Color function

if InLast7Days({OrderHea.Order_Date}) then

return drBlack

else

return drRed

end

Page 130: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 130 of 189 z

Business Software for a Changing WorldTM

InLastFullMonth

Returns true when the specified date is in the last full month.

Syntax: inlastfullmonth(date)

Argument Description date Required. Any valid date expression.

Returns: Boolean

Notes: When the arguments cannot be converted to the specified type a runtime error is generated.

Sample: // Placed in a Font Color function

if InLastFullMonth({OrderHea.Order_Date}) then

return drBlack

else

return drRed

end

Page 131: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 131 of 189 z

Business Software for a Changing WorldTM

InLastFullWeek

Returns true if the passed date is in the last full week (Sunday to Saturday).

Syntax: inlastfullweek(date)

Argument Description date Required. Any valid date expression.

Returns: Boolean

Notes: When the arguments cannot be converted to the specified type a runtime error is generated.

Sample: // Placed in a Font Color function

if InLastFullWeek({OrderHea.Order_Date}) then

return drBlack

else

return drRed

end

Page 132: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 132 of 189 z

Business Software for a Changing WorldTM

InLastYearMTD

Returns true if the passed date falls in any date in the current month last year up to the current date last year. If

the current date is 2014-12-18 any date passed that is between 2013-12-01 and 2013-12-18 is valid.

Syntax: inlastyearmtd(date)

Argument Description date Required. Any valid date expression.

Returns: Boolean

Notes: When the arguments cannot be converted to the specified type a runtime error is generated.

Sample: // Placed in a Font Color function

if InLastYearMTD({OrderHea.Order_Date}) then

return drBlack

else

return drRed

end

Page 133: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 133 of 189 z

Business Software for a Changing WorldTM

InLastYearYTD

Returns true if the passed date falls in any date in the last year up to the current date last year. If the current

date is 2014-12-08 any date passed that is between 2013-01-01 and 2013-12-08 is valid.

Syntax: inlastyearytd(date)

Argument Description date Required. Any valid date expression.

Returns: Boolean

Notes: When the arguments cannot be converted to the specified type a runtime error is generated.

Sample: // Placed in a Font Color function

if InLastYearYTD({OrderHea.Order_Date}) then

return drBlack

else

return drRed

end

Page 134: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 134 of 189 z

Business Software for a Changing WorldTM

InLast4WeeksToSunday

Returns true if the passed date falls in the last four weeks ending the last Sunday. If the current date is 2013-08-

20 any date passed that is between 2013-07-21 and 2013-08-17 is valid.

Syntax: inlast4weekstosunday(date)

Argument Description date Required. Any valid date expression.

Returns: Boolean

Notes: When the arguments cannot be converted to the specified type a runtime error is generated.

Sample: // Placed in a Font Color function

if InLast4WeeksToSunday({OrderHea.Order_Date}) then

return drBlack

else

return drRed

end

Page 135: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 135 of 189 z

Business Software for a Changing WorldTM

InAgedToDays

Returns true if the passed date is between a number of days ago.

Syntax: inagedtodays(date, num1 [,num2])

Argument Description date Required. Any valid date expression. num1 Required. The maximum days ago. num2 Optional. The minimum number of days ago. Default = 0.

Returns: Boolean

Notes: When the arguments cannot be converted to the specified type a runtime error is generated.

Sample: // Placed in a Font Color function

if InAgedToDays({OrderHea.Order_Date}, 30) then

return drBlack

else if InAgedToDays({OrderHea.Order_Date}}, 60, 31) then

return drYellow

else if InAgedToDays({OrderHea.Order_Date}, 90, 61) then

return rgb(205,140,0) // Orange

else // Date is > 90 days ago

return drRed

end

Page 136: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 136 of 189 z

Business Software for a Changing WorldTM

12.3.4 Arithmetic functions

Abs

Returns the absolute value of a number.

Syntax: abs(num)

Argument Description num Required. Any numeric expression.

Returns: Number

Notes: When num cannot be converted to a number, a runtime error is generated.

Sample: let nVar = -50.3

return abs(nVar) // returns 50.3

Page 137: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 137 of 189 z

Business Software for a Changing WorldTM

Atn

Returns the arctangent of a number.

Syntax: atn(num)

Argument Description num Required. Any numeric expression.

Returns: Number

Notes: When num cannot be converted to a number, a runtime error is generated.

Sample: return (4 * Atn(1))

// returns 3.14 (when the field has a 2 decimal format)

Page 138: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 138 of 189 z

Business Software for a Changing WorldTM

Cos

Returns the cosine of an angle.

Syntax: cos(num)

Argument Description num Required. Any numeric expression. Represents the angle in radians.

Returns: Number

Notes: When num cannot be converted to a number, a runtime error is generated. To convert degrees to radians, multiply degrees by pi/180.

Sample: return cos(1.047)

// returns 0.50 (when the field has a 2 decimal format)

Page 139: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 139 of 189 z

Business Software for a Changing WorldTM

Sin

Returns the sine of an angle.

Syntax: sin(num)

Argument Description num Required. Any numeric expression. Represents the angle in radians.

Returns: Number

Notes: When num cannot be converted to a number, a runtime error is generated. To convert degrees to radians, multiply degrees by pi/180.

Sample: return sin(0.5235988)

// returns 0.50 (when the field has a 2 decimal format)

Page 140: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 140 of 189 z

Business Software for a Changing WorldTM

Tan

Returns the tangent of an angle.

Syntax: tan(num)

Argument Description num Required. Any numeric expression. Represents the angle in radians.

Returns: Number

Notes: When num cannot be converted to a number, a runtime error is generated. To convert degrees to radians, multiply degrees by pi/180.

Sample: return tan(0.593412)

// returns 0.67 (when the field has a 2 decimal format)

Page 141: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 141 of 189 z

Business Software for a Changing WorldTM

Log

Returns the natural logarithm of a number.

Syntax: log(num)

Argument Description num Required. Any numeric expression greater than 0.

Returns: Number

Notes: When num cannot be converted to a number, a runtime error is generated.

Sample: return log(86)

// returns 4.45 (when the field has a 2 decimal format)

Page 142: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 142 of 189 z

Business Software for a Changing WorldTM

Sqr

Returns the square root of a number.

Syntax: sqr(num)

Argument Description num Required. Any numeric expression greater than 0.

Returns: Number

Notes: When num cannot be converted to a number, a runtime error is generated.

Sample: return sqr(23)

// returns 4.78 (when the field has a 2 decimal format)

Page 143: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 143 of 189 z

Business Software for a Changing WorldTM

Exp

Returns the natural antilogarithm of a number.

Syntax: exp(num)

Argument Description num Required. Any numeric expression. If num exceeds 709.782712893 an

error is generated.

Returns: Number

Notes: When num cannot be converted to a number, a runtime error is generated.

Sample: return exp(5)

// returns 148.41 (when the field has a 2 decimal format)

Page 144: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 144 of 189 z

Business Software for a Changing WorldTM

Fix

Returns the integer portion of a number.

Syntax: fix(num)

Argument Description num Required. Any numeric expression.

Returns: Integer

Notes: When num cannot be converted to an integer, a runtime error is generated.

Sample: return fix(-99.8)

// returns -99

Page 145: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 145 of 189 z

Business Software for a Changing WorldTM

Sgn

Returns an integer indicating the sign of a number.

Syntax: sgn(num)

Argument Description num Required. Any numeric expression.

Returns: Integer, the following can be returned:

num returned value Greater than zero 1 Zero 0 Less than zero -1

Notes: When num cannot be converted to a number, a runtime error is generated.

Sample: return sgn(-3)

// returns -1

Page 146: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 146 of 189 z

Business Software for a Changing WorldTM

Mod

Returns the remainder after a number is divided by a divisor.

Syntax: mod(num1, num2)

Argument Description num1 Required. Any numeric expression. Specifies the value to divide. num2 Required. Any numeric expression greater than 0. Specifies the

number to divide by.

Returns: Number

Notes: When num cannot be converted to a number, a runtime error is generated.

Sample: let nTest = mod(47.9, 9.35)

return nTest // returns 1.15

Page 147: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 147 of 189 z

Business Software for a Changing WorldTM

Round

Returns a rounded number.

Syntax: round(num [,exp [,type]])

Argument Description num Required. Any numeric expression. The number to be rounded. exp Optional. Any numeric expression. The number of decimals included

in the rounding or when type is drRoundUpToExp or drRoundDownToExp the number to round to.

type Optional. One of the following constants defining a method of rounding:

drRoundHalfToEven (default) rounds to the nearest even number. As default "Gaussian" rounding will be used. This method uses the Gauss rule, also known as the "Banker's rounding", that if you are in a perfect half case, you must round to the nearest digit that can be divided by 2 (0, 2, 4, 6, and 8). This rule is important to obtain more accurate results with rounded numbers after multiple mathematical operations.

drRoundHalfUp rounds half towards positive infinity. That is, half-way numbers are always rounded up. If the fraction of num is exactly 0.5, then the result is num + 0.5. For example, by this rule the value 23.5 gets rounded to 24, but −23.5 gets rounded to −23.

drRoundHalfDown rounds half towards negative infinity. As opposed from drRoundHalfUp, drRoundHalfDown will round num down. For example 23.5 is rounded to 23 and -23.5 will be rounded to -24.

drRoundHalfToZero rounds half away from infinity. That is, half-way numbers are always rounded towards zero. If the fraction of num is exactly 0.5, then the result is num - 0.5. For example, by this rule the value 23.5 gets rounded to 23, but −23.5 becomes −23.

drRoundHalfFromZero rounds half towards infinity. That is, half-way numbers are always rounded away from zero. If the fraction of num is exactly 0.5, then the result is num + 0.5. For example, by this rule the value 23.5 gets rounded to 24, but −23.5 gets rounded to −24.

drRoundFromZero rounds towards infinity. The function returns the smallest number which is not less than the input. For example, 12.2 gets rounded to 13 and -12.2 gets rounded to -13.

drRoundToZero rounds away from infinity. The function returns the smallest number which does not exceed the input. For example, 12.2 gets rounded to 12 and -12.2 gets rounded to -12.

drRoundUp rounds towards positive infinity. Aka take the ceiling, the function returns the smallest integer that is not less than num. For example, 12.2 gets rounded to 13, but -12.2 gets rounded to -12.

Page 148: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 148 of 189 z

Business Software for a Changing WorldTM

drRoundDown rounds towards negative infinity. Aka take the floor, the function returns the largest integer that does not exceed num. For example, 12.2 gets rounded to 12, but -12.2 gets rounded to -13.

drRoundUpToExp rounds up to the power of. The number will be rounded up to the first multiplied value of exp that is not less than num. This rounding is called the "Merchants rounding" as it is most used to avoid penny prices on products. See example below.

drRoundDownToExp rounds to available value. The number will be rounded up to the largest multiplied value of exp that does not exceed num. See example below.

Returns: Number

Notes: When num cannot be converted to a number, a runtime error is generated.

Sample: return round(32.445, 2) // returns 32.44

return round(32.445, 2, drRoundHalfUp) // returns 32.45

return round(32.445, 2, drRoundHalfDown) // returns 32.44

return round(32.445, 2, drRoundHalfToZero) // returns 32.44

return round(32.445, 2, drRoundHalfFromZero) // returns 32.45

return round(9.555, 2) // returns 9.56

return round(9.555, 2, drRoundDown) // returns 9.55

return round(9.555, 2, drRoundUp) // returns 9.56

return round(-8.205, 2) // returns -8.20

return round(-8.205, 2, drRoundDown) // returns -8.20

return round(-8.205, 2, drRoundUp) // returns -8.21

return '$ ' + round(37.53, 0.05, drRoundUpToExpr)

// returns $ 37.55

return '$ ' + round(37.53, 0.05, drRoundDownToExpr)

// returns $ 37.50

let AmountSold = 200

let OrderAmount = 144 // supplier delivers by the gross

return round(AmountSold, OrderAmount, drRoundUpToExpr)

// returns 288

let AmountAvailable = 200

let SendAmount = 12 // We deliver by the dozen

return round(AmountAvailable, SendAmount, drRoundDownToExpr)

// returns 192

Page 149: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 149 of 189 z

Business Software for a Changing WorldTM

12.3.5 Miscellaneous functions

RGB

Returns a color constant.

Syntax: rgb(int1, int2, int3)

Argument Description int1 Required. Any integer expression. The Red component of the color

ranging from 0 to 255. int2 Required. Any integer expression. The Green component of the color

ranging from 0 to 255. int3 Required. Any integer expression. The Blue component of the color

ranging from 0 to 255.

Returns: Integer

Notes: If any color component exceeds 255, the value 255 is used.

Sample: let red = rgb(255,0,0)

let green = rgb(0,255,0)

let black = rgb(0,0,0)

if ({OrderHea.Order_Total} > 0) then

return green

else

if ({OrderHea.Order_Total} < 0) then

return red

else

return black

end

end

Page 150: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 150 of 189 z

Business Software for a Changing WorldTM

TypeName

Returns a string representing the type of expression.

Syntax: typename(exp)

Argument Description exp Required. Any valid expression.

Returns: String

Notes: The following values can be returned: exp Returns Empty, only defined variable Empty Cint(123.4) Integer 1234.5 Double Ccur(12.78) Currency Now() Date ‘abc’ String 1<2 Boolean

To use the returned value in a comparison, use a case insensitive compare.

Sample: let iTest = cint(123.456)

return typename(iTest) // returns "Integer"

if (ucase(typename(iTest)) = "INTEGER") then

return "Integer value"

else

return "Not an Integer value"

end

Page 151: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 151 of 189 z

Business Software for a Changing WorldTM

VarType

Returns an integer indicating the type of expression.

Syntax: vartype(exp)

Argument Description exp Required. Any valid expression.

Returns: Integer

Notes: The following values can be returned. The value is equal to the standards for variant data types. exp Returns Empty, only defined variable 0 Cint(123.4) 3 1234.5 5 Ccur(12.78) 6 Now() 7 ‘abc’ 8 1<2 11

Sample: let iTest = cint(123.456)

return vartype(iTest) // returns 3 (= "Integer")

Page 152: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 152 of 189 z

Business Software for a Changing WorldTM

IsDate

Returns a Boolean indicating if expression is of type date.

Syntax: isdate(exp)

Argument Description exp Required. Any valid expression.

Returns: Boolean

Notes:

Sample: let dTest = cdate("30/05/2010")

return isdate(dTest)

Page 153: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 153 of 189 z

Business Software for a Changing WorldTM

IsEmpty

Returns a Boolean indicating if expression is empty.

Syntax: isempty(exp)

Argument Description exp Required. Any valid expression.

Returns: Boolean

Notes: Empty is different than a string without contents or numeric zero value.

Sample: // the following variable is declared but not assigned a value

// and thus empty

dim sTest

return isempty(sTest)

Page 154: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 154 of 189 z

Business Software for a Changing WorldTM

IsNull

Returns a Boolean indicating if expression is null.

Syntax: isnull(exp)

Argument Description exp Required. Any valid expression.

Returns: Boolean

Notes:

Sample: let sTest = "Test"

return isnull(sTest)

Page 155: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 155 of 189 z

Business Software for a Changing WorldTM

IsNumeric

Returns a Boolean indicating if expression is a number.

Syntax: isnumeric(exp)

Argument Description exp Required. Any valid expression.

Returns: Boolean

Notes:

Sample: let sTest = 459.5

return isnumeric(sTest)

Page 156: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 156 of 189 z

Business Software for a Changing WorldTM

Hex

Returns a hexadecimal string presentation of an integer.

Syntax: hex(int)

Argument Description int Required. Any integer expression. The value to be converted to a

hexadecimal presentation.

Returns: String

Notes:

Sample: return hex(459) // returns 1CB

return ("The value of hex(459) is:" * hex(459))

Page 157: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 157 of 189 z

Business Software for a Changing WorldTM

CelciusToFahrenheit

Converts a value from Celsius to Fahrenheit (ºC to ºF).

Syntax: celsiustofahrenheit(num)

Argument Description num Required. Any numeric expression.

Returns: Number

Notes: When num cannot be converted to a number, a runtime error is generated.

Sample: return CelciusToFahrenheit(20) + " ºF"

// returns "68 ºF"

Page 158: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 158 of 189 z

Business Software for a Changing WorldTM

FahrenheitToCelsius

Converts a value from Fahrenheit to Celsius (ºF to ºC).

Syntax: fahrenheittocelsius(num)

Argument Description num Required. Any numeric expression.

Returns: Number

Notes: When num cannot be converted to a number, a runtime error is generated.

Sample: return FahrenheitToCelcius(77) + " ºC"

// returns "25 ºC"

Page 159: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 159 of 189 z

Business Software for a Changing WorldTM

12.3.6 Database functions

Previous

Returns the column value of the previous database row.

Syntax: previous(column [,records])

Argument Description column Required. Column name where the value should be retrieved from. records Optional. The amount of previous rows where the value should be

retrieved from.

Returns: The column value of the previous row.

Notes: When the previous record is before the first record in the set, empty is returned. This can be validated with the IsEmpty function.

Sample: if ({&Record Number} > 1) then

return previous({Customer.Name})

else

return ""

end

dim counter

dim State

let records = 1

let State = ""

while (isempty(previous({Customer.State}, records)) = false)

do

let State = previous({Customer.State}, records)

let records = records + 1

end

return State

Page 160: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 160 of 189 z

Business Software for a Changing WorldTM

Next

Returns the column value of the next database row.

Syntax: next(column [,records])

Argument Description column Required. Column name where the value should be retrieved from. records Optional. The amount of following rows where the value should be

retrieved from.

Returns: The column value of the last row.

Notes: When the next record is after the last record in the set, empty is returned. This can be validated with the IsEmpty function.

Sample: if ({&Record Number} > {&Total Record Count}) then

return next({Customer.Name})

else

return ""

end

let records = 0

while (isempty(next({Customer.State}, records + 1)) = false)

do

let records = records + 1

end

return next({Customer.State}, records)

Page 161: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 161 of 189 z

Business Software for a Changing WorldTM

Sum

Returns the Sum.

Syntax: sum(type, start, field)

Argument Description sum Summation type (see paragraph 12.2.3 for valid constants). start Starting point of the summation (see paragraph 12.2.3 for valid

constants). field Field to summarize.

Returns: Number

Notes:

Sample: // Avarage Purchases of all customers

return sum(drAverage, drReport, {Customer.Purchases})

// Maximum Purchases of customers that are grouped in level 2

return sum(drMaximum, drGroup2, {Customer.Purchases})

Page 162: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 162 of 189 z

Business Software for a Changing WorldTM

12.4 Supported operations per data-type In the previous paragraphs expressions were occasionally listed. Operators are sometimes allowed within

expressions. The next listing shows the allowed operators per data-type.

12.4.1 String Operator Description + Concatenate - Trim and concatenate * Trim and concatenate with space > Greater than compare < Less than compare >= Greater than or equal compare <= Less than or equal compare = Equal compare <> Not equal compare

12.4.2 Boolean Operator Description Or Logical or And Logical and Xor Logical exclusive or

12.4.3 DateTime Operator Description > Greater than compare < Less than compare >= Greater than or equal compare <= Less than or equal compare = Equal compare <> Not equal compare

12.4.4 Integer Operator Description + Add - Subtract / Divide * Multiply > Greater than compare < Less than compare >= Greater than or equal compare <= Less than or equal compare = Equal compare <> Not equal compare

12.4.5 Number Operator Description + Add - Subtract / Divide * Multiply > Greater than compare < Less than compare >= Greater than or equal compare <= Less than or equal compare

Page 163: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 163 of 189 z

Business Software for a Changing WorldTM

Operator Description = Equal compare <> Not equal compare

Page 164: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 164 of 189 z

Business Software for a Changing WorldTM

13. External Library Functions

It is possible to create your own DLL with languages such as Visual 'C' that contain one of more exposed

functions and use the results of such functions from within DataFlex Reports. The creation of your own ELF DLL is

quite advanced but the use of published functions is a feature everyone should be able to perform.

13.1 DLL location To be found and used the ELF DLLs need to be copied into the same folder that has the DataFlex Reports OCX,

which is usually the DataFlex Report installation location.

13.2 Reference They need to be registered in the repository database DR.DB. Reference is

done via the 'Function editor' dialog.

If the current tree item points to the 'External library functions' node or a

present ELF function you can add a new function via the "Add" button.

The following dialog pops up.

The name that you specify in the first input

control does not need to match with the

name used in the DLL.

The number of arguments NEEDS to match

with the number of arguments defined by the

developer of the ELF.

The combo labelled "Function name" contains

all enumerated functions from the ELF DLL.

Page 165: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 165 of 189 z

Business Software for a Changing WorldTM

13.3 Prewritten ELF functions

13.3.1 CodeMast.dll This library is installed with the DataFlex Reports Designer. It is not possible to obtain the source code of this

DLL.

CodeDescription

Syntax: codedescription(location, type, code)

Argument Description location Location and name of the DataFlex codemast table. type Codetype (e.g. SHIPPING, REASONS, etc.) code Code to be looked up (e.g. FEDEX, LUNCH, etc.)

Returns: String

Notes: The definition of the ELF is present in the also installed DR.DB file so that you can immediately use the function.

Sample: return CodeDescription("Codemast.dat","SHIPPING",{OrderHea.Ship_Via})

Page 166: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 166 of 189 z

Business Software for a Changing WorldTM

ExternalLibraryFunctions.dll This library is not shipped with DataFlex Reports. The code and build instructions are available on the Data

Access Development Team Blog.

NumberToWords

Returns a word presentation of a number or currency.

Syntax: numbertowords(num [,currency [,subcurrency]])

Argument Description num Required. Any numeric expression. currency Optional. A string representing the currency. This string is placed

between the integral and fractional part. subcurrency Optional. A string representing the subcurrency. This string is placed

after the fractional part.

Returns: String

Notes: See paragraphs 13.1 and 13.2 for information how to add this function. The source code of this function is published on our blog at: http://support.dataaccess.com/Forums/entry.php?163-How-to-make-your-own-ELF

Sample: return NumberToWords(123.61)

// returns "one hundered twenty three and sixty one"

return NumberToWords(12,"dollar")

// returns "twelve dollar"

return NumberToWords(24.55,"euro", "cents")

// returns "twenty four euro and fifty five cents"

Page 167: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 167 of 189 z

Business Software for a Changing WorldTM

FileExists

Determines whether a path to a file system object such as a file or folder is valid.

Syntax: fileexists(str)

Argument Description str Required. The full path of the object to verify.

Returns: Boolean

Notes: See paragraphs 13.1 and 13.2 for information how to add this function. The source code of this function is published on our blog at: http://support.dataaccess.com/Forums/entry.php?164-How-to-use-Windows-API-functions-in-Visual-Report-Writer

Sample: // check if there is a logo of the customer

if (FileExists("C:\logos\" + {Customer.Name} + ".jpg")) then

return "C:\logos\" + {Customer.Name} + ".jpg"

else

return ""

end

Page 168: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 168 of 189 z

Business Software for a Changing WorldTM

13.4 Creating your own ELF DLL Using External Library Functions (ELF) is a great way to extend the functionality of DataFlex Reports.

13.4.1 ELF function declaration If we take Visual 'C' as the development tool to create an ELF function, the function skeleton should be:

VARIANT __declspec(dllexport) YourFunctionName(VARIANT param1, VARIANT param2)

{

CComVariant vResult;

// Some code to process param1 and param2 into vResult

return vResult;

}

DataFlex Reports uses the standard calling convention (_stdcall). Make sure that you use this convention. ELF

functions must use parameters to be passed as type VARIANT.

On our blog http://support.dataaccess.com/Forums/entry.php?163-How-to-make-your-own-ELF a walkthrough

has been published how to make your own ELF.

Page 169: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 169 of 189 z

Business Software for a Changing WorldTM

14. Parameters

Parameters can be used in two ways in a report. They can play

an important role in a report based on stored procedures and

they can be seen as variables for the report. Such variables can

be easily changed at the integration level, more easily than

functions can be changed.

Parameters are maintained via the Field Explorer and can be

just set, can be used in functions or even directly printed in the

report. However parameters are not like global variables in that

their value cannot be used in a sub-report.

A parameter has a specific data-type and size given at

declaration level. In the DataFlex Reports designer you can

change the data-type but you cannot change the data-type

from the integration level.

After selecting "Create new" from the floating menu while the

current tree-view item is on 'Parameter Fields' or on an existing parameter the following dialog will be opened

for the parameter definition.

In the Parameter dialog you specify a name

for the parameter, select the data-type of the

parameter and depending on the data-type

you can or need to specify length and

precision. Finally you enter the value as you

want to use it in the report.

If you create a report based on a stored

procedure the list of parameters is

automatically filled with the parameters as

defined in the datasource. You cannot change

the name, data-type or length of these

parameters, only the value.

Page 170: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 170 of 189 z

Business Software for a Changing WorldTM

15. Special Fields

Special fields can be used inside the body of a function or anywhere in the report layout. DataFlex Reports has

the following special functions:

File Creation Date and Time

Returns the date and time when the report was initially created.

return {&File Creation Date and Time}

Modification Date and Time

Returns the date and time the report was last saved.

return {&Modification Date and Time}

To calculate the amount of time between the creation of the report and the latest save:

return DateDiff("H", {&Modification Date and Time}, {&File Creation Date and Time})

Data Date and Time

Returns the date and time of the used data.

return {&Data Date and Time}

Print Date and Time

Returns the date and time of printing.

return {&Print Date and Time}

File Path and Name

Returns the name and location of the DR file.

return {&File Path and Name}

Filter Function

Returns the contents of the record filter if one is defined for the report. This is not the same as filter expert.

return {&Filter Function}

Record Number

Returns the number of the record from the data-set. This is not the same as "recnum" which is a normal field in

recnum tables.

If the following code is used for the background color of the details section, you give a different color to the even

and uneven output lines in the report.

Page 171: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 171 of 189 z

Business Software for a Changing WorldTM

if mod({&Record Number}, 2) > 0 then

return rgb(192,192,193)

else

return drNone

end

Total Record Count

Returns the total number of records in the data-set.

return {&Total Record Count}

Page Number

Returns the current page number.

If the following example is used for the details background color you will get a gray color on each uneven page.

if mod({&Page Number}, 2) > 0 then

return rgb(192,192,193)

else

return drNone

end

Page N of M

Returns the page number relevant to the total number of pages.

At preview time the total number of pages might not be known yet and thus the special field returns "1 of 1". As

soon as the next page (or the last page) has been printed the number reflects the current location. The number

is always correct when printing.

return {&Page N of M}

Total Page Count

Returns the total number of pages in this report.

At preview time the total number of pages might not be known yet and thus the special field returns "1". As

soon as the next page (or the last page) has been printed the number reflects the current location. The number

is always correct when printing.

Report Title

Returns the report title value. You can enter this value via Report | Report document properties.

return {&Report Title}

Report Subject

Returns the report subject value. You can enter this value via Report | Report document properties.

return {&Report Subject}

Report Author

Returns the report author value. You can enter this value via Report | Report document properties.

Page 172: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 172 of 189 z

Business Software for a Changing WorldTM

return {&Report Author}

Report Category

Returns the report category value. You can enter this value via Report | Report document properties.

return {&Report Category}

Report Keywords

Returns the report keywords value. You can enter this value via Report | Report document properties.

return {&Report Keywords}

Report Comments

Returns the report comments. You can enter this value via Report | Report document properties.

return {&Report Comments}

Report Revision

Returns the report revision value. You can enter this value via Report | Report document properties. The default

value of this property is zero.

return {&Report Revision}

Group Number

Returns the number of the group. Each time a group is used (printed) in the report the group number increases.

return {&Group Number}

Page 173: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 173 of 189 z

Business Software for a Changing WorldTM

16. Page layers

Page Layers are a special type of document that can be used as a “background” for one or more reports. They

consist of a single page on which only text, lines, boxes, and images can be placed.

16.1 Create a new page layer In the ‘File’ menu select ‘New’, ‘Page layer…’ to create a new page layer. You are free to place text, lines, boxes,

and images all over the page, but remember that reports will be printed on top of the page layer. Most often,

page layers will simply be used for placing a logo and address, similar to pre-printed company paper.

Creating a new page layer based on an existing one is done the same way as with a report. See section 2.3.

You must save the page layer file before it can be used in a report.

16.2 Using a page layer in a report Open the ‘Page Layer Expert…’ option in the

‘Report’ menu. The Page Layer Expert contains

a list of page layers that are present in the

report. You have the option to add or remove

page layers here.

Having multiple active page layers is a

possibility. In that case it is useful to define the

order in which they are rendered, especially

when they have overlapping areas. The sort

order in the list reflects the rendering order

from top to bottom.

16.3 Hiding page layers The only property for a page layer is to hide it. This option is available in the Page Layer Expert, and can be set by

a function, which opens up the interesting possibility of using a different page layer on a different page. For

instance in a double-sided document you may want the company logo to be on the right for odd pages and on

the left for even pages. Also, you can define a completely different front page. The codes below achieve that.

// Function Field IsFirstPage

return {&Page Number} = 1

// Function Field IsEvenPage

let result = mod({&Page Number}, 2)

return result = 0

// page layer TitlePage – hide function

return not {@IsFirstPage}

// page layer EvenPage – hide function

return not {@IsEvenPage}

Page 174: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 174 of 189 z

Business Software for a Changing WorldTM

// page layer OddPage – hide function

return ({@IsEvenPage} or {@IsFirstPage})

16.4 Updating a page layer When a page layer file is updated, all reports that use it will need to do a refresh of the page layer. To do this

open each report, open the Page Layer Expert, select the page layer, click the update button, and find the page

layer file. Do not forget to save the report afterwards.

Page 175: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 175 of 189 z

Business Software for a Changing WorldTM

17. ANSI collation sequences

Many reports output the data in a specific sort order, also called a collation sequence. By default DataFlex

Reports does a fine job for US and Western Europe, but many other countries need to handle special characters

and some customers may want some very specific changes to the sort order. One of the simplest examples is the

choice between a case-sensitive and a case-insensitive sorting: is ‘a’ the same as ‘A’, or should the lowercase

character come first or last?

DataFlex Reports supports the usage of advanced custom collation sequence files. These files allow the choice of

a specific ANSI code page (for exotic characters) and fine-grained control of the sort order.

When using a custom collation sequence DataFlex Reports performs the actual sorting, which is otherwise

performed by the database. If the database can support the desired collation sequence and has the proper

index, it can return the data sorted as required which has better performance.

17.1 ANSI code pages A code page is a table that defines which value (0-255) equals which character (letters, figures, and special

characters). The number of values per code page is limited to 256, which means not all characters that are used

in the world can be in a single code page. The Windows (ANSI) code pages were created so that specific regions

or countries have a special code page containing their special characters. For example code page 1255 supports

Hebrew and 1256 Arabic.

It is important to note that DataFlex Reports only accepts collation sequences that match the current Windows

code page. If the code page of the collation file is different DataFlex Reports will notify you with an error

message.

17.2 DataFlex Reports ANSI collation file The collation file is a plain text file with a .collate extension. During creation or editing Windows (or you

advanced text editor) should be set to the desired code page so that printable characters look correct.

Collation files support a number of different statements that define one or more characters. The general sort

order will be from the top of the file down.

Statement Example Explanation *

* this is a comment

CP 1252 * and this too

This character defines a comment. From the * until the end of the line is considered comment and is ignored.

CP num

CP 1252 Defines the ANSI code page to use. This statement can be used only once and must be the first non-comment in the file.

SINGLE num

SINGLE 127 Defines a single character. Mostly useful for non-printing characters like the DEL (127).

RANGE num num

RANGE 32 47 Defines a range of characters that are sorted in order. This example is for 16 printable special characters.

RANGE_EQ num

num RANGE_EQ 0 31 Defines a range of characters that are considered equal. This example is for 32 non-printable characters.

TEXT "string"

TEXT "0¼½¾1¹2²3³456789" Defines a number of printable characters that are sorted in order.

Page 176: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 176 of 189 z

Business Software for a Changing WorldTM

Statement Example Explanation TEXT_EQ

"string" TEXT_EQ "AÀÁÂÄÃÅÆ" Defines a range of characters that are considered equal. This example is for the capital letter A with several variants.

Refer to the following page for valid code page identifiers:

http://msdn.microsoft.com/en-us/library/windows/desktop/dd317756%28v=vs.85%29.aspx

17.3 Example The following listing shows an incomplete example of a collation file, which reflects a normal English case-

sensitive collation sequence.

* Codepage

CP 1252

* Control characters

RANGE 0 31

SINGLE 127 * DEL

SINGLE 160 * NBSP

SINGLE 173 * SHY

* Unused

SINGLE 129

SINGLE 141

SINGLE 143

SINGLE 144

SINGLE 157

* Punctuation

RANGE 32 47

RANGE 58 64

RANGE 91 96

RANGE 123 126

SINGLE 130

RANGE 132 137

SINGLE 139

RANGE 145 153

SINGLE 155

SINGLE 161

RANGE 166 169

RANGE 171 172

RANGE 174 177

RANGE 180 184

SINGLE 187

SINGLE 191

SINGLE 215

SINGLE 247

* Currency signs

TEXT "€£¥¤¢"

* Numbers

TEXT "0¼½¾1¹2²3³456789"

* Alpha characters

TEXT_EQ "AÀÁÂÄÃÅÆ"

TEXT_EQ "aàáâäãåæª"

TEXT_EQ "B"

TEXT_EQ "b"

TEXT_EQ "CÇ"

TEXT_EQ "cç"

.

.

.

Page 177: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 177 of 189 z

Business Software for a Changing WorldTM

18. Automating DataFlex Reports

DataFlex Reports is a great tool for authoring and generating reports. In some situations it is useful to use it

without the graphical user interface, to simply print a report for instance. This is a basic form of automation

which DataFlex Reports support via command line arguments.

DataFlex Reports supports the following command line options:

Option Description -autoclose Close DataFlex Reports once the preceding command(s) are completed. -cmdfile Read the command line options from file. Useful for multiple commands. -csvexport Export the specified report to a CSV file. -htmlexport Export the specified report to an HTML file. -imageexport Export the specified report to an image file (GIF, JPG, or TIFF). -pdfexport Export the specified report to a PDF file. -print Print the specified report. -report Open the specified report -rtfexport Export the specified report to a RTF file. -run Open the specified report and its preview. -x Start DataFlex Reports with the specified workspace. -xlsexport Export the specified report to an Excel XLS file.

18.1 Close DataFlex Reports The -autoclose option is special. It is meant to be used in combination with one of the other options. When this

option is specified at the end DataFlex Reports will perform all preceding commands and then close.

18.2 Open a report When opening a .dpl or .dr file from Windows Explorer, DataFlex Reports is started using the -report option in

order to load the specified report. The example below will open DataFlex Reports with the file

C:\Reports\Report Example.dr opened.

–report "C:\Reports\Report Example.dr"

It is possible to open multiple reports and page layers by adding additional -report statements, like this

example:

–report "C:\Reports\Report Example.dr" –report "C:\Reports\Company Logo.dpl"

18.3 Open a report preview The -run options opens a report and immediately previews it as well.

18.4 Start DataFlex Reports with a specific workspace Normally with each new report you have to select the database. This can become a nuisance when creating

multiple reports for the same project. The -x option can be used to start DataFlex Reports with a specific

workspace, making its database available for every report created during that session.

The following example opens DataFlex Reports with the Order Entry example workspace.

-x "C:\DataFlex 18.0 Example\Order Entry\Order Entry.sws"

This option cannot be repeated – only one workspace file can be opened per session.

Page 178: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 178 of 189 z

Business Software for a Changing WorldTM

18.5 Print a report The -print option can be used to open a report, and immediately print it. The program will prompt you for the

printing options and printer to use. For example, to print a report:

-print "C:\Reports\Report Example.dr"

18.6 Export a report As described in paragraph 4.1 DataFlex Reports can export a report to several formats. This can also be

facilitated from the command line, which for example is useful for weekly or monthly report exports.

Each of the available export formats has its own set of options. Partially they overlap but they will be described

separately in each of the following paragraphs. The only option that is required for all exports is -exportfile.

This options is used to specify the output file path.

18.6.1 HTML export The -htmlexport exports the report to HTML and supports only a few customization options.

Option Description Multipage This boolean option, which is true by default, specifies that the entire report

will be exported. When false, only a single page is exported. Page If the multipage option is false, this option specifies which page is exported. By

default this is set to page 1.

18.6.2 RTF export The -rtfexport option exports the report to an RTF file.

Option Description Allpages This boolean option, which is true by default, specifies that the entire report

will be exported. When false, only a single page is exported. Page If the allpages option is false, this option specifies which page is exported. By

default this is set to page 1.

18.6.3 PDF export The PDF export is triggered using the -pdfexport option.

Option Description Allpages This boolean option, which is true by default, specifies that the entire report

will be exported. When false, only a single page is exported. Image Default is OLEdrLow (0). Ownerpwd Specifies a password that must be entered to open the PDF for editing. Default

is no password. Page If the allpages option is false, this option specifies which page is exported. By

default this is set to page 1. Pagemode Default is OLEdrNormal (0). Userpwd Specifies a password that must be entered to open the PDF for reading. Default

is no password.

18.6.4 CSV export Option Description Allpages This boolean option, which is true by default, specifies that the entire report

will be exported. When false, only a single page is exported. Delimiter Default is ‘,’. Groupsections Default is “False”.

Page 179: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 179 of 189 z

Business Software for a Changing WorldTM

Option Description Page If the allpages option is false, this option specifies which page is exported. By

default this is set to page 1. Pagesections Default is “False”. Reportsections Default is “False”. Separator "

18.6.5 XLS export Option Description Allpages Default is “True”. Columnwidth Default is 20. Dataonly Default is “False”. Groupsections Default is “True”. Nosheets Default is OLEdrNoSheets (0). Page Default is “1”. Pagesections Default is “True”. Reportsections Default is “True”. Version Default is OLEdrXLS2003 (0).

18.6.6 Image export Option Description Multipage Default is “False”. Page Default is “1”. Type Default is OLEdrJPEG (1).

'jpeg' ‘png’ 'tiff’ 'gif'

18.7 Using a command file

Page 180: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 180 of 189 z

Business Software for a Changing WorldTM

-pdfexport "C:\Examples\DataFlex 18.0 Examples\Order

Entry\Reports\CustomerList.vrw" EXPORTFILE=c:\tmp\ik1234.pdf PAGEMODE=1

OWNERPWD=vincent USERPWD=DataFlex ALLPAGES=0 PAGE=3 IMAGE=1 -autoclose

-x "C:\Examples\DataFlex 18.0 Examples\Contact Management\Contact Management.sws"

-x "C:\Examples\DataFlex 18.0 Examples\Contact Management\Programs\config.sws"

-csvexport "C:\Examples\DataFlex 18.0 Examples\Order

Entry\Reports\CustomerList.vrw" EXPORTFILE=c:\tmp\ik1234.csv SEPARATOR=34

DELIMITER=44 REPORTSECTIONS=1 GROUPSECTIONS=0 PAGESECTIONS=1 ALLPAGES=0 PAGE=3 -

autoclose

-xlsexport "C:\Examples\DataFlex 18.0 Examples\Order

Entry\Reports\CustomerList.vrw" EXPORTFILE=c:\tmp\ik1234.xls VERSION=2007

NOSHEETS=1 REPORTSECTIONS=1 GROUPSECTIONS=0 PAGESECTIONS=1 ALLPAGES=0 PAGE=3

COLUMNWIDTH=30 DATAONLY=0 -autoclose

-rtfexport "C:\Examples\DataFlex 18.0 Examples\Order

Entry\Reports\CustomerList.vrw" EXPORTFILE=c:\tmp\ik1234.rtf ALLPAGES=0 PAGE=3 -

autoclose

-htmlexport "C:\Examples\DataFlex 18.0 Examples\Order

Entry\Reports\CustomerList.vrw" EXPORTFILE=c:\tmp\ik1234.html MULTIPAGE=0 PAGE=3 -

autoclose

-imageexport "C:\Examples\DataFlex 18.0 Examples\Order

Entry\Reports\CustomerList.vrw" EXPORTFILE=c:\tmp\ik1234.tiff MULTIPAGE=1 TYPE=tiff

PAGE=0 -autoclose

-imageexport "C:\Examples\DataFlex 18.0 Examples\Order

Entry\Reports\CustomerList.vrw" EXPORTFILE=c:\tmp\ik1234.jpg MULTIPAGE=1 TYPE=jpg

PAGE=3 -autoclose

-imageexport "C:\Examples\DataFlex 18.0 Examples\Order

Entry\Reports\CustomerList.vrw" EXPORTFILE=c:\tmp\ik1234.gif MULTIPAGE=1 TYPE=gif

PAGE=3 -autoclose

-print "C:\Examples\DataFlex 18.0 Examples\Order Entry\Reports\CustomerList.vrw"

-cmdfile "C:\Projects\DataFlex Reports\Studio\4.0\cmdline.ini"

Page 181: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 181 of 189 z

Business Software for a Changing WorldTM

[pdfexport]

report=C:\Examples\DataFlex 18.0 Examples\Order Entry\Reports\CustomerList.vrw

exportfile=c:\tmp\customerlist.pdf

PAGEMODE=1

OWNERPWD=DataFlex

USERPWD=Reports

ALLPAGES=0

PAGE=3

IMAGE=1

[csvexport]

report=C:\Examples\DataFlex 18.0 Examples\Order Entry\Reports\CustomerList.vrw

exportfile=c:\tmp\customerlist.csv

SEPARATOR=34

DELIMITER=44

REPORTSECTIONS=1

GROUPSECTIONS=0

PAGESECTIONS=1

ALLPAGES=0

PAGE=3

[xlsexport]

report=C:\Examples\DataFlex 18.0 Examples\Order Entry\Reports\CustomerList.vrw

EXPORTFILE=c:\tmp\customerlist.xls

VERSION=2007

NOSHEETS=1

REPORTSECTIONS=1

GROUPSECTIONS=0

PAGESECTIONS=1

ALLPAGES=0

PAGE=3

COLUMNWIDTH=30

DATAONLY=0

[rtfexport]

report=C:\Examples\DataFlex 18.0 Examples\Order Entry\Reports\CustomerList.vrw

EXPORTFILE=c:\tmp\customerlist.rtf

ALLPAGES=0

PAGE=3

[htmlexport]

report=C:\Examples\DataFlex 18.0 Examples\Order Entry\Reports\CustomerList.vrw

EXPORTFILE=c:\tmp\customerlist.html

MULTIPAGE=0

PAGE=3

[imageexport]

report=C:\Examples\DataFlex 18.0 Examples\Order Entry\Reports\CustomerList.vrw

EXPORTFILE=c:\tmp\customerlist.tiff

MULTIPAGE=1

TYPE=tiff

PAGE=0

[autoclose]

Page 182: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 182 of 189 z

Business Software for a Changing WorldTM

19. Product support

Free support for DataFlex Reports is limited to the validity of your product subscription plan. Read more about

how Data Access handles support at http://www.dataaccess.eu/support.

Support for DataFlex Reports can be reached via the following ways:

Your local distributor

The Data Access Worldwide forums (http://support.dataaccess.com/forums)

An e-mail to Data Access Europe directly ([email protected])

Directly entering your support request in the online support database (http://hde.dataaccess.eu). If you do

not have an account as yet, send us an e-mail.

Page 183: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 183 of 189 z

Business Software for a Changing WorldTM

20. Product registration and activation

In order to use DataFlex Reports for longer than 60 days, the standard evaluation period, you need to purchase a

license and register the product.

You can register the DataFlex

Reports product from within

the product itself. Go to the

help pull-down and select

"Register DataFlex Reports".

The registration dialog pops

up.

In the top half of the dialog

enter your serial number and

your registration name and

code. Then click the ‘Register’

button. If all the entered

information is correct your

license will be registered. You

will now no longer receive a

message about the number of days left in the evaluation when DataFlex Reports starts up.

If the registration was successful DataFlex Reports will ask if you want to activate the product now. You need to

have an internet connection for this.

If you do not have an internet connection at this time you

can manually activate your license via

http://www.dataaccess.eu/dractivation and enter the

returned activation code, or by contacting one of the Data

Access regional offices.

Page 184: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 184 of 189 z

Business Software for a Changing WorldTM

21. Problems and solutions

In this chapter we will discuss the problems that may arise when using DataFlex Reports and solutions for

resolving any such problems.

21.1 Cannot open the language database DataFlex Reports and the runtime OCX use translation text strings stored in a database named language.db.

The Visual Report designer will default to the built in English text strings when the database cannot be found or

cannot be opened. No message is given but you will find that all languages of the language pull-down are grayed

out.

If the OCX needs to find a text for translation and the language.db cannot be opened you will get a message to

this effect and then the OCX defaults to the built in English text strings. The language database is used for text

strings such as "Page N of M", for errors generated by the database driver, or errors generated internally in the

OCX. If a translation cannot be found the system defaults to the built in English text string.

The language.db should be present in the same folder as where the DataFlex Reports Workstation Runtime is

installed.

21.2 Unable to instantiate COM object The DataFlex Reports designer uses three CodeJock ActiveX modules, its own runtime OCX and an editor OCX. If

any of these COM modules is either not or wrongly registered on your machine you will get this error. At the end

of the error text you will see a COM error code which is a hexadecimal number indicating why the COM object

could not be instantiated. A couple of common codes are:

Errorcode Explanation Solution 0x8007007e (OCX) File not found One of the following files is missing:

Codejock.DockingPane.v12.0.2.ocx

CodeJock.CommandBars.v12.0.2.ocx

DfEdit40.dll

DataFlex Reports 2013 Developer Edition API.ocx Locate the files on your machine and make sure they are where your registry tells where they were expected.

0x80040154 Class not registered One of the following OCX files is not registered:

Codejock.DockingPane.v12.0.2.ocx

CodeJock.CommandBars.v12.0.2.ocx

DfEdit40.dll

DataFlex Reports 2013 Developer Edition API.ocx Find the file and use RegSvr32 to re-register the OCX files.

You may need your systems administrator to fix the above problems.

Page 185: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 185 of 189 z

Business Software for a Changing WorldTM

Index

- operator (subtract) ................................................ 73 - operator (unary negate) ....................................... 74 * operator (multiply) ............................................... 73 / operator (divide) ................................................... 74 + operator (add) ...................................................... 73 + operator (unary plus) ........................................... 74 < (LT) Less than ........................................................ 72 <= (LE) Less than or equal to ................................... 73 <> (NE) Not equal .................................................... 73 = (EQ) Equal ............................................................. 73 > (GT) Greater than ................................................. 72 >= (GE) Greater than or equal to ............................ 72 Abs ......................................................................... 136 Align objects ............................................................. 50 Always Sort Locally .................................................. 26 ANSI ........................................................... 69, 70, 175 ANSI code pages ................................................... 175 Area chart................................................................. 19 Arithmetic functions ............................................. 136

Abs ..................................................................... 136 Add (+ operator) .................................................. 73 Atn ..................................................................... 137 Cos ..................................................................... 138 Divide (/ operator) ............................................... 74 Exp ..................................................................... 143 Fix ...................................................................... 144 Log ..................................................................... 141 Mod ................................................................... 146 Multiply (* operator) ........................................... 73 Round ................................................................ 147 Sgn ..................................................................... 145 Sin ...................................................................... 139 Sqr ..................................................................... 142 Subtract (- operator) ........................................... 73 Tan ..................................................................... 140

Asc ............................................................................ 91 Atn ......................................................................... 137 Bar chart ................................................................... 19 Border field properties ............................................ 41 Border style .............................................................. 41 Bottom N .................................................................. 67 Bottom N percent .................................................... 67 Box field properties ................................................. 48 Browse data ...................................................... 59, 65 Built-in functions ..................................................... 78 Cannot open the language database ................... 184 CBool ..................................................................... 100 CByte ..................................................................... 101 CCur ....................................................................... 102 CDate ..................................................................... 103

CDbl ....................................................................... 104 CelciusToFahrenheit ............................................. 157 Change appearance ................................................. 16 Change design .......................................................... 14 Chart ......................................................................... 18

Adding a chart ...................................................... 18 Appearance .......................................................... 19 Category ............................................................... 21 Datasource ........................................................... 18 Labels ................................................................... 19 Legend .................................................................. 21 Lines ..................................................................... 22 Palette .................................................................. 19 Scale ..................................................................... 22 Titles ..................................................................... 21 Value .................................................................... 22

Chart properties....................................................... 20 Chart types ............................................................... 19

Area ...................................................................... 19 Bar ........................................................................ 19 Line ....................................................................... 19 Point ..................................................................... 20

Check database ........................................................ 56 Chr ............................................................................ 92 CInt ........................................................................... 99 CLng ....................................................................... 105 CodeDescription ................................................... 165 CodeMast .............................................................. 165 CodeMast functions

CodeDescription ............................................... 165 Collation file .......................................................... 175 Collation sequence ............................................... 175 Common field properties ........................................ 40 Connection String .................................................... 53 Constants ................................................................. 76 Conversion functions ............................................... 99

CBool ................................................................. 100 CByte ................................................................. 101 CCur ................................................................... 102 CDate ................................................................. 103 CDbl ................................................................... 104 CInt ....................................................................... 99 CLng ................................................................... 105 CSgn ................................................................... 106 CStr .................................................................... 107

Copy .......................................................................... 29 Cos ......................................................................... 138 Create blank report ................................................. 17 Create new function ................................................ 31 Create new parameter ............................................ 31

Page 186: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 186 of 189 z

Business Software for a Changing WorldTM

Create report from existing..................................... 17 CSgn ....................................................................... 106 CStr ........................................................................ 107 Cut ............................................................................ 29 Data Date and Time .............................................. 170 Data Source Name ................................................... 52 Database expert ....................................................... 51 Database field floating menu .................................. 33 Database Fields ........................................................ 30 Database functions ............................................... 159

Next ................................................................... 160 Previous............................................................. 159 Sum ................................................................... 161

Database menu ........................................................ 51 DataFlex database ................................................... 52 DataFlex embedded database .................................. 8 DataFlex Reports Options ....................................... 26 Date ....................................................................... 109 Date and time functions ....................................... 108

Date ................................................................... 109 DateAdd ............................................................ 121 DateDiff ............................................................. 120 DatePart ............................................................ 122 DateSerial .......................................................... 123 DateValue ......................................................... 125 Day .................................................................... 113 Hour .................................................................. 114 InAgedToDays ................................................... 135 InLast4WeeksToSunday ................................... 134 InLast7Days ....................................................... 129 InLastFullMonth ................................................ 130 InLastFullWeek ................................................. 131 InLastYearMTD ................................................. 132 InLastYearYTD ................................................... 133 InLeapYear ........................................................ 127 Minute ............................................................... 115 Month ............................................................... 112 MonthName ..................................................... 119 Now ................................................................... 108 Second ............................................................... 116 Time................................................................... 110 TimeSerial ......................................................... 124 TimeValue ......................................................... 126 WeekAgo ........................................................... 128 Weekday ........................................................... 117 WeekdayName ................................................. 118 Year ................................................................... 111

Date field properties ............................................... 44 Date formats ............................................................ 44 Date Mask ................................................................ 45 DateAdd ................................................................ 121 DateDiff ................................................................. 120 DatePart ................................................................ 122 DateSerial .............................................................. 123 DateValue .............................................................. 125

Day ......................................................................... 113 Define data filters .................................................... 13 Defining relationships .............................................. 11 Delete ....................................................................... 29 Deselect tables ......................................................... 10 Details section floating menu ................................. 33 df_collate.cfg ........................................................... 27 DF_OPEN_PATH ....................................................... 58 Dim ........................................................................... 76 Dim as global ............................................................ 76 Distinct ..................................................................... 59 DSN ........................................................................... 52 Edit function field .................................................... 29 Edit menu ................................................................. 29 Edit parameter field ................................................. 29 Edit RDS Sample Data .............................................. 58 Edit text field ............................................................ 29 ELF ......................................................................... 164

CodeMast .......................................................... 165 ExternalLibaryFunctions ................................... 166 Function declaration ........................................ 168 location ............................................................. 164 Reference .......................................................... 164

Enforce join .............................................................. 56 Exp ......................................................................... 143 Export report............................................................ 24 Expressions .............................................................. 72 External Library Functions .................................... 164 ExternalLibaryFunctions functions

FileExists ............................................................ 167 NumberToWords .............................................. 166

ExternalLibraryFunctions ...................................... 166 FahrenheitToCelsius ............................................. 158 Field color ................................................................. 42 Field explorer ........................................................... 30 Field heading ............................................................ 36 Field properties ........................................................ 40

Border .................................................................. 41 Box ........................................................................ 48 Common............................................................... 40 Date ...................................................................... 44 Font ...................................................................... 43 Image .................................................................... 49 Line ....................................................................... 47 Number ................................................................ 46 Text ....................................................................... 44 Time ...................................................................... 45

File Creation Date and Time ................................. 170 File menu .................................................................. 24 File Path and Name............................................... 170 FileExists ................................................................ 167 filelist.cfg .................................................................. 10 Filter expert .............................................................. 60 Filter function .......................................................... 61 Filter Function ....................................................... 170

Page 187: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 187 of 189 z

Business Software for a Changing WorldTM

Filters ........................................................................ 60 Find field ................................................................... 60 Find Field .................................................................. 66 Find object ............................................................... 29 Fix .......................................................................... 144 Floating menu

Database .............................................................. 33 Details section ..................................................... 33 Group footer ........................................................ 33 Group header ...................................................... 33 Report explorer ................................................... 32

Font .......................................................................... 40 Font field properties ................................................ 43 Format

Field properties.................................................... 40 Font ...................................................................... 40 Lock size/position ................................................ 40 Suppress field ...................................................... 40

Format dates ............................................................ 44 Format menu ........................................................... 40 Full Outer Join .......................................................... 56 Function constants .................................................. 76 Function Editor ........................................................ 64 Function Explorer .................................................... 64 Function Fields ......................................................... 30 Functions .................................................................. 71 Go to page ................................................................ 29 Group data ............................................................... 12 Group expert ............................................................ 65 Group footer floating menu .................................... 33 Group header floating menu .................................. 33 Group Name Field .................................................... 65 Group Name Fields .................................................. 30 Group Number ...................................................... 172 Group sections ......................................................... 14 Group sort expert .................................................... 67 grouped ...................................................................... 9 Hex ......................................................................... 156 Hide sections ............................................................ 14 Hour ....................................................................... 114 IBM DB2 ...............................................................8, 52 If then else end ........................................................ 75 If then end ................................................................ 74 Image field properties ............................................. 49 InAgedToDays ....................................................... 135 Include ties ............................................................... 67 InLast4WeeksToSunday ....................................... 134 InLast7Days ........................................................... 129 InLastFullMonth .................................................... 130 InLastFullWeek ...................................................... 131 InLastYearMTD ...................................................... 132 InLastYearYTD ....................................................... 133 InLeapYear ............................................................ 127 Inner Join .................................................................. 55 Insert

Box ........................................................................ 38 Chart ..................................................................... 38 Function field ....................................................... 37 Group ................................................................... 37 Line ....................................................................... 38 Picture .................................................................. 38 Sub-report ............................................................ 39 Summary .............................................................. 36 Text object ........................................................... 38

Insert menu .............................................................. 36 InStr .......................................................................... 88 InStrRev .................................................................... 89 IsDate .................................................................... 152 IsEmpty .................................................................. 153 IsNull ...................................................................... 154 IsNumeric .............................................................. 155 Join type ................................................................... 55 Language elements .................................................. 71 LCase ........................................................................ 86 Left ............................................................................ 82 Left Outer Join ......................................................... 55 Legend ...................................................................... 21 Len ............................................................................ 87 Let ............................................................................. 74 Line chart ................................................................. 19 Line field properties................................................. 47 Link type ................................................................... 56 Locate ELF ............................................................. 164 Lock size/position .................................................... 40 Log ......................................................................... 141 Logical and ............................................................... 72 Logical not ................................................................ 72 Logical or .................................................................. 72 LTrim ......................................................................... 80 Menu

Database .............................................................. 51 Edit ....................................................................... 29 File ........................................................................ 24 Format .................................................................. 40 Insert .................................................................... 36 Report .................................................................. 60 View ...................................................................... 30

Microsoft Access ........................................................ 8 Microsoft SQL Server .......................................... 8, 52 Mid ........................................................................... 84 Minute ................................................................... 115 Miscellaneous functions ....................................... 149

CelciusToFahrenheit ......................................... 157 FahrenheitToCelsius ......................................... 158 Hex .................................................................... 156 IsDate ................................................................ 152 IsEmpty.............................................................. 153 IsNull .................................................................. 154 IsNumeric .......................................................... 155 RGB .................................................................... 149

Page 188: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 188 of 189 z

Business Software for a Changing WorldTM

TypeName ......................................................... 150 VarType ............................................................. 151

Mod ....................................................................... 146 Modification Date and Time ................................ 170 Month .................................................................... 112 MonthName .......................................................... 119 Move

Backward.............................................................. 49 Forward ................................................................ 49 To Back ................................................................. 49 To Front ................................................................ 49

Move a field ............................................................. 49 MySQL ........................................................................ 8 New page ................................................................. 16 Next ....................................................................... 160 Non-Unicode ............................................................ 70 Now ....................................................................... 108 Number field properties .......................................... 46 Number mask........................................................... 46 NumberToRoman .................................................... 98 NumberToWords .................................................. 166 Object ....................................................................... 29 ODBC ..................................... 8, 10, 26, 52, 56, 58, 69

Stored procedures ............................................... 53 ODBC Administrator ................................................ 53 ODBC stored procedures......................................... 53 ODBC views .............................................................. 53 Operating language ................................................... 9 Options .................................................................9, 26

Fonts ..................................................................... 27 Formatting ........................................................... 28 Options ................................................................. 26

Oracle ......................................................................... 8 Page layer .............................................................. 173

Create ................................................................ 173 Hide ................................................................... 173 Update .............................................................. 174 Use in report ..................................................... 173

Page Layer Expert ........................................... 61, 173 Page N of M .......................................................... 171 Page Number ........................................................ 171 Parameter Fields ...................................................... 30 Parameters ............................................................ 169 Paste ......................................................................... 29 Performance information ....................................... 68 Pervasive SQL ............................................................. 8 Pervasive.SQL ........................................................... 52 Point chart ................................................................ 20 Position fields ........................................................... 15 PostgreSQL ................................................................. 8 Previous ................................................................. 159 Print Date and Time .............................................. 170 Problems and solutions ........................................ 184 Product activation ................................................ 183 Product registration ............................................. 183

Product support .................................................... 182 ProperCase ............................................................... 97 RDS ........................................................................... 58 Record Number .................................................... 170 Record sort expert ................................................... 66 Redo ......................................................................... 29 Reference ELF ....................................................... 164 Refresh report data ................................................. 67 relationship ................................................................ 9 Relationships ............................................................ 54 Remove a sort order ................................................ 66 Remove one table .................................................... 54 Removing a group .................................................... 65 Replace ..................................................................... 90 Report Author ....................................................... 171 Report Category .................................................... 172 Report Comments ................................................ 172 Report Creation Wizard ........................................... 10 Report document properties .................................. 68 Report explorer ........................................................ 32

Floating menu ...................................................... 32 Report Keywords .................................................. 172 Report menu ............................................................ 60 Report options ......................................................... 69 Report Revision ..................................................... 172 Report Subject ...................................................... 171 Report Title ........................................................... 171 Repository explorer ................................................. 34 Return ....................................................................... 75 RGB ........................................................................ 149 Right ......................................................................... 83 Right Outer Join ....................................................... 56 Round .................................................................... 147 RTrim ........................................................................ 81 Runtime datasource ................................................ 54 Second ................................................................... 116 Section expert .......................................................... 62 Section options ........................................................ 63 Sections ............................................................. 14, 62 Select all ................................................................... 29 Select DataFlex database ........................................ 52 Select default fonts .................................................. 27 Select fields .............................................................. 11 Select tables ............................................................. 10 Selected database and tables ................................. 54 Selecting tables ........................................................ 10 Set datasource location ........................................... 58 Sgn ......................................................................... 145 Show unique values ................................................. 59 Sin .......................................................................... 139 Sort order ........................................................ 65, 175 Space ........................................................................ 96 Special fields ......................................................... 170

Data Date and Time .......................................... 170 File Creation Date and Time ............................ 170

Page 189: DataFlex Reports User Guide · 2014. 12. 19. · DataFlex Reports Report reation Wizard steps users through the entire process of creating a report from selecting datasources to grouping,

+31 74 2555 609 [email protected] www.dataaccess.euData Access Europe B.V. / Lansinkesweg 4 / 7553 AEHengelo, The Netherlands

Page 189 of 189 z

Business Software for a Changing WorldTM

File Path and Name .......................................... 170 Filter Function ................................................... 170 Group Number.................................................. 172 Modification Date and Time ............................ 170 Page N of M ...................................................... 171 Page Number .................................................... 171 Print Date and Time ......................................... 170 Record Number ................................................ 170 Report Author ................................................... 171 Report Category ............................................... 172 Report Comments ............................................ 172 Report Keywords .............................................. 172 Report Revision ................................................. 172 Report Subject .................................................. 171 Report Title ....................................................... 171 Total Page Count .............................................. 171 Total Record Count ........................................... 171

Special Fields ............................................................ 30 SQL ............................................................................ 56 Sqr ......................................................................... 142 Statements ............................................................... 74

If 74 If else .................................................................... 75 Let ......................................................................... 74 Return .................................................................. 75 While .................................................................... 75

Store report ............................................................. 17 Stored procedures ................................................... 53 StrComp ................................................................... 93 String ........................................................................ 95 String functions ........................................................ 79

Asc ........................................................................ 91 Chr ........................................................................ 92 InStr ...................................................................... 88 InStrRev ................................................................ 89 LCase .................................................................... 86 Left ....................................................................... 82 Len ........................................................................ 87 LTrim .................................................................... 80 Mid ....................................................................... 84 NumberToRoman ................................................ 98 ProperCase ........................................................... 97 Replace ................................................................. 90

Right ..................................................................... 83 RTrim .................................................................... 81 Space .................................................................... 96 StrComp ............................................................... 93 String .................................................................... 95 StrReverse ............................................................ 94 Trim ...................................................................... 79 UCase ................................................................... 85

StrReverse ................................................................ 94 Sum .................................................................. 12, 161 Sum to sort on ......................................................... 67 Summarized values .................................................. 67 Suppress field ........................................................... 40 Tan ......................................................................... 140 Text field properties ................................................ 44 Thousand separator ................................................ 16 Time ....................................................................... 110 Time field properties ............................................... 45 Time Mask ................................................................ 45 TimeSerial .............................................................. 124 TimeValue ............................................................. 126 Top N ........................................................................ 67 Top N percent .......................................................... 67 Total Page Count................................................... 171 Total Record Count ............................................... 171 Trim .......................................................................... 79 TypeName ............................................................. 150 UCase........................................................................ 85 Unable to instantiate COM object ....................... 184 Unary negate ........................................................... 74 Unary plus ................................................................ 74 Undo ......................................................................... 29 Variable Height ........................................................ 44 VarType ................................................................. 151 View menu ............................................................... 30 Views ........................................................................ 53 WeekAgo ............................................................... 128 Weekday ............................................................... 117 WeekdayName ..................................................... 118 While do end ............................................................ 75 Windows Regional Options ..................................... 70 Year ........................................................................ 111


Recommended