reports generator for logisalesdownloads.orologic.com/logisales/reports-generator-guide.pdf ·...

57
Reports generator for LogiSales Copyright © 1996-2010 OroLogic Inc. http://www.orologic.com Revision 3.00

Upload: others

Post on 21-Jul-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Reports generator for

LogiSales

Copyright © 1996-2010 OroLogic Inc. http://www.orologic.com Revision 3.00

Page 2: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Contents

Reports Generator for LogiSales

I

Contents Getting started with the Reports generator for LogiSales _______________________________ 1 Introducing the Reports Generator for LogiSales _________________________________________ 1 Starting the reports generator _________________________________________________________ 1 Reports explorer ____________________________________________________________________ 1 Reports vs. Forms ___________________________________________________________________ 2 Design environment__________________________________________________________________ 3

The Data tab _______________________________________________________________________________3 The Calc tab _______________________________________________________________________________3 The Design tab______________________________________________________________________________4 The Preview tab_____________________________________________________________________________4

Exporting reports from a database to another ____________________________________________ 5 Steps to design reports ___________________________________________________________ 6 Selecting data _______________________________________________________________________ 6

Tables: ____________________________________________________________________________________6 Fields: ____________________________________________________________________________________6 Calculated fields:____________________________________________________________________________7 Group: ____________________________________________________________________________________7 Sort order: _________________________________________________________________________________7 Search criterias: _____________________________________________________________________________7 SQL: _____________________________________________________________________________________9 Useful information when selecting data __________________________________________________________9

Report design ______________________________________________________________________ 10 Bands____________________________________________________________________________________10 Objects___________________________________________________________________________________10 Availables menus, popup menus and toobars for report design _______________________________________12

Programming using RAP ____________________________________________________________ 13 Report events: _____________________________________________________________________________14 Some explanations: _________________________________________________________________________14 List of events and properties __________________________________________________________________15 Instructions and syntax of the RAP language _____________________________________________________15

Printing reports and exporting data ___________________________________________________ 15 Printing parameters _________________________________________________________________________15 Printing to a file____________________________________________________________________________15

Tutorials _____________________________________________________________________ 18 Overview__________________________________________________________________________ 18 About this section___________________________________________________________________ 18 Tutorial 1 (A simple test)_____________________________________________________________ 19

Overview _________________________________________________________________________________19 Getting started _____________________________________________________________________________19 Query Wizard _____________________________________________________________________________19

Page 3: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Contents

Reports Generator for LogiSales

II

Design workspace __________________________________________________________________________20 Preview __________________________________________________________________________________23 Fixes ____________________________________________________________________________________23

Tutorial 2 (A report to learn to use the reports generator) _________________________________ 24 Overview _________________________________________________________________________________24 Component creation ________________________________________________________________________24 Band adjustment ___________________________________________________________________________24 Basic component selection ___________________________________________________________________25 Docking toolbars ___________________________________________________________________________26 Sizing, Aligning and Positioning components_____________________________________________________28 Front-to-Back order_________________________________________________________________________30 Advanced component selection________________________________________________________________33 Advanced sizing ___________________________________________________________________________33 Speed menu _______________________________________________________________________________34 Data Tree_________________________________________________________________________________38

Tutorial 3 (A summary tutorial)_______________________________________________________ 43 Overview _________________________________________________________________________________43 Query Wizard _____________________________________________________________________________43 Design Workspace__________________________________________________________________________43 Preview __________________________________________________________________________________46 Fixes ____________________________________________________________________________________46

Tutorial 4 (Cover page) ______________________________________________________________ 47 Overview _________________________________________________________________________________47 Design environment ________________________________________________________________________47 Preview __________________________________________________________________________________48

Tutorial 5 (Simple table listing) _______________________________________________________ 50 Overview _________________________________________________________________________________50 Query Wizard _____________________________________________________________________________50 Design environment ________________________________________________________________________50

Other documentation ___________________________________________________________ 54

Page 4: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Getting started with the Reports generator for LogiSales

Reports Generator for LogiSales

1

Getting started with the Reports generator for LogiSales Introducing the Reports Generator for LogiSales A powerful reports generator is included with LogiSales and allows you to create your own reports (or forms when printing orders, invoices, product records, etc.) or modify existing ones. In addition to allowing you to design customized reports, this reports generator distinguish from conventional reports generator by including an object oriented programming language called RAP (Report Application Pascal). RAP allows you to create more dynamic and advanced reports. Refer to the RAP - Reports generator programming language for LogiSales guide for a detailed documentation about this programming language.

Note that the term “report” is always used in the documentation but everything that apply to reports apply also to forms. Starting the reports generator To start the reports generator for LogiSales, from the task bar of Windows, click Start, Programs and LogiSales then click on the Reports generator icon. After a short period of time you will get into the reports generator, ready to use it. If you cannot start the reports generator or you get problems, refer to the Technical support section of the LogiSales installation guide. Note: By default, when installing LogiSales the first time, the security is not enabled. To enable the security into LogiSales, refer to the LogiSales user's guide. Reports explorer The main window of the reports generator is called the reports explorer. On the left side you have the folders and on the right side the reports and sub-folders. Each folder represents an item of the Reports menu of LogiSales. You can organize your folders and reports as you like. Changes made from the reports explorer are immediately available in the Reports menu of LogiSales.

Page 5: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Getting started with the Reports generator for LogiSales

Reports Generator for LogiSales

2

Please note that the folder named // Forms is a special folder that is never displayed in the Reports menu of LogiSales. This folder contains order forms, invoice forms, product records forms, etc.. Forms can be customized or new ones can be created the same way you design reports with one exception that a special search criteria is required for those forms. Refer to the Search criterias paragraph of the Selecting data section for more information.

The report explorer allows you to manage your reports and folders. Its use is similar to the Windows Explorer. Use the toolbar or popup menus to add, edit or delete reports and folders. Drag and drop capabilities are also supported to move your reports and folders. When adding or editing reports, a new window is displayed. This window is called Design environment. Its from this window that you can customize your reports. When you quit the design environment, you automatically go back to the reports explorer window. Refer to the Design environment section for more information on designing reports. To create a new report, click the New report button from the toolbar. You will get into the design environment with a new empty report. To modify an existing report, select the desired report and click the Edit button from the toolbar. You will get into the design environment ready to modify the selected report. Note that you can make reports and folders invisible to LogiSales users. For example, if you are working on a new report and you don’t want this report be available to LogiSales users until this report is finished, you can temporarily make this report invisible. To do that, when you type a name for a report, just type the // characters at the beginning of the name of the report. Doing this indicate to LogiSales to not use this report. You can do the same thing to name a folder. A folder name beginning by the two characters // will not be included in the Reports menu of LogiSales. Note that if you make a folder invisible, all reports and sub-folders of this folder will be also invisible even if these sub-folders and reports name don’t begin with the // characters. To make a report or folder visible, just rename it and remove the // characters. Reports vs. Forms When using LogiSales, when you print orders, invoices, product records, etc., you can select which form you want to use to print the selected record. Several models are already included with LogiSales. However, you can customize these forms to fit your needs or even create new ones. In fact, a form is a report that only prints information for a specific orders, invoices, product records, etc. Forms customization is made the same way you customize a report. The only exception is that a special search criteria must be specified to

Page 6: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Getting started with the Reports generator for LogiSales

Reports Generator for LogiSales

3

allow the form to be correctly printed. Refer to the Search criterias paragraph of the Selecting data section for more information about the specific search criteria required for forms. Design environment The design environment is divided into four tabs: Data, Calc, Design and Preview.

The Data tab Its from this tab you can define which data will be used for the report. From this tab, you can create the query to the database, select the fields to use, group data, choose the sort order, add search criterias and calculated fields (calculated at the database level) etc. Refer to the Selecting data section for more information on the Data tab.

The Calc tab As indicated previously, the report generator for LogiSales has a powerful programming language called RAP. Its from this tab that you can make programming into your reports allowing you to develop more dynamic and advanced reports. The RAP language is identical to the Delphi’s Object Pascal language. If you know Object Pascal you automatically know RAP. The RAP language allows you to access all properties, events, bands, objects and data of your reports. You can also create new objects dynamically into your reports. Despite the fact that using RAP into reports is not necessary, users who will need it will be very satisfied by this powerful programming language.

Page 7: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Getting started with the Reports generator for LogiSales

Reports Generator for LogiSales

4

Refer to the Programming with RAP section for more information on the Calc tab and the RAP programming language.

The Design tab Its from this tab that you design your report. This tab contains all menus and options you will need to format your report. Refer to the Report design section for more information on how to design and format your report.

The Preview tab Its from this tab you can preview or print your report. While you are designing your report, access this tab to see a preview of it. Refer to the Printing reports and exporting data section for more information on printing and exporting options.

Page 8: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Getting started with the Reports generator for LogiSales

Reports Generator for LogiSales

5

Exporting reports from a database to another LogiSales allows you to work with several databases. For example, you could have a production database for your real information and a test database in which you make your tests. For example, if you created reports in the test database and now you want to get these reports into your production database, here is how to do that. Run the reports generator. From the connection list, select the connection to connect to your test database. After it, open the report you want to export. From the File menu select Save to file. Select the folder where you want to save the report, type a name and click the Save button. Quit the reports generator and start it again but this time connect to your production database. Create a new report. After it, from the File menu, select Load from file, select the file you just saved and click the Open button. Your report in now in your production database. Refer to the Connections manager section in the LogiSales installation guide for more information aboutn how to have multiple connections to different databases.

Page 9: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Steps to design reports

Reports Generator for LogiSales

6

Steps to design reports Selecting data Information of LogiSales is divided into tables. Usually, each table corresponds to a module of LogiSales. For example, the Customers table contains the list of customers of LogiSales. Each table is divided into records. If we reuse the example above, each record corresponds to a specific customer. Each record is divided into fields. Here is an example of some fields of a record of the customers table: The customer code, the customer name, the customer status, etc. The first step while creating a new report is to indicate which data will be used for the report. The data selection for a report is made from one or more queries to the database. A query indicate which fields of which tables we want to use for our report. From the reports generator for LogiSales, the creation process of queries is made from the Data tab. Two different tools to create queries are available from this tab: The Query wizard and the Query designer. The query wizard is especially used to create queries. Creating queries from the query wizard allows you to create queries step by step by answering questions. On the other side, the query designer can be also used to create queries but is especially used to modify queries you created from the query wizard or query designer. To create a query from the query wizard, from the Data tab, select the File menu and select New. Then, select the Query wizard icon and click the OK button. Answer questions asked by the wizard to create your query. To create a query from the query designer, from the Data tab, select the File menu and select New. Then, select the Query designer icon and click the OK button. Select the information to create your query like the tables to use, the fields, the sort order etc from the different tabs.

Each query can have many parameters as: Tables: A query must use at least one table. If your query use more than one table, all tables are automatically linked together by the reports generator. Fields: A query must use at least one field. The selected fields will be able to be displayed in the report.

Page 10: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Steps to design reports

Reports Generator for LogiSales

7

Calculated fields: Calculated fields (at the database level) can be defined in the query. For example, if you have a query that list products of invoices, you could have selected the fields Quantity and Price in your query. You could create a calculated field to multiply the field Quantity by the field Price to get a new field Amount. Group: Data of a query can be grouped on different fields to return only a summary by group. Sort order: Data of a query can be sorted on different fields to set the display order of the information into the report. Search criterias: Search criterias indicate which parameters the user running the report will be asked for. After it, the report will only display information matching criterias typed by the user. A search criteria frequently used is a search criteria on date fields. For example, if you create a report to print list of invoices between two dates, you will need to add a search criteria on the field date of your query. When a user will run this report, LogiSales will automatically display a dialog box asking the user to choose for which dates he wants to print the report.

To indicate LogiSales to ask users for criterias, be sure the checkbox AutoSearch is checked for each criteria added to the query. Note about forms : When designing forms to print orders, invoices, product records, etc., a special search criteria must obligatory be added to allow LogiSales to print the information relative to the selected item (such as an invoice). For invoice forms: From the Search tab of your query, you must add the Invoice I field (INVID) to the search criterias list and select the = operator for this search criteria. After it, the design process of your form can be made exactly as designing a report. Note that you can open in design mode a form model already included with LogiSales to see how the special search criteria has been entered.

Page 11: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Steps to design reports

Reports Generator for LogiSales

8

For sale order forms: From the Search tab of your query, you must add the Sale Id field (SALID) to the search criterias list and select the = operator for this search criteria. After it, the design process of your form can be made exactly as designing a report. Note that you can open in design mode a form model already included with LogiSales to see how the special search criteria has been entered. For shipping forms: From the Search tab of your query, you must add the Shipping Id field (SHPID) to the search criterias list and select the In List operator for this search criteria. After it, the design process of your form can be made exactly as designing a report. Note that you can open in design mode a form model already included with LogiSales to see how the special search criteria has been entered. For purchase order forms: From the Search tab of your query, you must add the Purchase Id field (PURID) to the search criterias list and select the = operator for this search criteria. After it, the design process of your form can be made exactly as designing a report. Note that you can open in design mode a form model already included with LogiSales to see how the special search criteria has been entered. For quote forms: From the Search tab of your query, you must add the Quote Id field (QUOID) to the search criterias list and select the = operator for this search criteria. After it, the design process of your form can be made exactly as designing a report. Note that you can open in design mode a form model already included with LogiSales to see how the special search criteria has been entered. For customer record forms: From the Search tab of your query, you must add the Customer Id field (CUSID) to the search criterias list and select the = operator for this search criteria. After it, the design process of your form can be made exactly as designing a report. Note that you can open in design mode a form model already included with LogiSales to see how the special search criteria has been entered. For product record forms: From the Search tab of your query, you must add the Product Id field (PROID) to the search criterias list and select the = operator for this search criteria. After it, the design process of your form can be made exactly as designing a report. Note that you can open in design mode a form model already included with LogiSales to see how the special search criteria has been entered. For supplier record forms: From the Search tab of your query, you must add the Supplier Id field (SUPID) to the search criterias list and select the = operator for this search criteria. After it, the design process of your form can be made

Page 12: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Steps to design reports

Reports Generator for LogiSales

9

exactly as designing a report. Note that you can open in design mode a form model already included with LogiSales to see how the special search criteria has been entered. For inventory transaction forms: From the Search tab of your query, you must add the Transaction Date field (MVTDAT) to the search criterias list and select the between operator for this search criteria. You must also add the Product Id field (PROID) to the search criterias list and select the = operator for this search criteria. After it, the design process of your form can be made exactly as designing a report. Note that you can open in design mode a form model already included with LogiSales to see how the special search criteria has been entered. SQL: When creating or editing a query with the Query wizard or the Query designer, some code called SQL is automatically generated. When running a report, this code is sent to the database to indicate to it which data need to be returned for the report. Despite the fact that its not recommended, this SQL code can be edited manually. We strongly recommend to not edit the SQL code manually unless you are experienced with the SQL programming language. Note that if you edit the SQL code manually, you will not be able to modify the query with the graphical tool Query designer anymore, but you will still be able to use your query with your report. Useful information when selecting data Links: When you create a query containing many tables, all these tables are automatically linked together by the reports generator. Most of the time, one query is sufficient to create your report. However, it can happen that you need more than one query for a specific report. In that case, the queries are not automatically linked together. You need to do it manually. To link two or more queries together, click the Link button from one of your queries to link the queries together.

Using data (queries) of a report to another one When you create new reports, it can happen that you want to use queries you already created in another report. Instead of recreating this queries in your new report, you can directly use queries from another one. To do that, you need to open the old report. After it, select the Data tab, click the File menu then select Export... to export queries of this report. Choose where you want to save it, type a name and click the Save button. After it, close this report and open the new one. From the Data tab, click the File menu then select Import... and select the data module you just saved. The queries will be automatically imported into your new report.

Page 13: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Steps to design reports

Reports Generator for LogiSales

10

Report design When creating reports, all the visual parts of the report (information layout, colors, alignment, fonts, etc.) are designed from the Design tab. This tab contains all the menus, popup menus, toolbars and objects to design your report.

Bands A report is divided up into different parts called Bands. Each band is printed in a logical order. The Title band This band prints only once at the beginning of the report. This band if usually used to display information such as the report title, of different information you want see displayed only once at the beginning of the report. The Header band This band is printed at the beginning of each page. For example, you can use this band to display header columns of your report. The Detail band This band is displayed once for each record of your query. For example, if you print the list of customers, this band will be displayed once for each customer of your report. The Footer band This band is printed at the end of each page. For example, you can use this band to print the page number and the printed date and time of the report. The Summary band This band is printed only once at the end of the report. For example, you can use this band to print a grand total or any other information you want see displayed only once at the end of the report. The Group header and Group footer bands These bands are only available when you create a report that data are sorted and grouped on some criterias. For example, if you print the list of customers grouped by category of customer, each time the category of customer change, you could print some information for this specific category (either in the group header or group footer band). Note that you can have several groups on a same report. For example, you can print the list of invoices grouped by categories of customer and customer. This way you would have a group header and a group footer for categories of customer and a group header and a group footer for the customer. Objects Objects can be added on the bands. These objects allow you to display information on your report. Many kind of objects can be used to design your report such as labels, lines, shapes, checkboxes, memos, rich

Page 14: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Steps to design reports

Reports Generator for LogiSales

11

text, images and logos and even barcodes. Some advanced objects are also available like regions, sub-reports and cross-tab. Label This object is used to display text into your reports. The text displayed with this object is usually static. DbText This object is used to display all kind of fields of the database into your reports. Memo This object is used to display multiple lines of text. The text displayed with this object is usually static. DbMemo This object is used to display multiple lines of text from a database field. For example, the Note field of the Product record. RichText This object is used to display multiple lines of formatted text. You can use the built-in RTF editor to load, modify and save rich text data stored in a file. The text displayed with this object is usually static. DbRichText This object is used to display multiple lines of formatted text from a database field. Note that at this time, there is no formatted memo field in the LogiSales database. System variable This object is used to display common report information such as page number, page count, print date and time, etc. Variable This object is used for calculations via the RAP programming language. The variable type can be specified at design time. The variable type can be: Boolean, Date, Time, DateTime, Integer, Simple, Double, Extended, Currency, Char or String. DbCalc This object is used for simple calculations such as Sum, Count, Minimum, Maximum and Average from a database field. The value can be reset when a group breaks. Image This object is used to display images and logos. Several file formats are supported such as JPEG, Bitmap, Metafile, Enhanced Metafile, etc.. The image displayed with this object is usually static. DbImage This object is used to display images and logos from a database field. Shape This object is used to display various shapes such as squares, rectangles, circles, ellipses, etc. Line This object is used to display horizontal or vertical lines. Chart This object is used to display a chart. The chart displayed with this object is usually static. Many chart formats are available. DbChart This object is used to display a chart using your report data. Many chart formats are available.

Page 15: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Steps to design reports

Reports Generator for LogiSales

12

BarCode This object is used to render barcodes. Several symbologies are supported such as: Code 128, Code 39, EAN-13, EAN-8, FIM, Codabar, MSI, Interleaved 2 of 5, Post-Net, UPC-A and UPC-E. The barcode displayed with this object is usually static. DbBarCode This object is used to render barcodes from a database field. Several symbologies are supported such as: Code 128, Code 39, EAN-13, EAN-8, FIM, Codabar, MSI, Interleaved 2 of 5, Post-Net, UPC-A and UPC-E. CheckBox This object is used to display checkbox. The checkbox displayed with this object is usually static. DbCheckBox This object is used to display checkbox from a database field. Region This object is used to logically group objects together. Objects grouped with the help of a Region can be moved together in relation to another dynamically resizing object such as a memo. Sub-report This object is used to handle multiple master details, to create side-by-side reporting effects, and to hook reports together as one. CrossTab This powerful object is used to present summarized data in a grid format. Availables menus, popup menus and toobars for report design Different tools are available from the Design tab to design your reports. All of these tools are not covered in the documentation, but here is an overview. File menu This menu allows you to access your reports, to export and import it, to set page setup and configure the printing to text files (when the report is printed (exported) to a text file). Edit menu This menu allows you usual edit tasks like Copy/Cut/Paste of objects. View menu This menu allows you to display or not toolbars available for report design. Report menu This menu allows you to configure some report parameters such as the data source, bands to be displayed, groups, etc. Help toolbar This menu allows you to display the reports generator documentation. Standard components toolbar This toolbar contains standard objects. These objects are usually used to display static information such as the report title. Data components toolbar This toolbar contains the data aware objects. Unlike standard components, these objects are used to display information from database fields such as customer name in a list of customers.

Page 16: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Steps to design reports

Reports Generator for LogiSales

13

Advanced components This toolbar contains the following special objects: Sub-report, Region and Crosstab. Report tree window This window displays all objects of the current report in a hierarchical order. You can select on object directly from this window. The window can be Dockable on one side of the report. Data tree window This window displays all fields of your query which can be displayed into your report. From this window, you can drag fields directly into your report. Standard toolbar This toolbar allows you to make some standard operations such as saving your report, copy objects without using the menu, etc. Format toolbar This toolbar allows you to format the selected object. For example, you can choose the font of the object, adjust the alignment, etc. Edit toolbar This toolbar allows you to type information like the text of a Label object. Draw toolbar This toolbar allows you to set the color and border of some kind of objects. Align or Space This toolbar allows you to align or space out objects. Size This toolbar allows you to enlarge or shrink group of objects at the same size. Nudge toolbar This toolbar allows you to move objects. Programming using RAP The RAP programming language (Report Application Pascal) allows you to make calculations, format and display objects dynamically into your reports. For example, if you create a report to print the list of invoices, you could type some lines of code to print in red negative amounts and in black positive ones. Or, you could type some lines of code to make some specific calculations into your report. The RAP language is an object oriented programming language and is identical to the Delphi’s Object Pascal. If you know Object Pascal, you automatically know RAP. If you don’t know Object Pascal, the RAP programming language is easy to learn. Note that if you already know some other programming languages, it will be easier to learn RAP. If you don’t know programming, we recommend you to start learning RAP with somebody who knows about programming. Refer to the RAP - Reports generator programming language for LogiSales guide for a detailed documentation about this programming language. RAP language gives you access to all properties, events, bands, objects and data of the reports. You can also create new objects dynamically into your reports using RAP.

Page 17: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Steps to design reports

Reports Generator for LogiSales

14

Report events: When displaying and/or printing reports, some events are always fired. You can write lines of code to make specific actions or calculations when these events are fired. For example, when you print a report, an event called OnPrint is fired before printing each object of the report. For example, if into your report you have an object that prints an amount, you could use the OnPrint event of this object to write some lines of code to indicate which color the amount will be printed depending of its value. For example, if the amount is less than zero, you could print the amount in red and in black if the amount is equal or greater than zero. Here is an example of RAP of how you could do this (We suppose that the amount object is named MyAmount) : If MyAmount.FieldValue < 0 Then MyAmount.Font.Color := clRed Else MyAmount.Font.Color := clBlack; Some explanations: The first line check if the value of the MyAmount object is less than 0. Its done by using the FieldValue property of the MyAmount object. If the value is less than 0, the program automatically jumps to the line 2. If the value is not less than 0, the program automatically jumps to the line 4. The red color when programming with RAP is called clRed and the black color clBlack. The color is affected to the Color property of the Font property of the MyAmount object. The Font property indicate the font to use for this object while the Color property indicate the color to use for the font. As mentioned above, the RAP programming language is an object oriented programming language. Each object of the report have properties and events. A property is a specific characteristic of an object. For example, the Font property of the MyAmount object indicate the font to use for this object. These properties can have themselves properties like the Color property of the Font property of the MyAmount object. About events, they are actions automatically fired at a given time. You can uses these events to interact with your report. For example, the OnPrint event of the MyAmount object is fired each time the MyAmount object is printed.

Page 18: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Steps to design reports

Reports Generator for LogiSales

15

List of events and properties Each object used in a report has its own events and properties. Also, each band and the report itself have their events and properties. To know events of an object, from the Calc tab, select the desired object from the Report objects section and the available events of this object will be displayed in the Events section. To know properties of an object, from the Calc tab, select the desired object from the Code Toolbox: Report objects section and the available properties of this object will be displayed in the section below. Note that you can select an object property and drag it on the left side to the programming section. The code of this object will be automatically generated without typing anything. Instructions and syntax of the RAP language RAP being a derived language of Object Pascal (Delphi), most of the instructions of Delphi are available in RAP. To see the available instructions, functions, variable types, operators, etc. from the Calc tab, select the Language tab of the Code Toolbox located at the bottom right of this window. Note that some elements of the Object Pascal language are not supported by RAP such as class declarations, arrays, Record types and Set types. Refer to the RAP - Reports generator programming language for LogiSales guide for a detailed documentation about this programming language. Printing reports and exporting data Printing parameters When creating reports, some printing parameters can be set like the default number of copies, collate option and even which printer to use for the report. Note that if several users are using the same reports from different computers, its not recommended to set which printer to use in a report, since users don’t have access to the same printers. To set printing parameters, from the Design tab, select the File menu then Page setup.

Printing to a file Instead of printing a report on a printer, its possible to print the report to a file. Many file formats are available such as: PDF (Adobe Acrobat), BMP, JPEG, GIF, Metafile, PNG, RTF, DOC (MS Word), XLS (Excel) as well as structured text file and report emulation text file. To print a report to a file, when printing the report, select the Print to file checkbox. After it, select the type of file you want and type a name for the file where the report will be printed to.

Page 19: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Steps to design reports

Reports Generator for LogiSales

16

Printing to non text file This option can be used to print a report to a non text file. No special configuration is necessary to print to such file format. Printing to a structured text file This option is used to export a report to a structured text file. After it, the text file can be imported to another application such as a spreadsheet (Note that if you are using Excel, you can print directly to XLS file format. See above). Printing to a structured text file will not necessarily print all the information of the report. You can choose which information will be sent to the text file and in which format. The supported text file formats are comma delimited, tab delimited and fixed length. To configure your report to indicate which information must be saved to the text file and in which format, from the Design tab, select the File menu then select Print to file setup.

Page 20: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Steps to design reports

Reports Generator for LogiSales

17

Printing to a text file in emulation mode This option is used to export a report to a non structured text file. However, the format of the report is preserved. This printing mode can be useful for sending a report as an e-mail attachment or directly to a dot-matrix printer. Unlike printing to a structured text file, printing in emulation mode does not require any configuration in advance. All textual objects will be printed in the text file except for memos, dbmemos, richtext and dbrichtext.

Page 21: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

18

Tutorials Overview This section contains a series of tutorials developed to teach you how to create stunning reports. The tutorials begin with the basics, such as how to use the design environment, and end with advanced reporting techniques. This section should therefore be helpful to both novice and the seasoned report designers. About this section As you work through this section, it is important to keep in mind that the tutorials build on one another, moving from basic concepts to complex reports. Therefore, it may be difficult to complete an advanced tutorial without having first completed earlier tutorials. Each tutorial produces some kind of report and brings to light important aspects of the reports generator.

Page 22: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

19

Tutorial 1 (A simple test) Overview This simple exercise provides an introduction to the reports generator, the Query Wizard, and the process of building reports. The purpose of this tutorial is to show you what it takes to build a report. We will cover the meaning behind the actions in later tutorials. The final report for this tutorial should contain the following items: - A list of customer names - A contact name for each customer - A phone number for each contact Getting started It will be helpful for you to become familiar with the following set of directions because you will repeat this process to begin each report. 1. Click the New Report icon on the main toolbar. 2. Click the Data tab. 3. Select File and New in order to access the New Items dialog. 4. Double-click on the Query Wizard icon. The Query Wizard will come up with a list of Available tables. Query Wizard The Query Wizard is a tool that allows you to access information from your database to use in your reports. 1. Choose the Customers table by double-clicking on it. The Customers table should now appear in the list of Selected Tables. 2. Once the Customers table is selected, click the Next button. 3. Keep clicking the Next button until you reach the Set Order page of the wizard. 4. Click on the Set Order button. 5. Double-click on Customers.Customer Name so it appears in the list of Selected Fields. 6. Click Next. 7. A screen with a checkered racing flag will appear. Click Finish. 8. You have officially completed your first query via the Query Wizard. You will notice a new window in the upper left-hand corner of the data workspace. This is a query. It represents the data, which is selected from the database each time the report is generated. 9. Click the Design tab in order to begin laying out your report.

Page 23: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

20

Design workspace The Design tab is the environment in which you will build reports. Whatever what you put in the header band (the white space above the word header) will appear at the top of each page of the report; whatever you put in the detail band will be in the body of the report, and whatever you put in the footer band will appear at the bottom of each page of the report. Task 1 Place and name labels 1. Locate the label icon on the toolbar. 2. Click on the icon. 3. Clink in the white space of the header band in order to create a label. 4. Create two more labels in the header band. 5. Select Label1. 6. Locate the edit toolbar (below the label component icon on the toolbar). It should contain the text Label1, which is the caption of the currently selected label. 7. Highlight the text in the edit toolbar and type Customer name. 8. Select Label2 and type Contact name into the edit toolbar. 9. Select Label3 and type Phone into the edit toolbar. Task 2 Save the report 1. Press Ctrl + S to save your work. 2. A dialog box will appear that looks like this:

3. Expand the drop-down list at the top of this dialog by clicking on the arrow icon. Select All folders from the list. This will allow you to save the report in this folder. 4. At the bottom of the dialog, you should see an edit box that contains the report name. The default name is New Report. Select the text and change the name to Simple test. Click the Save button. 5. Close the Designer environment by clicking File | Close. Notice that your new report is listed in All folders.

Page 24: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

21

6. Double-click on Simple test to return to the design environment. Task 3 Bold the text in the labels 1. Select the Customer name label. 2. Hold down the Shift key and then click on the other two labels. All three labels should now be selected. You can tell that they are selected by the small gray boxes surrounding each label.

3. Click the Bold icon . All three labels captions should turn bold. Task 4 Create and choose Data for DBText components. 1. Locate the DBText icon on the toolbar. 2. Place a DBText component in the detail band. 3. Change the text from bold to regular by clicking on the bold button. 4. Place two more DBText components in the detail band. 5. Select DBText1. 6. Notice that there are two drop-down list boxes in the upper left-hand corner of the design environment. The drop-down list box on the left contains the query from the Data tab. The drop-down on the right contains the fields. 7. Select Customer Name from the drop-down list box containing the fields. The first customer name in the query should appear as the caption of the DBText1 component. 8. Select DBText2. 9. Choose Customer Contact from the drop-down list. The first customer contact in the query should appear in the DBText2 component. 10. Select DBText3. 11. Choose Customer Phone from the drop-down list box. The first customer phone in the query should appear in DBText3. Task 5 Adjust the label components

Page 25: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

22

1. Right-click over the Customer name label and select the Position... menu option. 2. Set the left to 0.1. 3. Right-click over the Contact name and set the left to 2.3. 4. Set the Phone label to 3.8. 5. Set the Customer name top to 0.3. 6. Select the Customer name label. 7. Hold down the Shift key and click on the other two labels. All three labels should now be selected. 8. Launch the Align or Space toolbar by selecting View | Toolbars and clicking on Align or Space. The toolbar should appear under the drop-down list boxes. 9. Click the Align Top icon . The Contact name and Phone labels should align with the Customer name label. Task 6 Adjust the DBText components 1. Right-click over the Customer name DBText. 2. Set the width to 2.1. 3. Set the Contact name DBText width to 1.3. 4. Set the Phone DBText width to 1.3. 5. Select the Customer name DBText and set the top to 0.0. 6. Shift-click the other DBTexts so that they are all selected. 7. Click the Align Top icon on the Align or Space toolbar. Note: The DBText components may overlap. That’s fine. The next task correct the overlap. Task 7 Align the components 1. Select the Customer name label and shift-click the Customer name DBText. 2. Click the Left Align icon . The DBText component should be positioned directly beneath the label and both components should be aligned left. 3. Left align the Contact name label and the Contact name DBText. 4. Left align the Phone label and the Phone DBText.

Page 26: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

23

5. Press Ctrl + S to save your work. Preview The preview window in the designer environment works the same way as the preview capability in other Windows applications: it shows you how your report will look when it is printed. 1. Click the Preview tab and look at your report. Make sure that the columns are spaces evenly with plenty of room for long names. 2. Everything should look good except for the rows, which are double-spaced. That spacing takes up too much room and will waste paper when the report is printed. Fixes When you preview a report, you will undoubtedly find something that can be improved. Let’s fix the spacing. 1. Return to the design environment by clicking on the Design tab. 2. Place your cursor over the gray bar labeled Detail. Your cursor will change to an up/down arrow , indicating that you can drag the section divider up and down. 3. Drag the divider up until it meets the bottom of the components in the detail band. 4. Preview the report once more. 5. Close the design environment by clicking the button at the upper right corner of the window. 6. A dialog box asking you to Save Changes will appear. Click Yes. 7. Congratulations! You’ve completed your first report.

Page 27: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

24

Tutorial 2 (A report to learn to use the reports generator) Overview These exercises will get you oriented in the design environment and teach you to use some basis tools. It’s a good idea to study this section because each task is extremely detailed, whereas the other exercises will assume that you are familiar with the basics and therefore be less explicit. Component creation The first thing you need to know in order to write a report is the signifiance of the canvas. The canvas is divided into sections called bands. A band is labeled in the section divider immedialely below it; thus, the fist band is called the header, the second is called the detail, and the third is called the footer. When the report generates, the bands are printed on different parts of the page. There are many different band types for different occasions, but for now we will just use the header, detail and footer bands. Let’s create some components and put them in the bands. A component is a element used to control how the report looks. Each component has a unique purpose. 1. Click the New Report icon on the main toolbar. The design environment will appear with the Design tab active. 2. Locate the label icon on the toolbar. 3. Click the icon. 4. Click in the white space of the header band. You have just created a label component. 5. Create two more labels in the header band. 6. Locate the shape icon on the toolbar. 7. Click the icon. 8. Click on the white space of the header band in order to create a shape. 9. Press Ctrl + S to save your work. Name the report Cal1. Save at the end of each task. Note: You can use the process of clicking the icon, then clicking in a band to create any type of component. Band adjustment Note that the shape doesn’t quite fit the header band. We can remedy this by increasing the height of the band. 1. Locate the ruler on the left side of the work-space. 2. Place your cursor over the divider labeled Header Your cursor will change to an up/down arrow , indicating that you can drag the divider up and down. 3. Hold down the left mouse button and drag the divider up and down. Notice the two little lines that appear on the vertical ruler to the left of the divider. These lines are called guides because they represent the new position of the divider.

Page 28: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

25

4. Increase the height of the header band by dragging the divider until the guide reaches the one inch mark on the vertical ruler. In order to do this you must first drag the divider until the band height is greater than one inch. Then release and drag the divider up until the top guide hits the one inch mark. Note: This method of changing the size of the header band work for all bands. Basic component selection One components are created, the real work begins, for each component needs to be carefully positionned in order to create a high-quality report. 1. Select the Label1 component by clicking on it. The selected should look like this:

2. Select the remaining components: hold down the Shift key and then click on the other two labels and the shape. All of the components should now be selected. You can tell that they are selected by the small gray boxes surrounding each component. These boxes are called selection handles.

3. Click on the white space of the header band. Notice that the components are deselected. 4. Click on the white space to the left of the first label, hold down the left mouse button and begin dragging the mouse down. A bounding box will appear. It should look like the rectangular box below::

5. Drag the mouse across the components until the bounding box encompasses all of the components.

6. Release the mouse button. All of the components will be selected.

Page 29: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

26

7. Place your cursor over one of the components and drag in any direction. Notice how all of the components move in unison. This is called a component selection. Note: These are two methods you can use to select multiple components: the shift-click method (hold down the Shift key and click the components) and the bounding box method (hold down the mouse buton and outline the components). Docking toolbars Toolbars are used to set the properties of a component. Here are a few examples of the kinds of properties a component may have: font size, color and font style. Before we can use the toolbars effectively, we must first learn how to position them within the design environment. 1. Launch the Draw toolbar by selecting View | Toolbars and clicking on Draw. The toolbar should appear in the upper left-hand corner of the design environment, above the horizontal ruler. 2. Locate the handle on the far left side of the toolbar. 3. Place the cursor over the handle and hold down the left mouse button.

4. Drag the mouse down until the cursor is over the top corner of the header band. A rectangle representing the new toolbar location will be drawn.

5. Drag the mouse to the left until the rectangle pivots and appears as follow:

Notice how the border changes from a thick line to a thin line to indicate that the toolbar will successfuly dock. 6. Release the mouse button. The toolbar is now docked vertically.

Page 30: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

27

7. Drag the toolbar over the upper left corner of the header band. The rectangle, which represents the new position of the toolbar, will look like this:

8. Release the handle. The toolbar is now a floating window. The area at the top of the toolbar (labeled Draw) is called the title bar. You can move the window by placing your cursor over the title bar and dragging.

9. Click on the close button in the title bar. The toolbar will be closed. 10. Select View | Toolbars from the main menu of the design environment and click on Draw menu item. Notice that the toolbar returns to the same place it was before you closed it.. Note: When the toolbar is a floating window, you can close the toolbar by clicking the close button. You can always redisplay a toolbar by accessing View | Toolbars from the main menu.. 11. Drag the toolbar to the upper right corner of the design workspace so that it looks like this:

12. Release the handle. The toolbar is now docked horizontally.

Note: All toolbars have the same docking ability as the Draw toolbar.

Page 31: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

28

Sizing, Aligning and Positioning components In order to get all of the components lined up neatly or sized correctly, you must know how to size and align with dexterity. Sizing 1. Deselect all components by clicking on the white space of the header band. 2. Select the shape component in the header band. 3. Place your cursor over the little black box on the right side of the shape and wait until the cursor changes to a left/right arrow. The little black boxes taht surround the shape are called sizing handles.

4. Drag the cursor to the right and notice how the shape gets wider.

5. Place your cursor over the sizing handle on the bottom of the shape and wait for the cursor to change to an up/down arrow.

6. Drag the cursor down and notice how the label gets taller.

7. Place your cursor over the sizing handle on the right-hand corner of the shape and wait for the cursor to change to a diagonal arow.

8. Drag, the cursor. The shape gets both wider and taller.

Page 32: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

29

9. Drag the shape to the left the corner of the header band. 10. Move the shape up and down in the header band. Notice the guides on the vertical and horizontal rulers. Whenever you are dragging or sizing, the guides show you the position and size of the selection.

11. Use the guides to set the shape to 1/2 inch by 1/2 inch. The guides should match up with the1/2 inch mark on both the horizontal and vertical rulers.

Note: You can also adjust the size of a component by selecting the component, then holding down the Shift key and pressing the arrow keys. You can use this method to size single and multiple component selections. Aligning 1. If the Align or Space toolbar is not already visible, launch it by selecting View | Toolbars and clicking on Align or Space. The toolbar should appear above the horizontal ruler. 2. Dock the Align or Space toolbar on the left side of the design environment.

3. Select the shape component in the header band.

Page 33: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

30

4. Hold down the Shift key and then click on the three labels. All four components should now be selected. 5. Click the Align Top icon of the Align or Space toolbar. The labels should align with the shape. 6. Move Label3 to the bottom of the header band.

7. Select Label3 and Shift-click the other components in order to add them to the section. 8. Click the Align Bottom icon of the Align or Space toolbar. The components should align with Label3. Note: The first component selected in a multi-select is the one to which the others align. Positioning 1. Deselect the components by clicking in the white space of the header band. 2. Select the shape. 3. Hold down the Ctrl key and press the up arrow several times to move the shape. 4. As you move the shape using this method, look at the status bar in the lower right-hand corner of the design environment. The Top measurement should track with the component’s location.

5. Use the right arrow key to move the shape to the right. The Left measurement should track with the component location. 6. Position the shape so that the Left is 0 and the Top is 0.0625. 7. Deselect the shape. 8. Use the shift-click method to select the labels. 9. Using the arrow keys, position the selection at Left of 1.3021 and a Top of 0.3854. Front-to-Back order This section illustrates how a component can be used as a background for other components. Task 1 Create and color shapes 1. Create two more shapes near the first shape in the header band..

Page 34: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

31

2. Select the first shape. 3. Locate the Fill Color icon on the Draw toolbar. 4. Click the Down arrow to the right of the icon. The Fill Color palette will be displayed. 5. Select yellow. 6. Select the second shape. 7. Select blue.

8. Select the third shape. 9. Set the color to red. Task 2 Overlap shapes and establish their order 1. Position the blue shape so that its corner overlaps the corner of the yellow shape. 2. Position the red shape so that its corner overlaps the corner of the blue shape. The three shapes should look like this:

3. Select the Preview tab Notice the shapes retain their front-to-back ordering. 4. Return to the design environment and right-click over the red shape. 5. Select the Send to Back menu option. Notice how the red shape is now behind the blue shape.

Page 35: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

32

6. Right-click over the red shape. 7. Select the Bring to Front menu option. The red shape is once again in front of the blue shape. 8. Right-click over the yellow shape. 9. Select the Bring to Front menu option. The yellow shape is now in front of the other two shapes.

10. Restore the original order of the shapes by deciding which shape needs to be sent to the back or brought to the front. (Answer: Send the yellow shape to the back) Task 3 Use a shape as a background 1. Right-click over the yellow shape. 2. Select the ParentHeight menu option. The shape’s height increases to match the band’s height.

3. Select ParentWidth. The shape’s width increases to match the band’s width. The other components appear in the front of the shapes because of the front-to-back order. 4. Right-click over the yellow shape. 5. Select the Bring to Front menu option. Notice how all of the components disappear from view. 6. Make the components reappear by right-clicking over the yellow shape and selecting the Send to Back menu option. Note: Whenever you appear to have lost a component, try using the Send to Back method in order, to find it: it may be behind another component.

Page 36: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

33

Advanced component selection This section explains how to select components in the foreground when you have a larger component in the background. 1. Try to select all of the components in the header band by clicking to the left of the first component, holding down the left mouse button, and dragging the mouse (i.e. the bounding box method). Notice how the components cannot be selected. This is because the yellow shape is selected and no bounding box can be drawn. 2. Hold down the Ctrl key and try to select the components using the bounding-box method again. When the Ctrl key is help down, you will see a bounding box.

3. Expand the bounding box to encompass all of the components and release the mouse button. All of the components, including the yellow shape, should be selected.

4. Try to move the selected components. Notice how they appear to be locked in place. The selection cannot be moved because the yellow shape fills the band and has no where to go. 5. Hold down the Shift key and click the yellow shape. Note: You can use the shift-click method to deselect any component that is part of a multi-selection. 6. Move the selected components. The components can be moved now because the yellow shape is deselected. 7. Try to deselect the components by clicking on Label1. Nothing happens. That’s because you must select an unselected component or click in the white space of the band in order to clear the current selection. 8. Deselect the components by clicking on the yellow shape. Advanced sizing When you have a shape stretched using ParentWidth and ParentHeight, you cannot change the size via the sizing handles. This exercise shows how to resize such a shape.

Page 37: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

34

1. Place your cursor over the sizing handle on the left side of the yellow shape. The left/right arrow will be displayed.

2. Try to reduce the size of the shape by dragging the cursor toward the center of the header band. The shape can't be modified because it is set to ParentWidth. 3. Right-click over the shape. 4. Select ParentWidth. The ParentWidth menu option is deselected. Now the shape's width can be modified using the sizing handle. 5. Select ParentHeight. The ParentHeight menu option is deselected. Now the shape's height can be modified using the sizing handles. 6. Use the sizing handles to modify the yellow shape so that it is about the same size as the other shapes.

Note: You may not be able to resize the shape so that it is exactly the same size as the others. The next section will address this issue by showing you a more precise way to resize shapes. Speed menu The speed menu appears when you right-click over a component. It offers different options for altering the overall look of your component via changes in shape, size, and visibility. Here is the speed menu for a shape:

Page 38: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

35

By now you know about the following menu options: Bring to Front, Send to Back, ParentHeight, and ParentWidth. Next, we'll learn about the Position option, which will allow you to control the size and position of components more precisely. Task 1 Set shape sizes 1. Select the labels and move them to the left until they reach a left of 3.7396 as indicated by the status bar. 2. Access the speed menu by right-clicking over the yellow shape. 3. Select Position... . A dialog box like the one below will be displayed; however, the numbers may be slightly different from these. That's fine.

4. Set the Left to 2.0. 5. Set the Top to 0.2. 6. Set the Width to 0.5. 7. Set the Height to 0.5.

Page 39: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

36

Task 2 Resize the blue shape 1. Right-click over the blue shape to access the speed menu. 2. Select Position... 3. Set the Left to 3.0. 4. Set the Top to 0.2. 5. Set the Width to 0.5. 6. Set the Height to 0.5. The blue shape should now be the same size as the yellow shape. 7. Set the Left of the red shape to 1. 8. Set the Top to 0.3. The layout should look like this:

Note: The speed menu applies only to the component over which you have right clicked, regardless of the selection. Task 3 will illustrate this aspect of the design environment. Task 3 Explore Component Properties and the Right-Click Option 1. Select the blue shape. 2. Shift-click the other two shapes in order to add them to the selection. 3. Right-click over the blue shape. 4. Access the Position... dialog. 5. Set the Top to 0.1. Notice that even though the other shapes are selected, the blue shape is the only component that moves. That's because the blue shape was the one over which we right-clicked.

6. Right-click over the red shape.

Page 40: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

37

7. Access the Position... dialog and set the Top to 0.2 8. Right-click over the yellow shape. 9. Access the Position... dialog and set the Top to 0.3. The shapes should now look like this:

10. Right-click once again over the blue shape and set the top to 0.0. 11. Click the Align Top icon on the Align or Space toolbar. All shapes should align with the top of the blue shape because it was selected first.

Note: You can use this method whenever you need to set the size or position of several components to the same value. Task 4 Save Your Work 1. Select File | Save from the main menu.

2. Close the design environment.

Page 41: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

38

Data Tree The Data Tree allows you to build a report based on data you have selected from the database. In order to use the Data Tree, you must first select data by creating a query. Task 1 Create a New Report 1. Click the New Report icon on the main toolbar. 2. Click on the Data tab. 3. Select File | New to access the New Items dialog. 4. Double-click on the Query Wizard icon. Task 2 Create a query via the Query Wizard. 1. The Query Wizard will come up with a list of Available Tables. Choose the Customers table by double-clicking on it. The Customers table should now appear in the list of Selected Tables. 2. Once the Customers table is selected, click the Finish button. 3. You'll notice a new window in the upper lefthand corner of the data workspace. This is the quey. It represents the data that will be selected from the database each time the report is generated. In a later exercise, we will show you how to make modifications to a query. For now, let's move on to building the report. 4. Click on the Design tab in order to begin laying out your report. Task 3 Dock the Data Tree 1. Maximize the design environment window. 2. Hide the Align or Space toolbar. 3. Select View | Toolbars | Data Tree from the main menu. 4. Place your cursor over the bottom of the Data Tree until the cursor becomes an up/down arrow . 5. Hold down your left mouse button and drag the mouse down until you can see all of the field names listed in the bottom part of the Data Tree. 6. Click on the title bar of the Data Tree and drag it to the left, making sure that the toolbar is below the horizontal ruler. Continue dragging until the position rectangle appears as shown below. This rectangle indicates how the Data Tree will be docked. The screen should look like this just before the Data Tree docks.

Page 42: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

39

7. Release the mouse button. The Data Tree should dock on the left of the workspace like this:

Task 4 Create a Vertical Report 1. Click on the Layout tab at the bottom of the Data Tree. 2. Select the vertical style.

3. Click on the Data tab at the bottom of the Data Tree. 4. Click the Customer Name field. 5. Hold down the Ctrl key and click the Customer Phone field. Your selection should look like this:

Page 43: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

40

6. Locate the divider labeled Detail on the canvas of the design workspace. 7. Place your cursor over the divider. Your cursor should change to an up/down arrow , indicating that you can drag the divider up and down. 8. Increase the height of the detail band by dragging the divider until the guide reaches the one inch mark on the vertical ruler. 9. Position your cursor over the Customer Name field in the Data Tree and drag the selection into the detail band.

10. Release the mouse button. The components necessary to display the Customer Name and Customer Phone fields in the report are created. 11. Click on the Preview tab. Notice how the labels repeat for each row of the data. This is called a vertical report because the components are laid out in a top-to-bottom fashion. Task 5 Create a Tabular Report 1. Return to the design tab. 2. Select all of the components and press the delete key. 3. Click on the Layout tab at the bottom of the Data Tree. 4. Select the tabular style.

Page 44: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

41

5. Click on the Font icon for Labels. 6. A dialog box like this will appear:

7. Make the font style bold. Now any label created via the Data Tree will be bold. 8. Click the OK button on the Font dialog. Notice how the diagram at the top of the Data Tree reflects the change by bolding the words Customer Name. 9. Click on the Data tab at the bottom of the Data Tree. 10. Position your cursor over the Customer Name field in the Data Tree and drag the selection into the lower left corner of the header band.

11. Release the mouse button. The components necessary to display the Customer Name and Customer Phone fields are created. The labels are in the header band and the data is in the detail band. 12. Click on the Preview tab. Notice how the labels appear only once at the top of the page. This report is tabular because the data is laid out in a left-to-right fashion.

Page 45: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

42

Task 6 Create a Tabular Report with a Grid 1. Return to the design tab and delete all of the components. 2. Click on the Layout tab at the bottom of the Data Tree. 3. Click the Grid check box for both Labels and Fields. 4. Click on the Data tab at the bottom of the Data Tree. 5. Position your cursor over the Customer Name field in the Data Tree and drag the selection into the lower left corner of the header band. 6. Release the mouse button. Notice the boxes around the components. These shapes will give us the effect of a grid.

7. Use the bounding box method to select all of the components in the header band. 8. Remove the labels from the selection by holding down the Shift key and clicking on each label. Only the shapes should now be selected. 9. Locate the Fill color icon on the Draw toolbar and select light gray. 10. Drag the divider labeled Detail up until it meets the bottom of the components in the detail band. 11. Click on the Preview tab. Notice the grid effect. 12. You will notice that fields are larger than the sheet. Select Customer Name objects using the bounding box method then set the width to 4. Then, select the Customer Phone objects, move the objects on the left to the position 4.5. 13. Click on the Preview tab to see the final result. 14. Save the report as Cal2 and close the Report Designer.

Page 46: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

43

Tutorial 3 (A summary tutorial) Overview This tutorial will solidify all of the report-building techniques you learned in tutorial 2. The final report should contain the following items: - A list of customer numbers - A list of customer names Query Wizard 1. Click the New Report icon on the main toolbar. 2. Click on the Data tab. 3. Select File | New in order to access the New Items dialog. 4. Double-click on the Query Wizard icon. The Query Wizard will come up with a list of Available Tables. 5. Choose the Customers table by double-clicking on it. The Customers table should now appear in the list of Selected Tables. 6. Click Finish. 8. Access the Design tab. Design Workspace Task 1 Launch the Data Tree and Set Properties 1. If it is not already visible, launch the Data Tree toolbar. 2. Dock it on the left side of the workspace. 3. Click the layout tab of the Data Tree. 4. Set the Style to Tabular. 5. Deselect the Grid boxes if they are checked. 6. Click the font icon for Labels.

Page 47: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

44

7. Set the Label font to Arial, Bold, 10. 8. Set the Field font to Arial, Regular, 10. 9. Click on the data tab of the Data Tree. 10. Press Ctrl + S to save your work. Save the report as Summary Tutorial. Save at the end of each task. Task 2 Lay Out Components in the Detail Band 1. Place your cursor over the Detail divider. Your cursor will change to an up/down arrow , indicating that you can drag the control up and down. 2. Increase the height of the detail band by dragging the divider down until the guide reaches the one inch mark on the vertical ruler. 3. Place a shape component in the detail band. 4. Set the shape's fill color and line color to yellow. 5. Right-click over the shape and select ParentHeight and ParentWidth. 6. Hold down the Ctrl key while you select the Customer Code and Customer Name in the Data Tree. 7. Drag the selection from the Data Tree into the lower left corner of the header band and release the mouse button. Labels should be created in the header band and DBTexts should be created in the detail band.

Task 3 Position the Components 1. Position the selection so that the labels line up with the bottom of the header band. 2. Deselect the components by clicking on the white space of the footer band. 3. Select all of the components in the detail band. 4. Shift-click the yellow shape to remove it from the selection. 5. Drag the selection up so that the components line up with the top of the detail band. 6. Deselect the components. Task 4 Size the Components

Page 48: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

45

1. Select the Customer Code DBText component in the detail band. 2. Use the sizing handle to make the component narrower. Size the component so that the guide lines up with the 1.5 inch mark on the horizontal ruler.

3. Shift-click the Customer Code label in the header band. 4. Launch the Size toolbar. 5. Locate the Shrink Width to Smallest icon and click on it. The label's width should shrink to match that of the DBText. Task 5 Align the Components and Adjust the Detail Band. 1. Select the Customer Name label. 2. Shift-click the corresponding DBText components in the detail band. 3. Drag the selection until it reaches the 3 1/8 inch mark on the horizontal ruler. 4. Drag the detail band divider up until it meets the bottom of the components. Task 6 Lay Out the Footer Band 1. Click the System Variable icon . 2. Click the lower left side of the footer band. 3. Select PrintDateTime from the drop-down list box in the upper left corner of the workspace. The date and time should appear in the component. 4. Place another system variable component in the lower right side of the footer band. 5. Select PageNoDesc (Page Number Description) from the drop-down list box. The page number should appear in the component. 6. Right justify the system variable by clicking the right-justify icon . 7. Align the tops of the system variables. 8. Press Ctrl + S to save your work.

Page 49: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

46

Preview 1. Click on the Preview tab and look at your report. 2. The data is solid yellow. Let's put white spaces between the data in order to differentiate the rows. Fixes 1. Click the Design tab to return to the design environment. 2. Right-click over the yellow shape. 3. Select ParentHeight. 4. Drag the detail band divider down until you can see a little white space below the shape. The layout should look like this:

5. Preview the report once again. 6. Close the Report Designer, saving the changes to the report.

Page 50: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

47

Tutorial 4 (Cover page) Overview This tutorial shows you how to create a cover page for a report. The final product will contain the following items: - The title of the report - A description of the contents of the report Design environment Task 1 Create and Adjust the Title Band 1. Open the report created at the time of tutorial 3. 2. Select File | Save As from the main menu of the Report Designer. 3. Name the report Cover Page and click Save. The name at the top of the Report Designer should change to Cover Page. 4. Hide the Data Tree if it is visible. 5. Select Report | Title. A title band will appear at the top of the canvas. 6. Increase the height of the title band by dragging the divider down until the guide reaches the 9.5 inch mark on the vertical ruler. Task 2 Create a Shape and a Label 1. Place a shape in the upper left corner of the title band. 2. Set the position of the shape: Left 2.0 Top 2.5 Width 4.0 Height 1 3. Set the fill and line color of the shape to light gray. 4. Place a label over the shape and set the caption to Customer Report. 5. Set the font size to 28. 6. Set the justification to left . 7. Select the shape and then shift-click the label. 8. Launch the Align or Space toolbar.

Page 51: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

48

10. Click the Align Center icon and the Align Middle icon . The label should be centered in the middle of the shape like this:

Task 3 Create and Adjust a Shape 1. Place a new shape below the existing shape. Set the position of the shape: Left 2.0 Top 4.0 Width 4.0 Height 3.3 2. Set the line color of the shape to dark gray. Task 4 Create and Adjust Labels 1. Create two labels and place them over the shape. 2. Set the caption for each label: Label1 Customer code Label2 Customer name 3. Select the labels and set the font size to 22. 4. Select the Customer Code and Customer name labels by holding down the Shift key. 5. Click the Align Middle icon of the Align or Space toolbar. 6. Set the top of the Customer code label to 4.75. 7. Set the top of the Customer name label to 5.25. 8. Select the Customer code label and then shift-click the Customer name label below it. 9. Click the Left Align icon and the Space Vertically icon . Preview 1. Click the Preview tab. The title page should look like this:

Page 52: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

49

2. Click the Next Page button. The rest of the Summary Report should appear. 3. Close the Report Designer and save the changes.

Page 53: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

50

Tutorial 5 (Simple table listing) Overview This tutorial illustrates how to create a table-style report. The final product will include the following items: - A list of customer names - A list of invoices for each customer - The sub-total amount for each invoice Query Wizard Task 1 Access the Query Wizard and Select Fields. 1. Create a new report. 2. Access the Data tab. 3. Select File | New. 4. Double-click on the Query Wizard icon. 5. Double-click on the Invoices table in order to select it. 6. Double-click on the Customers table. 7. Click Next until you reach the screen with the Set Order option. 8. Click Set Order and select Invoices.Invoice Customer Name and Invoices.Invoice Id. 9. Click Finish. The completed query will appear. 10. Access the Design tab. Design environment Task 1 Create a Layout Via the Report Wizard. 1. Select File | New in order to access the Report Wizard. 2. Double-click on the Report Wizard Icon.

Page 54: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

51

3. Select the following fields by double-clicking: Customer Name Invoide Id SubTotal 4. Click Next until you see the screen with the checkered racing flag. Select Modify the report's design.

5. Click Finish. The report layout will appear:

6. Right-click over the New Report label in the header band and select Autosize from the speed menu. 7. Select the New Report label and set the caption to List of invoices by customer. 8. Press Ctrl + S and save the report as Simple Table. 9. Click the Preview tab. Notice the repetition of Customer names: this repetition inhibits readability. Let's make the report more readable by showing these values only once. Task 2 Select SuppressRepeatedValues. 1. Return to the design workspace. 2. Right-click over the Customer name DBText component in the detail band and select SuppressRepeatedValues from the speed menu.

Page 55: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

52

3. Click the Preview tab. The Customer names no longer repeat. Let's modify the report so that the Customer names reprint at the top of new pages. Task 3 Select ReprintOnSubsequent 1. Return to the design workspace. 2. Right-click over the Customer name DBText component and select ReprintOnSubsequent. 3. Click the Preview tab. Task 4 Create a Line Guide You may have noticed that the ReprintOnSubsequent option creates a lot of white space in this report, which makes it difficult to correlate customer names with their invoices as you read from left to right. We can add a line guide in order to improve this situation. 1. Return to the design environment. 2. Click on the line icon on the Standard component palette. 3. Click in the detail band to create the line component. 4. Right-click over the line and select ParentWidth from the speed menu. The line will stretch to match the width of the band. 5. Set the Top of the line to 0.15. 6. Press Ctrl + S to save your work. 7. Access the preview screen to see the result. Task 5 Add date parameters Instead of printing all invoices when running the report, it could be interesting that when running the report, only invoices between two dates selected by the user be printed. 1. Select the Data tab. 2. Click the Search criterias icon of the Invoices query. 3. Double-click the field Invoice Date then, in the section below from the Criteria section, select the Between operator then check the AutoSearch and Mandatory boxes. Click the OK button to save changes.

Page 56: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Tutorials

Reports Generator for LogiSales

53

3. Select the Design tab then save your work. Note : If you select the Preview tab, you are not asked to select date parameters. To be able to select date parameters, you must run the report from the reports explorer (in the reports generator) or from LogiSales. 4. Quit the design environment. From the reports explorer, run the report and you will be able to select date

parameters that will be used to filter data and print only invoices between the dates you selected.

Page 57: Reports generator for LogiSalesdownloads.orologic.com/logisales/Reports-Generator-Guide.pdf · Contents Reports Generator for LogiSales I Contents Getting started with the Reports

Other documentation

Reports Generator for LogiSales

54

Other documentation This guide is only an introduction to huge possibilities that the reports generator is offering. The best way to learn how to use it, is to create your own reports (or modify existing ones) and make your own tests. About RAP programming language, if you need more information about it, we recommend you to refer to the guide RAP - Reports generator programming language for LogiSales for a detailed documentation about the RAP programming language.