105
2005-2014 Scott Daughtry/Oleg Fomin Fomin Report Builder Users Manual

Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

  • Upload
    ngohanh

  • View
    229

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

2005-2014 Scott Daughtry/Oleg Fomin

Fomin Report BuilderUsers Manual

Page 2: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

2

2005-2014 Scott Daughtry/Oleg Fomin

Table of Contents

Foreword 4

Part I Contents 5

Part II Introduction

............................................................................................................................................. 71 Overview: Databases

............................................................................................................................................. 92 Dictionary

........................................................................................................................................................................... 10Dictionary: Functions (Others)

........................................................................................................................................................................... 11Dictionary: Functions (Date/Time)

........................................................................................................................................................................... 12Dictionary: Functions (Mathematical)

........................................................................................................................................................................... 13Dictionary: Functions (String)

........................................................................................................................................................................... 15Dictionary: Functions (Trigonometric)

........................................................................................................................................................................... 16Dictionary: Operators (Arithmetic)

........................................................................................................................................................................... 17Dictionary: Operators (Logical)

........................................................................................................................................................................... 19Dictionary: Processed Files

........................................................................................................................................................................... 19Dictionary: User Variables (Calculated Fields)

........................................................................................................................................................................... 20Dictionary: User Variables (Gather Totals)

........................................................................................................................................... 203 ReportFormatterWindow

........................................................................................................................................................................... 21MenuToolbar

........................................................................................................................................................................... 22ReportFormatterMenu

........................................................................................................................................................................... 22ReportPropertiesWindow

........................................................................................................................................... 244 Overview: Frames

........................................................................................................................................................................... 26BreakPropertiesWindow

........................................................................................................................................................................... 27Frame Properties Window

........................................................................................................................................................................... 28Band Properties Window

........................................................................................................................................................................... 29PropertyBoxWindow

........................................................................................................................................................................... 30UpdateTotalWindow

........................................................................................................................................... 315 Overview: Pictures

........................................................................................................................................................................... 33Picture Wizard

........................................................................................................................................................................... 34PictureDate

........................................................................................................................................................................... 35PictureNumeric

........................................................................................................................................................................... 35PicturePattern

........................................................................................................................................................................... 36PictureScientific

........................................................................................................................................................................... 36PictureString

........................................................................................................................................................................... 36PictureTime

........................................................................................................................................... 376 Overview: Bands

........................................................................................................................................... 377 Overview: Filters

........................................................................................................................................................................... 38Overview: Filters Part 2

........................................................................................................................................................................... 38Overview: Filters Part 3

........................................................................................................................................................................... 40Overview: Filters Part 4

........................................................................................................................................................................... 40Overview: Filters Part 5

......................................................................................................................................................................... 427Overview: Filters Part 6

Part III Basics You Need To Know (aka: The Tutorial)! 44

........................................................................................................................................... 441 Basics: Overview

........................................................................................................................................... 452 Basics: Step 1 (Report Manager Screen)

Contents

Page 3: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

3 Contents

2005-2014 Scott Daughtry/Oleg Fomin

........................................................................................................................................... 463 Basics: Step 2 (Create/Save A New Report File)

........................................................................................................................................... 484 Basics: Step 3 (Details & Frames)

........................................................................................................................................... 535 Basics: Step 4 (Modifying Frame Contents)

........................................................................................................................................... 546 Basics: Step 5 (Resizing The Detail Band)

........................................................................................................................................... 557 Basics: Step 6 (Adding A Page Header)

........................................................................................................................................... 588 Basics: Step 7 (Sorting Output)

........................................................................................................................................... 609 Basics: Step 8 (Functions & Pictures)

........................................................................................................................................... 6310 Basics: Step 9 (Combining Info Inside A Frame)

........................................................................................................................................... 6711 Basics: Step 10 (Multiple Sorting Levels)

........................................................................................................................................... 6912 Basics: Step 11 (Filters)

........................................................................................................................................... 7313 Basics: Step 12 (Filters Continued)

........................................................................................................................................... 7414 Basics: Step 13 (Adding Graphics)

........................................................................................................................................... 7515 Basics: Step 14 (Records Printed Counter)

........................................................................................................................................... 7616 Basics: Step 15 (Page Breaks)

........................................................................................................................................... 8117 Basics: Step 16 (Using Total Fields)

........................................................................................................................................... 8418 Basics: Step 17 (Using Group Total Fields)

........................................................................................................................................... 8719 Basics: Step 18 (Using Grand Total Fields)

Part IV "How To" Section

........................................................................................................................................... 921 Frame Tricks

........................................................................................................................................................................... 92How To: Modify Default Frame Settings

........................................................................................................................................................................... 92How To: Combine Text And Database Fields

............................................................................................................................................................................. 93How To: Conditionally Print Text

............................................................................................................................................................................. 94How To: Date Fields

............................................................................................................................................................................. 95How To: Prevent MEMO Field Truncation

............................................................................................................................................................................. 96How To: Change a Frame's Border/Fill Properties

............................................................................................................................................. 972 Header/Footer Tricks

............................................................................................................................................................................. 97How To: Add Date & Time To Report Page

............................................................................................................................................................................. 97How To: Add Page Number Counter

............................................................................................................................................................................. 98How To: Different Page Footers

............................................................................................................................................................................. 98How To: Different Page Headers

............................................................................................................................................. 993 Report Variations

............................................................................................................................................................................. 99How To: Labels

........................................................................................................................................................................... 100How To: Mail Merge Report

........................................................................................................................................... 1024 Sorting Tricks

........................................................................................................................................................................... 102How To: Descending Sort Sequence

........................................................................................................................................................................... 103How To: Multiple Sort Levels

........................................................................................................................................... 1035 User-Defined Variables

........................................................................................................................................................................... 103How To: Creating User Variables

........................................................................................................................................... 1056 Misc Topics

........................................................................................................................................................................... 105Help File Modification History

........................................................................................................................................................................... 105How To: Save A Report

Page 4: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Contents4

2005-2014 Scott Daughtry/Oleg Fomin

FORWARD

The Fomin Report Builder (FRB) is a royalty free reporting tool created by Oleg Fomin for Clarion computer language programmers to include within Windows software applications that they create. Oleg Fomin is the copyright holder for this reporting accessary.Scott Daughtry is a longtime FRB customer that created an enduser's Fomin Report Builder help file for his customers. He offered that help file to Oleg, free of charge, to include with his FRB product in appreciation for the capabilities that FRB offered his clients. That original help file has since swelled into the 100 page user's manual before you. Scott, in no way, helped develop FRB - Oleg takes 100% credit for FRB!

FRB is a fantastic reporting tool - it uses a very simple and understandable approach to building various types of reports that endusers can quickly understandand benefit from. The ability for customers to create/tweak their own reports is immensely useful to them - they don't need to wait months (or years) for an updated software version to include a new report - within an hour they can create it themselves to their own liking/reporting need.

If you are new to FRB, it is highly advisable to at least skim this user's manual (which contains the same content as the context-sensitive help file that was distributed with your Windows software application). At a minimum, read the 'Basics You Need To Know (aka: The Tutorial), which walks you through creating a very generic report and then tweak it into a much more capable/polished report. Once you have mastered the FRB basics, the remainder of this user's manual then becomes a reference that can be pulled off the shelf (or opened within your favorite *.PDF file viewer) to answer a quick question.

Happy (FRB) Reporting!

Page 5: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

1 Contents

Introduction Databases - what are they?DictionaryReport Formatter ScreenFramesPicturesReport BandsFilters

Basics You Need To Know (aka: The Tutorial)!OverviewStep 1: Reports Manager ScreenStep 2: Create/Save A New Report FileStep 3: Details & FramesStep 4: Modifying Frame ContentsStep 5: Resizing The Detail BandStep 6: Adding A Page HeaderStep 7: Sorting InformationStep 8: Functions & PicturesStep 9: Combining Info Into A FrameStep 10: Multiple SortingStep 11: FiltersStep 12: Filters Part TwoStep 13: Adding GraphicsStep 14: Adding A "Record's Printed" CounterStep 15: Page BreaksStep 16: Using Total FieldsStep 17: Using Group Total FieldsStep 18: Using Grand Total Fields

"How To" Section

Frame TricksChange default frame settings (border, fill color, etc)Combine text and database field information onto a report pageConditionally print information onto a report pageDate fields are printing five numbers - help!Prevent truncation of a MEMO field during printingHow To: Change a Frame's Border/Fill Properties

2005-2014 Scott Daughtry/Oleg Fomin

5Contents

Page 6: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

6

2005-2014 Scott Daughtry/Oleg Fomin

Header/Footer TricksAdd page number counter to the report pageAdd current date/time to the report pageDifferent header on page one than remaining report pagesSame footer text is printed until last report page is reached

Report VariationsLabelsMail merge form letters

Sorting TricksMultiple sort levelsSorting in descending sequence

User-Defined VariablesCreating/saving user defined variables

Help File History Changes to this help file

Contents

Page 7: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder7

2005-2014 Scott Daughtry/Oleg Fomin

2 Introduction

Databases - what are they?DictionaryReport Formatter ScreenFramesPicturesReport BandsFilters

2.1 Overview: Databases

PrefaceAs simple to use as Report Builder is (really!), there are some database fundamentalsthat you should be comfortable with in order to get the most out of this powerful tool.It is one thing to blindly type information into a computer, but empowering yourself asto how a database program really works will greatly enhance the reports that youcreate (to get that information back out in a manner that you need).

Database - DescriptionA database is nothing more than a collection of information that is somehow related. Aphone book is a great example of a database it is a collection of names/addresses/

phone number(s) for people and businesses in one physical area (usually a city, or anarea code). So, a database would be all the names, addresses and phone numberscontained within a phone book.

Database - ComponentsA database file is comprised of two new terms: database records and databasefields. Going back to the phone book once again, each person's name listed in thephone book would be a database record - it contains all the information for oneperson or business (their name, address, phone number(s), etc). The next nameshown in the phone book would be a separate database record, and so on.

A database record is made up of database fields. Using the phone book again as anexample, we would have separate database fields for the following information:

Individual/business nameStreet addressPhone number

A database could have only one field or it can have hundreds of fields - whatever ittakes to store all the information required to group together all of that related datainside of one database record entry.

Page 8: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Introduction 8

2005-2014 Scott Daughtry/Oleg Fomin

Database Index FileA phone book is usually sorted on the name of the individual/business, beginning withthe number 0, and ending with the letter Z. This type of sort is known as ASCENDINGsequence. If you started at the back of a phone book and worked your way to thefront (going from the letter Z to the number 0) this sort is called DESCENDINGsequence. Sorting a database requires the creation of a second type of file known asa database index, which can also be called a database key.

A database index is a file used by a database application to change how databaseinformation is displayed. Going back to the phone book example - every day thephone company creates phone numbers as people and businesses move into the city.Their name(s) are obviously not going to be in alphabetical order when the clerkcreates their new phone number entry - a person named Jones may be first, thenJoe-Bob's Barbeque is next, then Alpha-Beta Drugs may be third, and so on. Withouta way of sorting this information a printed phone directory would be a total mess -names would jump around the alphabet! The index file's job is to regain somestructure and order to the information being input into the database.

A database index file can be created using one database field, or several databasefields. These file(s) are normally opened when the database is opened, and as eachdatabase record is added/deleted an identical action is performed on the index file.For the phone book example, the desired sort would be the individual/business nameto be sorted in ascending alphabetical sequence. The field name used for the indexwould be the individual/business name. If your phone company were really customer-oriented they could perhaps create section(s) in their phone book that were sorted onthe street address - a new index created on that database field would be created/used to print this new section of the phone book.

Index file(s) are most commonly used in browse screens (a screen where all thedatabase records are displayed in columns, sorted alphabetically for easy location ofinformation) and reports.

Relational DatabasesIndex file(s) are also used to relate (aka: link) two or more database files together,which store different pieces of information that belong together. This type of databaseapplication is known as a relational database - two or more database file(s) relate toeach other by means of a common database field, and an index file that links the twoseparate files together.

An example of a relational database could be your bank account. When you firstjoined your bank you filled out a form with your name, address, work history, etc. Theclerk typed this information into the computer, handed you a bundle of blank checksand thanked you for joining their bank. All this "initial" information is stored in adatabase. As you start writing checks to pay for things a transaction is created for the

Page 9: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder9

2005-2014 Scott Daughtry/Oleg Fomin

date it was written, the dollar amount, the date the transaction was posted to youraccount, the check number, etc. These transactions are stored in a separatedatabase file.

At this point we have one database that stores customer information (name, address,etc) and another database that stores transactions for each check cashed. In bothdatabase files is a field that contains the account number, and an index file is createdfor each database on this field. The two database files are related to each other bythese index files created on the account number.

Not all database applications require a relational database setup - if the informationbeing tracked is simple (e.g. a grocery shopping list) then a single database file willcontain all the data being monitored. However, all business type database systemsrely on the relational database structure in order to keep track of a large quantity ofinformation. Relational databases greatly reduce the amount of information beingstored in database files, which keeps the size of the database file(s) small andincreases the speed of the program when retrieving data.

FinaleThis Report Builder can create reports from single database programs or relationaldatabase programs.

2.2 Dictionary

The Dictionary provides access to everything you can add to a report page (with theexception of information that you manually type into a frame). It's interface is split intofour basic categories:

Processed Files: Add information stored inside of the application's database files.Others: Access to standard report page counters and programmer-definedinformation is found here.Standard: Use built-in functions to manipulate text and numbers. This section is

Page 10: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Introduction 10

2005-2014 Scott Daughtry/Oleg Fomin

broken into six sub-sections: o Operators: Arithmetico Operators: Logicalo Functions: Stringo Functions: Mathematicalo Functions: Trigonometrico Functions: Date/TimeUser Variables: Access to variables that you (or the programmer) has created andsome report totaling variables is found here. This section has two sub-sections:o User Variables: Calculated Fieldso User Variables: Gather Totals

To select a Dictionary item you can either double left click the mouse on an item orclick the check mark icon at the top left of the window (after highlighting your desiredchoice).

2.2.1 Dictionary: Functions (Others)

This section of the Dictionary provides access to two types of items that can beadded to your report:

Functions: These are defined by the developer of this application - as shown abovethere are four functions that have been created, and made available, for the user toinput a date or select a product or vendor from another application database. Yourdatabase application might not have any functions defined here. Usually a functionwill either ask you for information or to select an item from a list.Built-in Variables: By default there will are four variables available for use (asshown above). The developer of this application can add other variables (i.e.predefined text) for you to use in a report that would show up here (example: avariable that combines the first, middle, and last names stored in a database into aformatted variable string).

To select a Dictionary entry you can double left click the mouse on the desired item orclick the check mark icon at the top left of the window (after highlighting your desired

Page 11: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder11

2005-2014 Scott Daughtry/Oleg Fomin

choice). The Dictionary window will automatically close after a Dictionary function orbuilt-in variable is selected.

2.2.2 Dictionary: Functions (Date/Time)

This section of the Dictionary provides access to built-in functions that manipulate dateor time data types:

TODAY() - Returns the operating system date as a standard date. The range ofpossible dates is from January 1, 1801 (standard date 4) to December 31, 2099(standard date 109,211). You can use a picture command to change theappearance of the return value. For example: cToday = format( TODAY(), @d01B )CLOCK() - Returns the current time based upon your computer's BIOS time.DATE() - Returns a standard date for a given month, day, and year. The month andday parameters do allow positive out-of-range values (zero or negative values areinvalid). A month value of 13 is interpreted as January of the next year. A day valueof 32 in January is interpreted as the first of February. Consequently, DATE(12,32,97), DATE(13,1,97), and DATE(1,1,98) all produce the same result. Thecentury for a two-digit year parameter is resolved using the default "Intellidate"logic, which assumes the date falls in the range of the next 20 or previous 80 yearsfrom the current operating system date. For example, assuming the current year is1998, if the year parameter is "15," the date returned is in the year 2015, and if theyear parameter is "60," the date returned is in 1960. For example, HireDate = DATE(Hir:Month,Hir:Day,Hir:Year); FirstOfMonth = DATE(MONTH(TODAY()),1,YEAR(TODAY())) would compute the first day of monthDAY() - Returns day of month. Computes the day of the month (1 to 31) for a givenstandard date. For example, OutDay = DAY(TODAY()) to get the day from today'sdate; DueDay = DAY(TODAY()+2) to calculate the return dayMONTH() - Returns the month of the year (1 to 12) for a given standard date. Forexample, PayMonth = MONTH(DueDate) to get the month from the dateYEAR() - Returns a four digit number for the year of a standard date (1801 to 9999)

Page 12: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Introduction 12

2005-2014 Scott Daughtry/Oleg Fomin

. For example, YEAR( today() ) AGE() - Returns a string containing the time elapsed between two dates. The agereturn string is in the following format: 1 to 60 days - 'nn DAYS'; 61 days to 24months - 'nn MOS'; 2 years to 999 years - 'nnn YRS'. For example, nAge = AGE( EMP:Birthday, TODAY()) would compare the database field EMP:Birthday againstthe computer date to return the persons age.

To select a Dictionary item you can either double left click the mouse on an item orclick the check mark icon at the top left of the window (after highlighting your desiredchoice).

2.2.3 Dictionary: Functions (Mathematical)

This section of the Dictionary provides access to built-in functions that manipulatenumbers.

ABS() - Returns an absolute value from an expression. The absolute value of anumber is always a zero. For example, C = ABS( A-B ). C would contain theabsolute value of the difference of B subtracted from AINRANGE() - Compares a numeric expression for an inclusive range of numbers.Returns a value of true if the scope is met, and false otherwise. For example,INRANGE( nVariableName, 1, 5 ) would check if the variable 'nVariableName' isbetween the values of 1-5, and return true if so; the starting number to scan is 1,and ending scanned number is 5.INT() - Returns an integer value from a numeric expression. For example, INT( 8.5 )would return a value of 8.LOGE() - Returns the natural algorithym. The natural logarithm of a value is thepower to which e must be raised to equal that value. The value of e used internallyfor these calculations is 2.71828182846. For example LOGE(2.71828182846)returns 1; LOGE(1) returns 0

Page 13: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder13

2005-2014 Scott Daughtry/Oleg Fomin

LOG10() -Returns base 10 logarithm. If the value of the expression is zero or less,the return value will be zero. The base 10 logarithm is undefined for values less thanor equal to zero. The LOG10 procedure returns the base 10 logarithm of a numericexpression. The base 10 logarithm of a value is the power to which 10 must beraised to equal that value. For example, LOG10(10) returns 1; LOG10(1) returns 0RANDOM() - Returns random integer.Returns a random integer between the lowand high values, inclusively. The low and high parameters may be any numericexpression, but only their integer portion is used for the inclusive range. Forexample, RANDOM( 22, 80 ) would return a random number between the numbers22 and 80.ROUND() - Returns a rounded number. For example, ROUND( 5163, 100 ) wouldreturn the rounded number of 5163+100 (which is 5200); ROUND(657.50,1) returns658; ROUND(51.63594,.01) returns 51.64SQRT() - Returns the square root of a number.

To select a Dictionary item you can either double left click the mouse on an item orclick the check mark icon at the top left of the window (after highlighting your desiredchoice).

2.2.4 Dictionary: Functions (String)

This portion of the Dictionary provides access to built-in functions that manipulate textstrings.

ALL() - Returns a text string that replicates itself a defined number of times. Forexample, ALL('A',5) would return the text string 'AAAAA'.CAPITALIZE() - Returns a text string with the first letter in uppercase and theremainder in lowercase.CHR() - Returns the ANSI character from an ASCII code. For example, CHR(122)would return 'z'

Page 14: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Introduction 14

2005-2014 Scott Daughtry/Oleg Fomin

CLIP() - Returns a string with the trailing spaces removed. Commonly used toproperly format names and addresses into a more aesthetic appearing text string;multiple database fields are combined together using the concatenation symbol (&)to form a formatted string.

For example, the database field ADR:City that contains the city name 'Tucson' couldbe combined with the ADR:State field that contains 'Az'. Because the ADR:Citydatabase field has 30 spaces allocated to it, and only 6 positions were used for'Tucson', the resulting output would resemble this on the report's printed page: Tucson Az

not exactly appealing! Using the CLIP() function and the concatenation symbol youcan use the CLIP() function like this:

CLIP( ADR:City ) & ', ' & CLIP( ADR:State ) to make it print as expected on the report's printed page: Tucson, Az

Note that there is a blank space after the comma to "push" the state over oneposition to avoid crowding the comma character.

DEFORMAT() - Returns a string that contains the unformatted characters of anumeric string. For example DEFORMAT('999-53-9954') returns 999539954FORMAT() - Returns a formatted string; knowledge of the PICTURE command ismandatory to make best use of this function. For example SSN = FORMAT( Emp:SSN,@P###-##-####P), which would properly format the database field EMP:SSNto a standard social security number.INLIST() - Returns the position of an item in a comma delimited list. For example,INLIST('D','A','B','C','D','E') returns a value of 4LEN() - Returns the length of a string. For example, LEN('Scott Daughtry') wouldreturn a value of 14. LOWER() - Returns the lowercase version of a string. For example LOWER('SCOTT Daughtry') would be returned as 'scott daughtry'.NUMERIC() - Returns a true or false. If a string contains only numbers a true isreturned. For example NUMERIC('123') would be true, and NUMERIC('1,23') wouldbe false.SUB() - Returns a portion of a string. You define where the starting and stoppingpositions are in the string. For example, SUB( 'Scott Daughtry', 1, 5 ) would extractpositions 1-5 of the string, returning 'Scott'. SUB( 'Scott Daughtry', 7, 3 ) extracts'Dau' - the starting position is 7, and the next 3 positions are extracted from thatstarting point. You can also work backwards on a string by assigning a negativestarting position. For example, SUB( 'Scott Daughtry', -1, 3 ) would return 'try'.UPPER() - Returns an uppercase version of a text string. For example, UPPER( 'scoTT') is returned as 'SCOTT'.VAL() - Returns the ASCII character numeric equivalent for an ANSI entry. Forexample, VAL('A') would return 65.

To select a Dictionary item you can either double left click the mouse on an item or

Page 15: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder15

2005-2014 Scott Daughtry/Oleg Fomin

click the check mark icon at the top left of the window (after highlighting your desiredchoice).

2.2.5 Dictionary: Functions (Trigonometric)

This section of the Dictionary provides access to built-in functions that manipulatenumbers in a scientific manner.

SIN() - Returns the trigonometric sine of an angle measured in radians. The sine isthe ratio of the length of the angle's opposite side divided by the length of thehypotenuse. For example, eturns the trigonometric cosine of an angle measured inradians. The cosine is the ratio of the length of the angle's adjacent side divided bythe length of the hypotenuse. For example, sineAngle = SIN( 45 * 3.142498712)COS() - Returns the trigonometric cosine of an angle measured in radians. Thecosine is the ratio of the length of the angle's adjacent side divided by the length ofthe hypotenuse. For example, cosineAngle = COS( 45 * 3.142498712)TAN() - Returns the trigonometric tangent of an angle measured in radians. Thetangent is the ratio of the angle's opposite side divided by its adjacent side. Forexample, TanAngle = TAN( 45 * 3.142498712)ACOS() - Returns the inverse cosine. The inverse of a cosine is the angle thatproduces the cosine. The return value is the angle in radians. p is a constant whichrepresents the ratio of the circumference and radius of a circle. There are 2pradians (or 360 degrees) in a circle. For example, acos = ACOS( 45 *3.142498712)ASIN() - Returns the inverse sine. The inverse of a sine is the angle that producesthe sine. The return value is the angle in radians. p is a constant which representsthe ratio of the circumference and radius of a circle. There are 2p radians (or 360degrees) in a circle. For example, asine = ASIN( 45 * 3.142498712)ATAN() - Returns the inverse tangent. The inverse of a tangent is the angle thatproduces the tangent. The return value is the angle in radians. p is a constant whichrepresents the ratio of the circumference and radius of a circle. There are 2p

Page 16: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Introduction 16

2005-2014 Scott Daughtry/Oleg Fomin

radians (or 360 degrees) in a circle. For example, TanAngle = ATAN( 45 *3.142498712)

To select a Dictionary item you can either double left click the mouse on an item orclick the check mark icon at the top left of the window (after highlighting your desiredchoice).

2.2.6 Dictionary: Operators (Arithmetic)

This section of the Dictionary provides access to built-in functions that manipulatenumbers/arrays/strings, and/or combine multiple values to add to your report.

Addition - Add two variables together to produce a value. The addition sign (+) isused.Subtraction - Subtraction one variable from another to produce a value. The minussign (-) is used.Multiplication - Multiply one variable against another to produce a value. Theasterisk symbol (*) is used.Division - Divide one variable into another to produce a value. The slash characteris used (/).Exponentiation - Raises one variable to the value of a second variable. The caratsymbol ( )̂ is used.Modulus Division - Returns the remainder of one variable divided by anothervariable. The percentage character (%) is used.Concatenation - Most commonly used to combine multiple strings together into onestring, or multiple database fields and/or text into one string. You don't need toconvert numeric values into a string before combining them with a text field - this isautomatically taken care of.

To select a Dictionary item you can either double left click the mouse on an item or

Page 17: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder17

2005-2014 Scott Daughtry/Oleg Fomin

click the check mark icon at the top left of the window (after highlighting your desiredchoice).

2.2.7 Dictionary: Operators (Logical)

This section of the Dictionary provides access to built-in functions that conditionallymanipulate information.

Choose() - This function is used to perform a logical evaluation and return a valuebased upon the result. When a condition is evaluated to true the first return value isreturned. If a condition is evaluated to false the second return value is returned. Forexample, CHOOSE( 1 > 2, 'A', 'B') would return 'B'; CHOOSE( INV:Sex = 'M','Male', 'Female') would return the text string 'Male' if the database field INV:Sexcontained a value of 'M'.And - A boolean operator; used to combine 2 or more logical statements together.Used when you need/want multiple logical expressions to equal TRUE in order forsomething to occur. For example: INV:Sex = 'M' AND INV:State - 'Az' would requirethe database field INV:Sex to equal 'M' AND the INV:State database field to equal'Az' for a value of true to be returned. If either database field did not contain thesevalues then a return value of false is returned. The expressions are evaluated fromleft to right; if a value of false is returned then the subsequent expressions areskipped over, since a value of false has already been reached. If the INV:Sexdatabase field did not contain a value of 'M' then the INV:State field wouldn't beprocessed at all - a value of false has already been returned. If the INV:Sexdatabase field contained an 'M', but the INV:State database field containedsomething other than 'Az', then a value of false is returned, since both items mustreturn a value of true. You can a very long expression with the AND operator. Forexample: INV:Sex = 'M' AND INV:State = 'Az' AND INV:Birthdate > '01/01/60'.Or - A boolean operator; used to combine 2 or more logical statements together.Used when a condition can evaluate to a value of false but processing is still

Page 18: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Introduction 18

2005-2014 Scott Daughtry/Oleg Fomin

desired. For example: INV:Sex = 'M' AND Inv:State = 'Az' OR INV:State = 'Ak'would evaluate INV:Sex; if it equals a 'M' the INV:State field is evaluated. If itcontained 'Az' an overall return value of true is reached. If it didn't contain 'Az' it isthen checked for a value of 'Ak'. If it did, a an overall value of true is reached.Not - A boolean operator. Used in conjunction with the Greater Than, Equal To orLess Than operators. For example, INV:State NOT = 'Az'; INV:Age NOT < 45; INV:Income NOT > 30000.Xor - A boolean operator. Used when an expression can evaluate to true on oneside of the equation, but not both. For example: A XOR B; true is returned if A istrue OR B is true, but not both. Greater Than - The symbol (>) is used for this operator. When you want the leftside of an equation to return a value of true. For example, INV:Quantity > 5 wouldreturn a true if the INV:Quantity database field was greater than 5.Lesser Than - The symbol (<) is used for this operator. When you want the rightside of an equation to return a value of true. For example, INV:Age < 15 wouldreturn true if the database field INV:Age is less than 15.Equal To - The symbol (=) is used for this operator. When you want an exact matchin an equation for a value of true to be returned. For example, INV:State = 'Az'would return a value of true if the database field INV:State contained 'Az'Not Equal To - The symbol (<>) is used for this operator. When you want a valueof true returned when a variable does NOT contain a particular value. For example,INV:State <> 'Az' would return a value of true when it did not contain 'Az'Greater Than Or Equal To - The symbol (>=) is used for this operator. When youwant a value to be equal to or greater than something. For example: INV:Sold >=325 would return a value of true if the INV:Sold database field was equal to orgreater than 325.Less Than Or Equal To - The symbol (<=) is used for this operator. When youwant a value to be equal to or less than something. For example, INV:Sold <= 325would return a value of true if the INV:Sold database field was equal to or less than325.

Note: Standard operators can be used to build complicated expressions when youwant to "drill down" to highly specific data (which is normally the case). Make surethat the most important criteria is placed first that would (in theory) eliminate themajority of data when the database is scanned. This will speed up the remainder ofthe operational string when they are executed. Some expression examples:

EMP:Sex = 'M' AND LOC:State = 'Az' OR Loc:State = 'Nv' AND EMP:Haircolor ='Brown'

STO:Location = 'Iowa' AND PAR:Vendor = 'Hasbro' AND PAR:Onhand <= 100

SAL:Total = INV:Itemprice * SAL:Quantity * SAL:Salestax

To select a Dictionary item you can either double left click the mouse on an item or

Page 19: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder19

2005-2014 Scott Daughtry/Oleg Fomin

click the check mark icon at the top left of the window (after highlighting your desiredchoice).

2.2.8 Dictionary: Processed Files

This section of the Dictionary provides access to database information to add to yourreport. Some database applications may have more than one database file thatcontains information; the screen capture above shows an example of three databasefiles (Inventory History, Vendors, Products) that can be expanded to access theirrespective database fields.

To select a Dictionary item you can either double left click the mouse on an item orclick the check mark icon at the top left of the window (after highlighting your desiredchoice).

2.2.9 Dictionary: User Variables (Calculated Fields)

This section of the Dictionary provides access to functions that the programmer of thisapplication has added for you to add to your report. This section of the dictionarymight not contain any items that you can select.

To select a Dictionary item you can either double left click the mouse on an item orclick the check mark icon at the top left of the window (after highlighting your desiredchoice).

Page 20: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Introduction 20

2005-2014 Scott Daughtry/Oleg Fomin

2.2.10 Dictionary: User Variables (Gather Totals)

This section of the Dictionary provides access to functions that the programmer of thisapplication has added for you to add to your report. This section of the Dictionarymight not contain any items that you can select.

To select a Dictionary item you can either double left click the mouse on an item orclick the check mark icon at the top left of the window (after highlighting your desiredchoice).

2.3 ReportFormatterWindow

Shown above is the Report Formatter screen - think of it as a blank piece of paperthat will contain all of the information (text, database information, and/or pictures) thatyou want sent to a printer. This screen is used to create a new report or modify anexisting report. The screen is configured in three different sections; from top to bottomthey are:

Pulldown menu: A standard Windows-style menuToolbar: A standard Windows-style toolbar displayed under the pulldown menuWorkarea: Blank space where you add information to print onto a report page

Page 21: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder21

2005-2014 Scott Daughtry/Oleg Fomin

By default the Report Formatter screen is blank (as shown above). It is YOUR job toadd the pieces of the report as you want them to be printed.

A key point to remember is this: a report CANNOT change information containedinside the application's database file(s)! This means that you can create as manyreports as you want and change them as many times as needed without fear ofaltering data stored in the database file(s).

The Report Formatter screen used a standard Windows layout - a pulldown menu isdisplayed at the top of the screen, with a toolbar directly below with clickable iconsfor commonly used tasks. The mouse is used to add/move object(s) to the report; theright mouse button is used to modify an object that you place onto the ReportFormatter screen.

Important to know/remember:

A report needs at least one Detail Band and one Frameadded to the above screen to generate a report.

2.3.1 MenuToolbar

The Menu Toolbar provides quick access to commonly used features inside the Report Formatter window. The screen capture above is labeled A-W (note: the realReport Formatter window does NOT display these letters, and is used only to make iteasy to describe each button's function):

A. Save changes and exit the Report Formatter windowB. Lose changes and exit the Report Formatter windowC.Create a new report fileD.Open an existing report fileE. Save the open report fileF. Cut the currently selected frameG.Copy the currently selected frameH. Paste from the Windows clipboardI. Open the Font Selection pop up boxJ. Left align the text in the currently selected frameK. Center align the text in the currently selected frameL. Right align the text in the currently selected frameM.Horizontally spread the text in the currently selected frameN. Top align the text in the currently selected frameO.Center align the text in the currently selected frameP. Bottom align the text in the currently selected frameQ.Not usedR.Add/remove the left border line from the currently selected frame

Page 22: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Introduction 22

2005-2014 Scott Daughtry/Oleg Fomin

S. Add/remove the right border line from the currently selected frameT. Add/remove the top border line from the currently selected frameU. Add/remove the bottom border line from the currently selected frameV. Open the Fill Color pop up boxW.Open the Border Color pop up box

2.3.2 ReportFormatterMenu

The main menu of the Report Formatter resembles most other Windows applications -the underlined letter is used with the ALT key to activate that menu choice. You canalso use the mouse (and clicking the left mouse button) to select and activate a menuchoice.

The above screen capture shows all of the Report Formatter menu options on onescreen.

2.3.3 ReportPropertiesWindow

The Report Properties popup window "General" tab provides options to:o Define the Report Title (that is displayed in the Report Manager screen). Each

report you create SHOULD have a Report Title added BY YOU to make it easy tolocate the report in the Report Manager. The Report Title should be brief anddescribe the purpose of the report using plain language.

o Define a Record Filter to limit the output to only database information that meetsspecific criteria.

Page 23: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder23

2005-2014 Scott Daughtry/Oleg Fomin

The Report Properties pop up window "Page Layout" tab provides options to:o Define the page size of the report page by using a drop list of choices:

Letter 8 1/2 x 11 inLetter Small 8 1/2 x 11 inTabloid 11 x 17 inLedger 17 x 11 inLegal 8 1/2 x 14 inStatement 5 1/2 x 8 1/2 inExecutive 7 1/4 x 10 1/2 inA3 298 x 420 mmA4 210 x 297 mmA4 Small 210 x 297 mmA5 148 x 210 mmB4 250 x 354B5 182 x 257 mmFolio 8 1/2 x 13 inQuarto 215 x 275 mm10x14 in11x17 inNote 8 1/2 x 11 inEnvelope #9 3 7/8 x 8 7/8Envelope #10 4 1/8 x 9 1/2Envelope #11 4 1/2 x 10 3/8Envelope #12 4 1/2 x 11Envelope #14 5 x 11 1/2C size sheet 17 x 22 inD size sheet 22 x 34 inE size sheet 34 x 44 inEnvelope C5 162 x 229 mmEnvelope C3 324 x 458 mmEnvelope C4 229 x 324 mmEnvelope C6 114 x 162 mmEnvelope C65 114 x 229 mmEnvelope B4 250 x 353 mmEnvelope B5 176 x 250 mmEnvelope B6 176 x 125 mm

Page 24: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Introduction 24

2005-2014 Scott Daughtry/Oleg Fomin

Envelope 110 x 230 mmEnvelope Monarch 3 7/8 x 7 1/2 in6 3/4 Envelope 3 5/8 x 6 1/2 inUS Std Fanfold 14 7/8 x 11 inGerman Std Fanfold 8 1/2 x 12 inGerman Legal Fanfold 8 1/2 x 13 inCustom size

o Spinboxes to manually define the report page width and height.o Page orientation (default is Portrait mode); the check box changes the report

output to Landscapeo Page margins (left, right, top, bottom)

2.4 Overview: Frames

PrefaceFrames are used in the Report Builder to print something on the report page, toinclude:

A database field used in the applicationA text string (such as a report header, column header, etc)A calculated field that is generated at run timeA page counter The current date or timeTotal fields (such as total expenditure, dollar total, etc)

ANYTHING that you want printed on a report page MUST be added via a Frame. AFrame is also how you gain access to the Dictionary screen, which contains yourdatabase file information and internal functions that enable you to manipulateinformation to achieve your reporting goal for highly formatted (and attractive) printedoutput. A Frame requires at least one report Band to to exist on a report page beforeit can be added to the report page. An unlimited number of Frames can be added to areport page (space permitting).

Adding A Frame To A Report PageFirst ensure at least one report band (Detail Band, Group Footer or Group Header)Left click inside the report band that you want something to be printed; this willselect the report band to receive the empty FrameRight click the mouse to display a pop up menu; from this menu select 'New Frame'

A new empty Frame is now displayed inside the report band where you had previouslyleft clicked the mouse:

Page 25: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder25

2005-2014 Scott Daughtry/Oleg Fomin

Moving/Resizing A FrameResize: When a Frame is selected red blocks outline the Frame to indicate that youcan stretch any of the corners to meet your printing size requirement.

Move (Mouse): You can drag the empty Frame to a different location inside thereport band by left clicking inside the empty Frame, then drag the empty Frame to thedesired location. When dragging the empty Frame the border will turn completely red- release the left mouse button after moving the Frame to set it's final position.

Move (Keyboard): Hold down the CTRL key and use the arrow keys on the keyboardto move the Frame in the desired direction (left/right/up/down).

Frame ContentsAs described above, a Frame can contain many things (or combination of things). The Dictionary is the primary method of adding an object, via the Frame, onto a reportpage. You can also use the keyboard to manually enter information into a Frame(such as a report title or column title).

If you use the Dictionary to add information to a Frame (ex: database field), you willnotice that an equal sign (=) is automatically placed in front of the database field'sname inside of the frame:

If you remove the equal sign the Report Builder will generate a runtime error when thereport is printed. This is because the equal sign is MANDATORY for adding a database field or using internal functions (to format information in a highly specificmanner). Adding information from the Dictionary will automatically add the equal signfor you; only one equal sign is required, and it MUST be positioned as the first entry inthe above screen.

If you are adding text to a report (ex: a column title) via a Frame the equal sign isNOT required in the first position of the frame's contents:

Page 26: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Introduction 26

2005-2014 Scott Daughtry/Oleg Fomin

Frame BorderBy default a newly added Frame has a box drawn around it:

This makes the Frame easy to find (and move around) inside of that report band;however, you can remove any (or all) of the four sides of the box by clicking theappropriate toolbar icon to toggle that box side on or off (the first four toolbar icons):

You can fill the Frame with any color that you desire to create colorful reports by firstselecting the Frame, and then click on icon #5 (displayed above)- a pop up colorselection window will appear to select the color for that Frame.

The box line color can be changed by clicking icon #6 - a pop up color selectionwindow will appear to select the color to apply to the selected Frame.

RecapFrames are the ONLY WAY to add the following items to a report page:

Report header page titleReport footer page countImage files (ex: your company logo on the top of the report page)Database file informationText information (ex: column header)

Frames can be placed anywhere on a report page. Frames require a report Band tobe placed inside of. Frames can be resized as large or small as needed. By default aFrame has a border drawn around it that can be removed (one side at a time). AFrame can be filled with any color.

2.4.1 BreakPropertiesWindow

The screen capture above shows the "Sort Expression" dialogue box (also known asthe Break Properties" dialogue box). This pop up window is accessed by double left-clicking on a sorting band; it's purpose is to define what database field will be used to

Page 27: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder27

2005-2014 Scott Daughtry/Oleg Fomin

sort the content of that report band.

To add/edit the database field that will be used in the sorting band click the bluebutton next to the entry field - this will display the Dictionary, which is the easiestmethod to select the desired database field to sort upon.

2.4.2 Frame Properties Window

The above screen captures show the "Frame Properties" window which is used to:

Tab #1 (General)Define the contents of a frame (e.g. database field, calculated field, static text)Optionally perform a "mail merge" with the chosen database fieldLoad an image from the hard drive to print onto the report pageLoad an image stored inside the database (inside a Memo or Blob database field)Define the picture for the frame contentsEnable the frame contents to print as multiline textAutomatically resize (shrink) the bottom of the frame to close up blank gaps on theprinted pageDefine the horizontal and vertical alignment of the frame contentsDefine if a border should be printed around the frame, and if so, which sides andwhat colorDefine the font type/size/format for the frame contentsDefine the width of the frameOptionally fill the frame with a color

Tab #2 (Position)Fine tune the top left corner position of the frameFine tune the exact width and height of the frameFine tune the margins inside the frameFine tune the number of lines of text inside the frame

The above screens is accessed by double left clicking the mouse button on a frame.

NOTE: The majority of these functions are duplicated inside the Report Formatter's

Page 28: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Introduction 28

2005-2014 Scott Daughtry/Oleg Fomin

toolbar.

2.4.3 Band Properties Window

The above screen captures show the "Band Properties" window that is used to definehow a BAND will:

Optionally be printed (by entering a value in the 'Print section, if expressionevaluates TRUE' entry field)Optionally print a MEMO field after the current BAND is printedOptionally "mail merge" a database field into text that you define (e.g. A form letterto customers)Resize the BAND for it's top position on a report, or it's size and/or widthHow to handle Page Overflow (i.e. when the report page is full, how the informationwill be printed)

An explanation of each of the primary options in this dialogue window:

Print Selection, if expression evaluates TRUE: You can elect to only printinformation contained in the new report band when a specific condition evaluates toTRUE; for example, you may want to make information stand out for customers whoare late on a payment; if you have a database field that tracks if their payment is

Page 29: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder29

2005-2014 Scott Daughtry/Oleg Fomin

late you could check for this; if late you can create a fancy text warning to drawattention to the account. Naturally you would use the Dictionary to help define thedatabase condition that evaluates to TRUE for this action to occur.Explicit Page Overflow Before Band Printing: Print the Group Footer band whenthe selected database field data changes at the beginning of the next group ofinformation (i.e. ALWAYS print this band when the selected field data changes atthe BEGINNING of the next group of information). For example, if you have 10database records and the first 3 equal "AZ", when the state database field changesvalue to "CA" the Group Footer is printed on the next page before database recordscontaining State=CA are printed to the page.Explicit Page Overflow After Band Printing: Print the Group Footer band whenthe selected database field data changes at the end of that group of information(i.e. ALWAYS print this band when the selected field data changes at the END ofthat group of information). The next page that prints will contain new database fieldinformation.Print This Band At The Same Page With Prior: This attribute specifies that theDetail, or Group Header/Group Footer structure (contained within a Sorting Band) isALWAYS printed on the same page as the band immediately preceding it in theReport Painter screen. This ensures that the structure is never printed on a page byitself, thus eliminating "orphan" bands. An "orphan" band in this case is defined as aGroup Footer, or last detail item in a related group of items, that are printed on thefollowing page separated from the rest of it's related items.Print This Band At The Same Page With Next: This attribute specifies that theDetail, or Group Header/Group Footer structure (contained within a Sorting Band) isALWAYS printed on the same page as the band immediately following it in theReport Painter screen. This ensures that the structure is never printed on a page byitself, thus eliminating "orphan" bands. An "orphan" band in this case is defined as aGroup Header, or last detail item in a related group of items, that are printed on theprevious page separated from the rest of it's related items.Print After This Band The Text Field: This attribute is used whenever you wish toprint a database field that is a large MEMO type database field, which arecommonly used to contain large amounts of text (such as notes). A normal Framewill be unable to print a memo database field within it's defined space; by checkingthis feature the selected database field will be printed after the report band in it'sentirety without truncation. If there is insufficient space to print all of the informationthe remainder of the field information will continue printing on the next page.

For the vast majority of reports that you build the default values will work just fine. Forexamples on how to use the features to their fullest potential please reference the"How To" section of this help file for useful printing tips & tricks!

2.4.4 PropertyBoxWindow

Page 30: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Introduction 30

2005-2014 Scott Daughtry/Oleg Fomin

The Property Box Window is used to add/edit an object on the report page inside of aFrame. By default it is empty (as shown above). You can manually type informationinto the Contents entry field (colored light blue), or click the button just to the right ofthe entry field to use the Dictionary to help add an object to the report.

To modify how the report object is displayed on the report page click the Picture tab:

This tab of the Property Box Window contains an entry field (colored light blue) thatyou can manually enter a picture for the selected object, or click the button just to theright of the entry field to use the Picture Wizard to help create the appropriate picture.If you leave the Picture entry field empty the object will print on the report page for theentire length that the object is defined - for example, if you selected a database fieldthat is 30 characters in length, then it will occupy 30 positions on the report page. Ifyou enter a picture that limits that database field's length (ex: @S10), then only thatnumber of characters (ex: 10) in the string will print inside of that Frame.

2.4.5 UpdateTotalWindow

The above screen capture shows the dialogue box used to create a variable (storiedin the computer's memory) that can temporarily store numeric information (e.g. dollarsales; inventory count) as the report is being generated. This screen is accessed fromthe Dictionary.

Each of the entry fields (as shown above) require information from you to define theinformation that is gathered as the report is being generated:

Assign Name: This entry field is blank by default; the above screen capture showsTOT2:Quantity as the fictional name for this variable. It is a good idea to create aname that resembles the content of the variable, and use a standardized namingconvention. It is also a good idea to use the standardized naming convention ofPREFIX:NAME when defining variables; the prefix can be 1-4 characters in length;the colon character (:) is mandatory, and then a name that can be 1-12 charactersin length. By using the same prefix name (e.g. TOT2) you will be able to more easily

Page 31: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder31

2005-2014 Scott Daughtry/Oleg Fomin

find and understand the variable's purpose in the Report Builder.Field/Expression To Total: Click the button to the right of the entry field to displaythe Dictionary to help select the database field(s) that you want to be addedtogether as the report is being generated.Picture: Click the button to the right of the entry field to display the Picture Wizardto define how this variable will be printed onto the report page.Total Type: The drop list has the following options available to define what action totake on the "field/expression to total" database field that you selected:SumAverageCountMinimumMaximumEvaluateEvaluate On: The drop list has the following options available to define when to dosomething against the "field/expression to total" database field that you selected:o At each record retrieveo At the end of the groupo At the end of the reporto At the end of every page

2.5 Overview: Pictures

A Picture is a way of converting information from it's original format to a differentformat. Pictures can be used for database fields, built-in variables, user-definedvariables, and text that you enter onto a report page inside of a Frame. A Picture isdefined/accessed for a report page object using the Property Box dialog box and thenclicking the Picture tab:

You can manually type in a Picture value or use the Picture Wizard (the blue icon nextto the light-colored blue entry field). You can change a Picture at any time - rememberthat a Picture only changes how data is displayed on a report page - it won't change/delete any database information. If you decide you don't like the Picture for a frameyou can change it to something else and then use the print preview screen to see theresult.

Here are some sample pictures that are commonly used. Each Picture has sampledata, and the resultant output listed by category:

Numeric

Page 32: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Introduction 32

2005-2014 Scott Daughtry/Oleg Fomin

@N9 4,550,000 Nine digits, group with commas (default)@N_9B 4550000 Nine digits, no grouping, leading blanks if zero@N09 004550000 Nine digits, leading zero@N*9 ***45,000 Nine digits, asterisk fill, group with commas@N9_ 4 550 000 Nine digits, group with spaces@N9. 4.550.000 Nine digits, group with [email protected] 4,550.75 Two decimal places, period decimal

separator @N_9.2B 4550.75 Two decimal places, period decimal

separator, no grouping, blank if zero@N_9'2 4550,75 Two decimal places, comma decimal separator@N9.'2 4.550,75 Comma decimal separator, group with periods@N9_'2 4 550,75 Comma decimal separator, group with spaces,@N-9.2B -2,347.25 Leading minus sign, blank if [email protected] 2,347.25- Trailing minus sign@N(10.2) (2,347.25) Enclosed in parens when negative@N$9.2B $2,347.25 Leading dollar sign, blank if zero@N$10.2- $2,347.25- Leading dollar sign, trailing minus when negative@N$(11.2) $(2,347.25) Leading dollar sign, in parens when negative@N12_'2~ F~ 1 5430,50 F France@N~L. ~12' L. 1.430.050 Italy@N~£~12.2 £1,240.50 United Kingdom@N~kr~12'2 kr1.430,50 Norway@N~DM~12'2 DM1.430,50 Germany@N12_'2~ mk~ 1 430,50 mk Finland@N12'2~ kr~ 1.430,50 kr Sweden

[email protected] 1,967,865 [email protected] 1,967,865 [email protected] 1,967,865 [email protected] .000000032 3.2000e-008@E12_.4 1,967,865 1 967.865e+003

Date@D1 mm/dd/yy 10/31/59@D1>40 mm/dd/yy 10/31/59@D01 mm/dd/y 59/10/31

Page 33: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder33

2005-2014 Scott Daughtry/Oleg Fomin

@D10 yyyy/mm/dd 1959/10/31@D11 yymmdd 591031@D12 yyyymmdd 19591031@D13 mm/yy 10/59@D14 mm/yyyy 10/1959@D15 yy/mm 59/10@D16 yyyy/mm 1959/10@D17 Windows Control Panel setting for Short Date@D18 Windows Control Panel setting for Long Date

Time@T1 hh:mm 17:30@T2 hhmm 1730@T3 hh:mmXM 5:30PM@T03 hh:mmXM 05:30PM@T4 hh:mm:ss 17:30:00@T5 hhmmss 173000@T6 hh:mm:ssXM 5:30:00PM@T7 Windows Control Panel setting for Short Time@T8 Windows Control Panel setting for Long Time

Pattern@P###-##-####P 215846377 215-84-6377@P<#/##/##P 103159 10/31/59@P(###)###-####P 3057854555 (305)785-4555@P###/###-####P 7854555 000/785-4555@p<#:##PMp 530 5:30PM@P<#' <#"P 506 5' 6"@P<#lb. <#oz.P 902 9lb. 2oz.@P4##A-#P 112 411A-2@PA##.C#P 312.45 A31.C2

2.5.1 Picture Wizard

The Picture Wizard is defined/accessed for a report page object from the PropertyBox window, and resembles this:

After clicking the blue icon (to the right of the light blue colored entry field) a popupwizard is displayed:

Page 34: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Introduction 34

2005-2014 Scott Daughtry/Oleg Fomin

As shown above, radio buttons are available for all possible data types. Afterselecting the appropriate data type (by clicking on a radio button), click the NEXTbutton to continue the wizard process. After you have stepped your way through thewizard you can click the OK button to accept the newly formatted picture, or click theCANCEL button to lose the changes.

Click on a hyperlink below to see how the wizard adapts itself based upon the radiobutton that was selected:

Numeric Picture WizardScientific Picture WizardDate Picture WizardTime Picture WizardPattern Picture WizardString Picture Wizard

2.5.2 PictureDate

Shown below are screen captures of the Picture Wizard for the Date radio button;after making your selection click the NEXT button until there are no more screens leftin the wizard:

Page 35: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder35

2005-2014 Scott Daughtry/Oleg Fomin

2.5.3 PictureNumeric

Shown below are screen captures of the Picture Wizard for the Numeric radio button;after making your selection click the NEXT button until there are no more screens leftin the wizard:

2.5.4 PicturePattern

Shown below are screen captures of the Picture Wizard for the Pattern radio button;after making your selection click the NEXT button until there are no more screens leftin the wizard:

Page 36: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Introduction 36

2005-2014 Scott Daughtry/Oleg Fomin

2.5.5 PictureScientific

Shown below are screen captures of the Picture Wizard for the Scientific radio button;after making your selection click the NEXT button until there are no more screens leftin the wizard:

2.5.6 PictureString

Shown below are screen captures of the Picture Wizard for the String radio button;after making your selection click the NEXT button until there are no more screens leftin the wizard:

2.5.7 PictureTime

Shown below are screen captures of the Picture Wizard for the Time radio button;after making your selection click the NEXT button until there are no more screens leftin the wizard:

Page 37: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder37

2005-2014 Scott Daughtry/Oleg Fomin

2.6 Overview: Bands

Bands are used by the Report Builder to generate information contained inside one ormore database files of this computer application to a report page. There are eightdifferent types of Bands available to you when creating a report:

Page Header Band - Your report can contain only one page header. This reportband is printed at the top of the output on each generated report page.Report Header Band - Your report can contain only one report header. This reportband is printed at the top of the output on only the FIRST generated report page.Sorting Band - Your can have multiple Sorting Band details on a report. A sortingband may contain it's own header, footer and/or additional breaks. A sorting band isthe mechanism for SORTING a report; it is also used to perform page breaks whena value changes within a database file.Group Header Band - This band is printed at the top of each page when the groupbreak value has changed.Detail Band - You can have multiple DETAIL bands in a report. A detail band isresponsible for retrieving database information required for the report and printingthe data onto the report. . Group Footer Band - This band is printed at the bottom of each page when thegroup break value has changed.Report Footer Band - This band is printed at the bottom of the last generatedpage in the report.Page Footer Band - This band is printed at the bottom of each page in thegenerated report.

Your report MUST have at least one Detail Band or Group Band (which can be eithera Group Header or Group Footer) to print a useful report (i.e. one that containsdatabase information). By default there are NO band's added to a new report - it isup to you to decide what band(s) are required to create the desired reporting output.

2.7 Overview: Filters

Rarely do reports contain every database record's content; a report 'Filter' is how areport's output is reduced to only what is needed (e.g. instead of printing a list ofevery customer, the report will use a filter to only print customers who purchasedsomething in the past 12 months).

Page 38: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Introduction 38

2005-2014 Scott Daughtry/Oleg Fomin

Understanding database filters is crucial to printing useful reports that print only theinformation that is required for your needs. Once you learn some basics of databasefilters you will find them extremely useful in building your reports - they are very easyto use!

Some database programs may provide a "Query Wizard" that enables you to easilycreate / use / save database filters. If this is the case with this database applicationthen please consult it's documentation on how to use this Query Wizard feature; notethat you don't have to use the Query Wizard and can instead use a Report Builderfilter if so desired.

This help file breaks down database filters into smaller pieces to help you inunderstand what a filter is and how to create increasingly complex filters. It isrecommended that you at least glance over each topic; if you get stuck you canalways reference these help topics when creating your own database filter:

Filters Tutorial Part 1 - What is a database filter?Filters Tutorial Part 2 - What are the components of a database filter?Filters Tutorial Part 3 - Simple filters to get startedFilters Tutorial Part 4 - Stopping common filter problems before they startFilters Tutorial Part 5 - Combining multiple conditions into one filter

2.7.1 Overview: Filters Part 2

A database filter enables you to extract information from database file(s) that youwant to print on the report's page. The ability to use filters has always been one of thestrongest features of database applications (dBase, Foxpro, Access, etc), as filtersallow you to limit the output of a huge database into a very specific report. While theycan be a little confusing at first, if you understand some basic concepts of how tocreate a database filter you will find them to extremely helpful in creating usefulreports (and have them mastered in no time at all)!

Important Note: Filters do not change any information contained in database file(s);they don't copy information to another file either. A filter simply "hides" information thatyou don't want to see, which explains why they are called "Filters". No matter howmany times you create or use a database filter, you are guaranteed that they willNEVER harm your database information. Hopefully this will give you the confidence totry creating filters for various purposes.

2.7.2 Overview: Filters Part 3

A filter relies on 3 pieces of information to work:

Page 39: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder39

2005-2014 Scott Daughtry/Oleg Fomin

1. A field name from the database2. An operator symbol3. The text string or number to compare the selected database field against

Let's examine each of these 3 pieces a little more closely:

The database field name is defined in the the database structure. If you haven't readup on databases and what they are made of click HERE for an explanation. TheReport Builder doesn't assume that you haven't memorized the structure of eachdatabase file in your application; the Dictionary window allows you to choose thedatabase field from a list of every database field that the application uses.

For this small example, let's assume that you have a database field named "City"; it is2 character positions long and contains only text abbreviations ("az", "ca", "tx", etc) ofthe 50 states in the United States.

An operator symbol tells the Report Builder what you want to do with the databasefield that you've chosen from the dictionary. Again, the Dictionary helps you bydisplaying a list of every operator that are available for building filters. You select an operator symbol based upon the type of information contained in the database file.Some operators are used only on text (such as "="); some are only used on numericinformation (such as ">", "<"). For this example we have chosen a text field, so we willuse the equal sign for the operator symbol.

The last piece of the filter is one that you provide; only you know what information youwant to extract from the database! For this example let's assume we want to print areport of only those customers living in Texas; the abbreviation for Texas is "tx", sowe will use "tx" as the last piece of the filter. So, our first filter example looks like this:

INV:State = 'tx'

Granted, this is a very simple filter, but it clearly shows all 3 filter components - easy,right?!?

Let's modify the filter to use a numeric field and a numeric operator. Let's assume thatwe want to print a report of all customers who have at least a $5000 line of credit withour company. A sample filter would resemble this:

CUS:LINEOFCREDIT > 5000

Again, this is a very simple filter that shows how a filter is structured.

Page 40: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Introduction 40

2005-2014 Scott Daughtry/Oleg Fomin

2.7.3 Overview: Filters Part 4

In the previous tutorial page some simple filters were shown to help you understandthe components of a database filter. A database filter can be very simple or fairlycomplex - it depends on the type of report that you are attempting to create. In theirmost simple form database filters can be used for three different situations:

You are extracting information based on textYou are extracting information using numbersYou are extracting information based on a logical condition

Here are some sample situations and a simple database filter for each:

1. Customers who drive a BMW: CUS:CarType = 'bmw'2. Products made by MierWater: ITM:Company = 'mierwater3. Items with an onhand quantity greater than 20: ITM:QtyOnhand > 204. Children who are too young to be in Kindergarten: Nam:Age < 75. Customers who have pets: NAM:Pets = 16. Items with no detailed information available: ITM:Detailed = 0

The six above example filters above are very simple in their structure but someinteresting details become apparent:

The first 2 filters for Text-type filters require a quote symbol (') before and after thetext string that you are comparing against the database field ('bmw'; 'mierwater')The next 2 filters for Integer-type filters don't use a quote symbol; quote symbolswill change the integers (aka: numbers) into a text string so they cannot be usedhereThe last 2 filters for Logical-type filters use either a 0 (False) or 1 (True) to indicatetrue or false. This is because the information for this database field is stored as aone position integer (aka: number) in the database. For those of you with dBaseexperience this is quite different than what you are used to, as dBase stores a valueof true as "Y" or "T" and a negative value as "N" or "F".

2.7.4 Overview: Filters Part 5

In the previous help topic some increasingly complicated filters were displayed. Whilestructurally correct, they could use some modification to make them 100% reliable.You never know exactly how database information is stored; while some databaseprograms have very strict safeguards incorporated in them to ensure data is highlystructured, most don't. It is better to think defensively and create database filters thatwill work correctly in any situation instead of assuming everything within the report isall that existed within the database.

Page 41: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder41

2005-2014 Scott Daughtry/Oleg Fomin

Let us assume that a database program tracks customer sales. The data entryscreen allows you (or your sales staff) to type in the customer name, their address,phone number, etc. Let us assume that the boss wants a report printing all customersliving in Burbank; a simple filter should work:

CUS:City = 'Burbank'

The filter above looks correct, and would work IF the data entry clerk ALWAYS typedin the city named 'Burbank' the same way every time. However, what would happen ifthe CapsLock key was turned on for one data entry session and the clerk typed in'BURBANK' for several dozen customers? If you guessed that the above filter examplewouldn't work 100% of the time you would be correct! That is because thecomparison of the database field CUS:CITY must EXACTLY match the text string'Burbank' as it is currently defined; however, there are several ways of fixing thiscommon problem. For example, if you wanted to create a lot of work for yourself youcould define the filter like this:

CUS:City = 'Burbank' or CUS:City = 'BUrbank' or CUS:City = 'BURbank' or CUS:City ='BURBank' or CUS:City = 'BURBAnk' or CUS:City = 'BURBANk' or CUS:City ='BURBANK'

Thankfully there is a much easier (and reliable) way of fixing this problem and ensurethe filter works 100% of the time!! By using the functions UPPER() or LOWER() youcan define the filter like this instead:

upper(CUS:City) = 'BURBANK' -or-lower(CUS:City) = 'burbank'

Either filter method is guaranteed to work 100% of the time because you are forcingthe database field's contents to only one specific text case that can be exactlycompared against. You will also greatly increase the operational speed of the filter byusing the upper() or lower() functions instead of using the previous very long filterexample.

To learn more about the built in functions in the Report Builder click HERE.

The important thing to consider here is this - never take for granted that databaseinformation will be typed in exactly as you think it is. The Capslock key can cause youa great deal of grief, but the built-in Report Builder functions can quickly solve thisproblem for you!

Page 42: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Introduction 42

2005-2014 Scott Daughtry/Oleg Fomin

2.7.5 Overview: Filters Part 6

As mentioned before, database filters can be very simple or complex; it depends onthe situation. To accommodate more complex filter situations you must used BOOLEAN OPERATORS within the filter condition. These are used to "join" togethermultiple database filter conditions (also known as Expressions). As you may haveguessed, it is important to know how to properly use a BOOLEAN OPERATOR toachieve the desired result.

There are only a handful of BOOLEAN OPERATORS; you will use only 4 of them tocreate complex filter conditions:

1. AND2. OR3. NOT4. XOR

Let's use some example situations and display what a sample filter would be for each:

1. Customers from Texas that make over $50000 a year:upper(CUS:State) = 'TX' AND CUS:Income > 49999

2. People who like ice cream or truffles:CUS:IceCream = 1 OR CUS:Truffles = 1

3. Cars that can be any color except orange :upper(INV:Color) NOT = 'BLACK'

Notice that every time we are comparing a text string (such as the state field) againsta database field's contents that the function UPPER() is used. This is a good practiceto get into; whenever your filters are using/comparing text use the UPPER() orLOWER() functions.

Notice that the CUS:IceCream and CUS:Truffle fields are true/false fields; a value ofone means that the field is TRUE (a value of zero would mean false).

Notice that the NOT operator is used with the equal sign; this BOOLEAN OPERATORis most commonly used with another CONDITIONAL OPERATOR (greater than, lessthan, equal to).

It is important to understand that there is an order of precedence involved whencombining two or more expressions into one filter. A simple definition for "precedence"can be "what the computer will look for first in the database". There are five levels ofprecedence:

Level 1: Parenthesis characters that surround a portion of a filter expressionLevel 2: Conditional operators (<, >, =, etc)

Page 43: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder43

2005-2014 Scott Daughtry/Oleg Fomin

Level 3: NOTLevel 4: ANDLevel 5: OR

When the filter expression is evaluated the precedence order will determine the resultof the filter. The filter always returns a value of either TRUE or FALSE; either thedatabase field(s) matches what you are checking for or it doesn't! There is no otherresult that a filter can return. Keeping this in mind here are some additional filterexamples:

upper(CUS:Car) = 'FERRARI'

Above we are checking for customers who own cars made by Ferrari; if their car is aHonda then the filter condition returns a value of FALSE, and won't be selected forprinting on the report. Let's modify the filter to check for 'Ferrari' and 'Lotus'automobiles by using a BOOLEAN OPERATOR:

upper(CUS:Car) = 'FERRARI' AND upper(CUS:Car) = 'LOTUS'

In this example the BOOLEAN OPERATOR of AND is being used. However, let'sexamine what is happening, and why the above example will fail. The BOOLEANOPERATOR of AND means that both expressions MUST return a value of TRUE forthat database record to be selected. There is no way a car can be both a FerrariAND a Lotus so that database record will be skipped! We need to change the BOOLEAN OPERATOR to use the OR operator so the filter looks like this:

upper(CUS:Car) = 'FERRARI' OR upper(CUS:Car) = 'Lotus'

If the car isn't a Ferrari the OR BOOLEAN OPERATOR will continue evaluating thefilter expression, since a value of TRUE isn't required for the first part of theexpression. Therefore if the car is a Ferrari or a Lotus that database record will beselected for printing.

You can create very long filters by using BOOLEAN OPERATORS; some examples:

Male customers over 30 who drive a Lincoln or Cadillac automobileupper(CUS:Sex) = 'M' and CUS:Age > 30 AND upper(CUS:Car) = 'Lincoln' or upper(CUS:Car) = 'Cadillac'

Clients between the ages of 30 and 40CUS:Age > 29 AND CUS:Age < 41

Page 44: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder44

2005-2014 Scott Daughtry/Oleg Fomin

3 Basics You Need To Know (aka: The Tutorial)!

The hyperlinks shown below will teach you how to create a very generic report (steps1-3), modify the generic report into a more useful report (steps 4-9), and then performadd more sophisticated features for a complicated report (steps 10-18).

OverviewStep 1: Reports Manager ScreenStep 2: Create/Save A New Report FileStep 3: Details & FramesStep 4: Modifying Frame ContentsStep 5: Resizing The Detail BandStep 6: Adding A Page HeaderStep 7: Sorting InformationStep 8: Functions & PicturesStep 9: Combining Info Into A FrameStep 10: Multiple SortingStep 11: FiltersStep 12: Filters Part TwoStep 13: Adding GraphicsStep 14: Adding A "Record's Printed" CounterStep 15: Page BreaksStep 16: Using Total FieldsStep 17: Using Group Total FieldsStep 18: Using Grand Total Fields

3.1 Basics: Overview

This tutorial will explain how to design a very simple report and then gradually addnew features to the same report to show how to create increasingly moresophisticated reports. Even though the database files used in the tutorial are differentthan yours, the steps involved are still the same. The database file structure for thetutorial is very simple:

FIELD NAME DESCRIPTIONNAM:Lastname First nameNAM:Firstname Last nameNAM:Middle Middle InitialNAM:Adrs1 Address Line 1NAM:Adrs2 Address Line 2NAM:City CityNAM:State StateNAM:Zipcode Zip Code

Page 45: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Basics You Need To Know (aka: The Tutorial)! 45

2005-2014 Scott Daughtry/Oleg Fomin

NAM:Country Country

Note: Some tutorial help topics may use different database file structures as neededto provide adequate instruction.

Later in the tutorial a report using two database files that are related to each other(aka: a relational database) will be used to show how to create more advancedreports.

3.2 Basics: Step 1 (Report Manager Screen)

On the previous page the database structure was described - only 9 fields are used inthis small database. Most likely this database program will have more fields, but ninefields are enough to learn with.

It is assumed the fictional database application is open at this point, and you haveselected the Reports Manager option from the application's pull down menu. This willdisplay a screen similar to this:

The above screen capture is called the "Reports Manager" screen. It keeps track ofall the reports that have been designed for/by you for this software program. Reportsare saved in an application sub-folder named REPORTS; the category for this reportis "Report On Name". The category name will be different for your software program,but the remainder of the screen will look pretty similar (depending on yourprogrammer's artistic tastes for colors, button size/icons, etc).

Reports you create are saved as individual files with a file extension of *.RPT inthe \REPORTS sub-folder that this database program is installed to. The ReportsManager also shows detailed information about the saved reports (date/time ofcreation, file size).

Page 46: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder46

2005-2014 Scott Daughtry/Oleg Fomin

Depending on the complexity of your database program, there may be severalcategories displayed above, with multiple reports created for each category. Becausethe Reports Manager uses a "tree" style browse you can easily expand/contract the"tree" branch to locate the desired report.

Beneath the browse area are various buttons that allow you to print the highlighted*.RPT report file, expand/contract the reports "tree", create a new report, change thehighlighted report, delete the highlighted report and close the Reports Managerwindow.

To create a new report click the INSERT button. This will display the ReportFormatter screen to create/modify report(s).

3.3 Basics: Step 2 (Create/Save A New Report File)

If you've not familiarized yourself with the Report Formatter screen you need to rightnow (and then return here).

There are two goals for any report that you create; it must

1. Properly extract information that you need2. Be visually pleasing

The second goal is sometimes elusive; everyone has their own opinion on how reportsshould look. The first goal is much simpler (once you understand how the ReportBuilder "engine" works).

It helps some users to think of a Report Builder as a big circle. Inside the circle is theinformation that you (or your users) have inputted into the database. Using a DETAILBAND in the report will start at the top of that circle (at the first database record),then loop through all the inputted information until the last database record is reached,bringing you back to the top of the circle once again. A DETAIL BAND is normallyused for doing the "grunt work" of accessing the database, retrieving the databaseinformation and printing the database field in the area that you tell it to (aka: goingaround the circle).

Almost every report that you create will have a DETAIL band in it. While there aremany different types of report "bands" that you can use, a DETAIL band (or a Groupband) is mandatory - without one of those two types of report band the reporting'engine' won't know how to cycle through the database's contents (from the firstdatabase record to the last). Before adding a DETAIL band let's define some basicinformation about the report.

Page 47: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Basics You Need To Know (aka: The Tutorial)! 47

2005-2014 Scott Daughtry/Oleg Fomin

Click the main menu option titled FILE, then select REPORT PROPERTIES from thedrop down menu. A window will appear asking you for the Report Properties. TheReport Title is the report's description that will be displayed in the Reports Managerwindow - you want to give a meaningful description so that others can understand inthis entry field. The Record Filter entry field allows you to use the Data Dictionary toassist in creating a filter condition. Record Filters will be described in much moredetail in later lessons - in a nutshell a filter allows you to print ONLY the informationthat you desire (such as: print all names for customers living in Hawaii). Here is whatthe screen looks right now:

Click on the second tab labeled "Page layout"; on this tab you can override the defaultsettings for the generated report. The default settings are for 8.5x11 portrait output,with small margins on all 4 sides of the generated report page. You can also changethe report orientation to landscape by clicking on the Landscape check box. For nowthe default settings will be used. Here is the screen:

Click the SAVE button to save the report page information. At this point we need tosave the report to the *.RPT file that is stored in the \REPORTS directory. Click theFILE main menu option, then select the SAVE AS menu option. A window will appearonscreen that you've seen in other Windows applications - you are being prompted fora location to save the file and a unique file name for the file. The default folder to savethe report definition file to will be the \REPORTS folder located directly "underneath"the location where your database program is installed to. This is the desired locationfor ALL reports that you create - ALWAYS save your reports in the \REPORTSfolder! For the file name you want to create a unique file name for all new reports.You can use the Windows 95/98/NT long file names if you want, or give it a 8character file name - the choice is yours. Leave the *.RPT file extension alone - you

Page 48: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder48

2005-2014 Scott Daughtry/Oleg Fomin

do NOT want to use a file extension different that *.RPT!! For this report a file nameof PEOPLE1 will be given, with the screen resembling:

Now that the file name is input the OK button is clicked to save the report file. Thereport's file c:\clarion5\frb\reports\people1.rpt is now saved to the hard drive. Eachreport that you create must be saved to a DIFFERENTLY NAMED *.RPT file. You willalso notice that the top of the report painter window now displays some of theinformation that was just entered above:

To recap: on this page you learned:

Generically speaking, every report needs a DETAIL band to extract/print databaseinformationHow to create a new report file and save it to your computer's hard driveHow to change the dimensions of a report (from portrait to landscape, etc)How and where report files (*.RPT) are saved on your computer

3.4 Basics: Step 3 (Details & Frames)

Now we are ready to define the DETAIL band for this sample report. To recap, theDETAIL band performs the data retrieval from the database and inserts databasefield contents into the desired location in your report.

SUGGESTION: Sometimes it is a good idea to draw the sample report on a piece ofpaper to help you "visualize" how the report needs to look when it is generated. If youare creating report(s) for other people you definitely need to discuss with them howthey want their reports to look like to determine how information will need to beextracted from the database file(s) and then placed onto the report page(s).

If you haven't familiarized yourself with FRAMES you need to now!

At this point in the report creation process the Report Formatter workarea inside the

Page 49: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Basics You Need To Know (aka: The Tutorial)! 49

2005-2014 Scott Daughtry/Oleg Fomin

Report Builder is completely blank - only the top menu and toolbar buttons visible.Click on the BAND main menu option, select NEW and then select DETAIL from themenu options. Notice that the Report Formatter screen now has a rectangular boxwith red boxes at each corner and the top/bottom middle. A ruler bar is now displayedto the left of the rectangular box also. The red rectangles allow you to resize the sizeof this report band - we'll leave it alone for now.

Now database fields need to be added to the DETAIL band. Database fields areplaced inside of FRAMES - a FRAME tells the Report Builder engine how and what toprint in the location where the FRAME is placed inside of a report band. There aretwo ways of adding a FRAME to the DETAIL band - you can select from the mainmenu "Frame", then "Create" - an empty FRAME is then created inside the DETAILband at the top left of the DETAIL band. An easier way to create an empty FRAME isto place the mouse in the area where you want to print the contents of a databasefield; right click the mouse to display a pop-up menu; select the menu option titled"New Frame", and an empty frame will be created in the location where the mouse ispositioned inside the DETAIL Band.

You can move a frame at any time (e.g. after it's been placed inside of a report bandor after you have defined what type of information the frame will contain [e.g. text orthe contents of a database field]). To move the frame with the mouse left clickanywhere inside the frame, and while holding down the left mouse button drag theFrame to the desired location. You can also use the keyboard to move the frame byholding down the CTRL key and use the arrow keys to move the frame in the desireddirection. Here is what the screen looks like for now:

To add text to a frame left click the mouse once inside the CONTENTS entry field inthe FRAME properties box; as information is typed it will be displayed inside of theFRAME. If the length of the text is longer than the frame you can resize the frame byclicking on the right middle red box; while holding down the left mouse button drag thebox to it's desired new size. The mouse cursor will change shape from an arrow to adouble arrow, which means you can resize the FRAME in the directions of the arrowby left click-dragging the mouse.

For now we are just adding the database fields to the DETAIL band; left click on thebutton with the flashlight inside it to display the dictionary When the dictionaryappears onscreen click the tree expand box directly underneath the 'Processed Files'description. A list of all database fields is displayed onscreen for you to choose from:

Page 50: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder50

2005-2014 Scott Daughtry/Oleg Fomin

To select a database field double left click on the field name description; for thisexample the "Last name" tree 'node' (i.e. 'choice') is double left clicked to transfer thecontents of that database field into the selected frame. The dictionary window willdisappear, and the Frame Properties window is now updated with the database fieldinformation:

Notice that an equal sign (=) is displayed in front of the field name (NAM:lastname) Also notice that the inside of the frame is displaying dollar signs ($). The dollar signsymbols are displayed onscreen to help you resize the frame size for this databasefield within the report band.

At this point the steps for adding a new frame and populating the frame are repeatedfor each of the remaining database fields that you want printed onto the report page.After moving the mouse to the desired location inside the DETAIL band I am rightclicking the mouse, selecting "New Frame", select the desired database field, andthen dragging the frame to be to the right of the last added frame. All frames will belocated at the top of the DETAIL band. For the Middle Initial field I resized the frameto accommodate a single character (A-Z) since the frame is a lot wider than it neededto be for this report. There is not sufficient space to have all the frames at the top, sothe COUNTRY field had to be left off of the report. Here is what the screen looks like:

Not too pretty, huh? We need to move the frames so they are aligned at the top for anicer looking report. The Report Builder features a very easy way of aligning frames inmany different ways. You can choose to move each frame yourself using the mouse,or the keyboard, but this can be very time consuming - there is a much easier way!The first thing to do is select all the frames on an imaginary line that you want the data

Page 51: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Basics You Need To Know (aka: The Tutorial)! 51

2005-2014 Scott Daughtry/Oleg Fomin

to be printed on. To do this you will left click the leftmost frame; while holding downthe CTRL key you will left click on each additional frame located on that imaginaryline. After you've selected the last frame you will have multiple frames displaying theresize rectangles at each corner, but they will be blue in color. Right click the mouseto display a pop up menu - this pop up menu will display various options to alignmultiple frames. The easiest choice now is titled ALIGN TOP; after selecting it fromthe menu all the frames are now aligned in a more pleasing way (with the top of eachframe now aligned horizontally within the report band):

So far we have one DETAIL band with eight frames that contain database fields. We'llsave the report right now by clicking the floppy disc button located on the toolbar. Youcan also save the report by clicking FILE from the main menu, then select SAVE. It isa VERY good idea to periodically save your work as you change the report.

Now we need to test the report to see how it looks. Click FILE from the main menu,then select EXIT from the pull down menu. You will notice that the Reports Managerscreen appears different now:

The newly created report file is now displayed onscreen, with the file name / date /time / size information about this report file displayed in the list box. To print the reportclick the PRINT button; the report will be sent either to the screen (print preview) or tothe printer, depending on how the application developer designed the application. Forthis example the report was generated to the screen; the database only contained 4database records, so the output was very small:

Page 52: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder52

2005-2014 Scott Daughtry/Oleg Fomin

Chances are excellent that the print preview screen will be different than the onedisplayed above; the above screen capture uses a very simple print preview engine.The important things to notice here is the layout of the information to detect problemswith how the report will be sent to the printer. Using the print preview display we cansee the following problems:

There is too much space between each line of information - this would waste a lot ofpaper!The street address field is getting chopped off before all the information is printed(ex: 419 Anger Ma)The country field is missing because insufficient space existed for it on the DETAILbandThe name fields could be formatted a lot more attractivelyThere is no sorting being done on the database; it would be nice if information issorted by last name

One of the Report Builders most attractive features is it's flexibility - you can changeANYTHING you want to for your reporting needs. The problems identified above withthe first report are very easily fixed. We will be fixing these things in the next tutorialstep.

To recap: on this page you learned:

It's a good idea to draw a report on paper first during brainstorming sessionsHow to add a DETAIL bandHow to add a FRAME onto the bandHow to select a database field from the dictionary that is printed from inside aFRAMEHow to align multiple FRAMES with minimal effortHow to print the new report to check for printing problems

Page 53: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Basics You Need To Know (aka: The Tutorial)! 53

2005-2014 Scott Daughtry/Oleg Fomin

3.5 Basics: Step 4 (Modifying Frame Contents)

Now it's time to clean up the report and make it more presentable for yourself and/oryour customers! Remember you can move FRAMES with either the keyboard OR themouse - the choice is yours. For moving a FRAMES in very small increments thekeyboard is more precise and easier to accomplish; use the mouse to select multiple FRAMES (hold down the CTRL key, then left click on each desired frame to selectthem individually), then use the keyboard to move the selected FRAMES (whileholding down the CTRL key, use the arrow keys to move the selected frame(s) up/down/left/right) to where they need to go (yes, you can move multiple objects at onetime!). Also note that the TAB key on the keyboard will select the next FRAME foryou; shift-tab will select the previous FRAME (just as in other Windows programs thatyou use).

Reopen the report that was just created from the Reports Manager by highlighting itinside the Report Manager screen, then click the CHANGE button. This will displaythe Report Formatter screen once again, with everything just as we saved it from theprevious session.

The first thing to change is the default font; some fonts used in Windows are moreattractive than others. The Verdana font was designed specifically for readability andmakes an excellent choice for reports. You can easily (and quickly) change the fontused inside ALL frames in the report by clicking FILE, then select the FONT menuoption. You will see a standard Windows font selection window onscreen that allowsyou to select a desired font, it's style (e.g. BOLD, Italics), and size. Once you selecta font and click the OK button you will notice that all of the FRAMES in the DETAILband will change their font. Be aware that some fonts print larger than other fonts, soif you are tight on space select a font that is narrower than other fonts. For now we'llselect Verdana-Regular-8.

Located on the Report Formatter toolbar is a button with a blue "A" inside it - this fontbutton will change the font ONLY for the currently selected FRAME (i.e. has the redresizing boxes on the corners). It will NOT change the font used for the entire report!

Click the FRAME that contains the LAST NAME field previously selected from thedatabase - we want to make it stand out on the report. After left clicking that frameclick the blue "A" button, select Bold, then click OK. The contents of that frame willnow be boldfaced - you may need to resize this frame since bold text requires a littlemore space (because each letter is now a little bit wider).

Each FRAME in a report can print in a different font; they can even print in differentcolors! Try not to use too many different types of fonts in your report, as it canbecome a distraction and make reading more difficult. Stick with common fonts thatare loaded on everyone's machine; otherwise Windows will substitute the font youchose (but isn't installed on another computer) with a font that will cause printing

Page 54: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder54

2005-2014 Scott Daughtry/Oleg Fomin

problems (such as a column bleeding into the next column, improper spacing, etc).

To recap: on this page you learned:

How to change the default font used in a reportHow to change the font characteristics for a single frameEach frame can be formatted with a different fontChoose a font that should be installed on everyone's computerChanging a font/font's properties might require a frame to be widened

3.6 Basics: Step 5 (Resizing The Detail Band)

At current, the DETAIL band is wider than it should be, which is adding a lot of blankspace underneath each printed line. This is easily fixed, and there are two ways to doit:

1. Resize with Mouse: Left click once on the DETAIL band border line (it should bedisplayed as a light grey box) to make the resize boxes appear. Select the middleresize box on the bottom of the DETAIL band, and drag it upwards until it is flush withthe bottom of the FRAMES. The report builder will not allow you to resize the DETAILband smaller than required, so you'll only be reduce it's size to a certain point.

2. Right click the DETAIL BAND; from the pop up menu select 'Band Properties'; clickthe tab titled 'Position' and then make the value for the 'Height' spinbox a smallervalue:

This method of resizing a Report Band is often easier than resizing with a mouse -

Page 55: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Basics You Need To Know (aka: The Tutorial)! 55

2005-2014 Scott Daughtry/Oleg Fomin

especially if you have frame(s) placed at the bottom of the Report Band (because theReport Formatter will usually shift the mouse's focus to a frame when you try to resizethe Report Band if a frame is located near the bottom of that Report Band.)

After resizing the Detail Band to the desired height save the report (click the floppydisc on the toolbar), exit the Report Formatter window (FILE -> EXIT), and then testprint the report to see how it looks now. Here is what my sample report output nowlooks like:

Notice that the last name is BOLD; the huge amounts of blank space after each lineare much smaller now, and the information on each line is aligned horizontally now.But, there is still work to do on this report before calling it a day!

To recap: on this page you learned:

How to resize a DETAIL band (or any band, for that matter)How to reduce the amount of blank space that is printed below a lineTwo ways to resize a Detail Band and which one might produce easier results

3.7 Basics: Step 6 (Adding A Page Header)

Now we will add a Page Header to the report, which will print the title to our newreport and also print column header information at the top of each page. Open thetutorial report to display it within the Report Formatter screen.

A Page Header is another type of REPORT BAND that is generated at the top ofeach page. The report engine keeps track of how much data can be printed on apage; when it's time for the printer to eject the page after printing as much informationas it can the Page Header report band is created and printed at the top of the report'spage.

To add a Page Header, select BAND from the Report Formatter pull down menu, thenNEW, then PAGE HEADER. A new empty band named Page Header is insertedABOVE the DETAIL band.

A report's title should be something that anyone reading the report will quicklyunderstand and accurately describes the report's contents. For this report titleexample the title will be "Customer Database - ACME Sales". Remember thateverything with a report that is printed requires a FRAME, so create a new frameinside of the new Page Header band. Add the report title inside of the new empty

Page 56: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder56

2005-2014 Scott Daughtry/Oleg Fomin

frame placed inside of the Page Header band. Most reports have a centered, bold-faced title - here is an easy way of ensuring that the report title is always centered onthe report's printed page:

Place the mouse on the right middle resize box on the empty frameResize the box until you reach the right side of the reportMake sure the gaps are the same for the left and right sides of the frameType the title inside the FRAME characteristics boxClick the center align button on the toolbarClick the blue "A" for font type. Select ARIAL, BOLD, 12, then OK

Easy! You now have a title that will always be properly centered, and slightly largerthan the rest of the report to make it stand out. You don't have to create your title likethis - if you want it left or right aligned, or a different size then feel free to do so! Youcan also create multiple line titles if you want/need to - the choice is yours!

This report will be a columnar-style report, with frames placed within the Detail Bandside-by-side that will print database information. This style of report normally has atext heading above each column (to inform the reader what that column of informationis). A column's header should only be printed once on each page - if the columnheader frame(s) are placed inside of the Detail Band they will be printed every time anew database record is retrieved/printed (which is not the desired result) - to print acolumn header only once per printed page the Page Header Band is the easiest wayto achieve this effect.

Select the Page Header band. Create a new frame inside the Page Header banddirectly above the leftmost frame displayed within the Detail Band and then type in theheader name (in this case, 'Last Name'). Repeat this process of adding a new Frameand typing a descriptive text title within the new frame for each frame displayed withinthe Detail Band until each horizontal Detail Band Frame has a Page Header Frameassociated with it.

After adding all the Page Header frames and their header text you will want to resizetheir frames to be be the same width as their corresponding Detail Band frame. Aftercompleting the frame resize each Page Header/Detail band frame "couple" should beleft aligned (to make the report more pleasing and professional looking). To align theframes so they are even: Ctrl-Leftclick each frame to select them all, then right clickto display the alignment popup menu. then select Align Top. Now they are horizontallyaligned with each other. Go ahead and move the entire line of selected frames untilthey are roughly 1/4 inch below the report title. Here is what we have so far:

Page 57: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Basics You Need To Know (aka: The Tutorial)! 57

2005-2014 Scott Daughtry/Oleg Fomin

We can see from the above screen capture that the Page Header band needs to bereduced in height (i.e. too much space between the frame bottoms and the bottom ofthe Page Header band) - otherwise the printed output will have a huge gap betweenthe column headers and the database information printed in the DETAIL band. Resizethe Page Header band (left click-drag the center red resize box until it can't bereduced in height anymore to remove that gap; here is the desired result:

Looking pretty good now! However, the column headers would look better if theywere BOLD and UNDERLINED, so go ahead and change each FRAME within thePage Header band to achieve this effect. You may need to resize a frame if some ofthe column's text is cut off when applying the BOLD font attribute.

Now we need to left align the column headers with the data information that is printedbeneath it. An easy way is to first click the header frame, then Ctrl-Leftclick the fieldframe underneath it inside the DETAIL band. Once the two frames are selected clickthe right mouse button, then select "Align Left" from the popup menu. Repeat thisprocess for each column until each Header/Detail pairing is left aligned. Rememberthat you can move the two selected objects in case they overlap other information byholding down the CTRL key, then tap the left or right arrow button to move the frameshorizontally. The final result now looks like this:

Once satisfied with the results save your work (click the blue floppy disc) then print asample report to the print preview to see how it looks:

Not bad! There is still room for improvement, but we are well on our way to a nicereport. Remember, the Report Builder will print information the way you tell it to -YOU control how the reports look, so don't be afraid to experiment. Reports willNEVER change information in your database file(s) - they are completely safe toexperiment with.

To recap: on this page you learned:

Page 58: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder58

2005-2014 Scott Daughtry/Oleg Fomin

How a Page Header is generated when a report is createdHow to add a Page Header at the top of each pageHow to add a report title at the top of each pageHow to center a Page Header easilyHow to add column headers in a Page Header bandHow to horizontally and vertically align column headers

3.8 Basics: Step 7 (Sorting Output)

Sorting information on a report is crucial for quickly locating information within thereport - can you imagine using a city phone book if the names of everyone inside itweren't sorted by last name? The Report Builder allows you to sort information howYOU want it to be sorted. Reopen the tutorial report so it is displayed in the ReportFormatter screen once again.

The Report Builder engine uses a Sorting Band to sort data the way that you want itto. To add a Sort Band to your report to enable sorting on a database field (in thisexample, the last name database field) select BAND, then NEW, then SORTINGBAND. You'll notice that the cursor changed to a pointed hand. Move the hand untilthe tip of the finger is on top of the word DETAIL in the detail band, then left click themouse to add a new Sorting Band to the report. Your report will now look like this:

Notice that above the DETAIL band is a new Band entry titled "Sorting Band 1", and adialogue box titled "Sort Expression" is displayed below it; the Report Builder is askingyou how to sort the database information. You will be using the dictionary to selectthe database field as the primary sort - click the button with the flashlight icon within itto display the dictionary window onscreen:

Page 59: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Basics You Need To Know (aka: The Tutorial)! 59

2005-2014 Scott Daughtry/Oleg Fomin

This report will be sorted on the Last Name field of the database; expand the "tree"for the "Names Database" to display onscreen all of the database field names for thedatabase. Double left click on the Last Name database field entry to insert the NAM:LastName field name into the entry field for the Sort Expression box:

Notice that the database field name is now entered into the entry field; click the SAVEbutton. The information displayed in the Sorting Band detail is now changed to this:

..to let you know how this Sorting Band will be sorting information when the report isgenerated. Go ahead and test the sort by saving the report, exit the Report Formatterscreen and then print a sample report to the print preview screen. Here is what thereport looks like now:

Notice that the Last Name field entries are now sorted alphabetically on the printedpage.

To recap: on this page you learned:

You control how database information is sorted on a reportThe report engine uses the Sorting Band to perform sorting on a databaseHow to create a Sorting Band on a reportHow to select a database field from the dictionary to sort on

Page 60: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder60

2005-2014 Scott Daughtry/Oleg Fomin

3.9 Basics: Step 8 (Functions & Pictures)

The Report Builder allows you to manipulate database information in a variety of waysbefore it is generated to a report's printed page - this capability enables the next"trick" that will be used to make this report even more professional looking!

Our tutorial report thus far has three columns (aka: frames) that displays the threecomponents of a customer's name (last name, first name, middle initial) with spacesbetween each database field. While this is acceptable, we can make it look muchbetter by formatting the database information before it is printed. Instead of printinginformation inside 3 individual FRAMES we will instead print a formatted name insideof one FRAME. Not only will this look better, but may also take up less space on thatline of the report! Here is an example of how the report currently prints a customer'sname on the printed page:

PRESLEY ELVIS A

and here is how we want it to look:

PRESLEY, ELVIS A

Open the report within the Report Formatter window. Delete the two frames thatcurrently display the First Name and Middle Initial database fields, and also delete thepaired frames for those two items displayed in the Page Header report band.

Left click the Last Name FRAME within the DETAIL band; the properties box for thatframe should look like this:

If you will recall, each of the three database fields (Last Name, First Name, MiddleInitial) has a lot of blank space after each of their database entries. Report Builderhas a way of removing these trailing spaces by using the CLIP () function with each ofthe database fields - here is how to use it.

Open the Last Name frame within the Detail Band and remove the contents of theframe's "Properties" box. Click the button with the flashlight icon to display theDictionary onscreen. Not only does the DICTIONARY maintain the database fieldinformation for this software application but it is also a centralized location foraccessing/using the variety of built in functions to manipulate a Frame's contents. Hereis screen capture showing where the CLIP() function is located inside of theDICTIONARY window:

Page 61: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Basics You Need To Know (aka: The Tutorial)! 61

2005-2014 Scott Daughtry/Oleg Fomin

Double left click the CLIP(string) Dictionary entry which will insert it into the FRAMEproperties window:

Obviously we aren't manipulating a database field called (string); this is simply tellingyou that the CLIP() function is used to manipulate a text string (i.e. you can't use thisfunction on numeric fields). Remove the word "string" from inside the '()' symbols, thusleaving you with = CLIP() inside the contents entry field. Left click once between the'()' characters, then click the DICTIONARY button again to select the Last Namedatabase field from the dictionary. Double click the Last Name database field, whichchanges the above screen to look like this:

What this Properties screen is telling you is that this Frame, at run time, will print thecontents of the NAM: Lastname database field after the CLIP() function hasprocessed it.

We've solved one piece of the puzzle (how to remove the blank spaces that arestored at the end of a database field's stored content); now we need to combine thelast name database field with a comma character and a blank space after the comma.To combine two or more strings together we use the Ampersand (&) character; anytext that we want to combine with a database field has to be enclosed in singlequotes. So, here is what the Frame Properties screen looks like now:

So far so good. We have the last name (with all blank spaces removed), and thecomma character added directly after it, with a blank space after the comma. Now it's

Page 62: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder62

2005-2014 Scott Daughtry/Oleg Fomin

time to add the First Name database field; however, remember that the first namefield can also have blank spaces at the end, so we need to CLIP() that field also. Weare combining the First Name field to the existing information, so we also need theAmpersand character to join them together. Go ahead and type in this information:

& clip()

and then click inside the '()' symbols where the First Name field will be inserted, thenclick the DICTIONARY button to display the database fields. Here is our revisedscreen:

Now for the last part - adding the Middle Initial database field. This database field isonly one position in length, so we don't need to CLIP() that field - we just need toappend it to the rest of the information. We do need a blank space after the last namefield though. So, go ahead and type in the ampersand (&) symbol at the end of theContents string, then add a blank space between two quotes, then click on the DICTIONARY button; select the Middle Initial database field to make the PropertiesBox contents resemble this:

Now we need to change the PICTURE for this FRAME; originally it was as long as theLast Name database field allowed, which was 20 places. We want to extend this tobe as long as all the fields and blank spaces require for the 3 fields. To see how longthe database fields are you can use the DICTIONARY window:

You can use the right arrow to scroll the list to the right in case the PICTURE columndoesn't display on your screen. The number after the @S is the length of the field;based on the above information we need to extend the frame to 20 + 2 + 20 + 1 + 1 =44 spaces. It is doubtful that both the last name and first name would fully occupy 20spaces apiece, so it is up to you if you want to make the picture shorter (which is

Page 63: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Basics You Need To Know (aka: The Tutorial)! 63

2005-2014 Scott Daughtry/Oleg Fomin

advisable).

Click on the tab titled 'Picture'; right now the picture is @S20; go ahead and type in@S34 If you find that some names are being truncated you can increase the length ofthe picture to accommodate the longer length.

Resize the last name FRAME to accommodate the increased picture length; you mayneed to move some FRAMES to the right to accommodate the extra length of theupdate name Frame. Don't forget to change the column header, since the Framebelow it within the Detail Band now displays a person's full name instead of just theirlast name. Once you have the FRAMES properly aligned save the report and then runit to see how it looks in the print preview screen. Here is what the sample report lookslike now:

Much better looking! To recap: on this page you learned:

How to remove blank spaces from the end of database field information using theCLIP() functionHow to format database fields and text information into one frameWhere to find the different functions in the dictionary to manipulate databaseinformationHow and why you need to change the Picture for a frame when combining dataHow and why you need to resize a frame when combining separate pieces ofinformation

3.10 Basics: Step 9 (Combining Info Inside A Frame)

Our sample report is shaping up nicely; how about we clean up the city, state andzipcode information so it prints nicer on the printed page? We've opened up thereport so the Report Formatter is onscreen:

Notice that the two address lines are being truncated; the city field is also being cutshort. To combine the City/State/Zip code information we'll need to eliminate the blank

Page 64: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder64

2005-2014 Scott Daughtry/Oleg Fomin

spaces after two of the fields (city and state), insert a comma between the City andState fields, and a blank space before the zip code is printed. This will change theoutput from:

TUCSON AZ 85730

to:

TUCSON, AZ 85730

Remember that whenever you combine database fields within a Detail Band that theHeader Page column frame(s) need to be updated also!

Armed with the tricks presented on Page 8 of this tutorial these changes are easy toachieve. Here is one way to produce the desired results:

Resize the DETAIL band to give yourself some room to maneuver inSelect the City/State/Zip Code FRAMES together and drag them downward to giveyourself room to maneuver within the BandCreate a new FRAME where the City/State/Zip Code FRAMES used to beClick the Dictionary button to display all the functions for the Report BuilderSelect CLIP() from the functions relating to Strings; this will insert '=CLIP(string)'inside the Frame Properties Contents entry field; delete the word 'string' from insidethe '()' characters or make the word 'string' highlighted, then click on the Dictionarybutton againSelect the City database field from the Dictionary; the Contents entry field nowshows =CLIP(NAM:City)Add a comma character after the CLIPped City field; change the Contents entryfield to show: =CLIP(NAM:City) & ', ' &Click the Dictionary button again and select the CLIP() function again then removethe word 'string' from inside the '()' characters. Click on the Dictionary button and select the State database field.Now the Contents entry field shows =CLIP( NAM:city ) & ', ' & CLIP(NAM:state) & We need to add a blank space after the State database field is printed; after thelast Ampersand (&) character add a single space surrounded by quote characters: ''Click on the Dictionary button and select the ZipCode database field. Thiscompletes the act of combining the City/State/Zipcode information into one frame.The FRAME contents look like this:

Page 65: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Basics You Need To Know (aka: The Tutorial)! 65

2005-2014 Scott Daughtry/Oleg Fomin

Now we need to change the Picture to accommodate the combined length of thethree database fields plus the comma and space characters between the fields. If youdon't know the length of the fields you can click on the Dictionary button to retrievetheir lengths. For this example we have 30+2+2+1_10 = 45; chances are high that thelength will be MUCH shorter than this, so it is up to you if you want to shorten this upto save space on the printed page. Click the Picture tab on the FRAME propertiesbox. Right now the picture entry field is completely blank:

Click on the button with the "face" icon to display the Picture Wizard. A pop upwindow of picture types is shown onscreen:

The FRAME that we created for the 3 combined database fields contains Stringvalues, so choose the String radio button and click NEXT. You are prompted for themaximum length of this string:

The default starting value for a String is 20 positions; change this to 45 and then clickOK. Now the Picture entry field in the Frame Properties box looks like this:

You will also notice that the FRAME contents in the DETAIL band have changed to

Page 66: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder66

2005-2014 Scott Daughtry/Oleg Fomin

dollar ($) signs. Resize the new FRAME to the correct length, then align it to be linedup horizontally with the other FRAMES in the DETAIL band (i.e. Align Top).

Within the Page Header band delete the Frames previously used as column headersfor the Zip Code and State columns (right click the desired FRAME, then selectDELETE from the pop up menu to remove that header FRAME). Now we have oneheader FRAME left for "City"; we can modify that Header to reflect a more fittingdescription (City / State / Zip Code). We'll need to resize that header FRAME afterchanging the text, then left align it with the associated FRAME in the DETAIL band soeverything lines up.

Delete the original City/State/Zip Code FRAMES that we moved downward inside theDETAIL band since they are no longer needed. We'll also move the new FRAMES forthe combined City/State/Zip Code database fields as far to the right as possible - weneed to free up space for the Address lines that are being chopped off.

While we're at it, we can add back in the Country field that we originally didn't haveroom for. We'll make the DETAIL band print 2 lines for each database entry. Here iswhat the final DETAIL band looks like:

Save the changes and then print a sample report to the Print Preview screen to seehow everything looks:

Quite a visual difference! To recap, on this page you learned:

How to avoid truncating information when a FRAME is too smallHow to combine separate database fields into one FRAMEHow and why you need to change the PICTURE for a FRAME when combining text& dataHow to use the Picture Wizard dialogue box to change a FRAME Picture to printlonger text stringsThat a detail band can contain multiple lines for the same database record to makeit more visually appealing

Page 67: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Basics You Need To Know (aka: The Tutorial)! 67

2005-2014 Scott Daughtry/Oleg Fomin

3.11 Basics: Step 10 (Multiple Sorting Levels)

Now that our sample report is looking pretty good let's explore some tricks that youcan use for your reports. A common reporting requirement is having multiple layers ofsorted information. In this module we are going to change the report from printing inLast Name sequence to printing a report sorted first on the State, then the City, andthen the Last Name database fields.

Back on PAGE 7 of the tutorial we sorted the report on the Last Name field of thereport by creating a Sorting Band. We will still use a Sorting Band to perform thesorting - we'll just be using more of them to perform the layered sorting that we needfor the report!

It is important to figure out the correct sequence of events BEFORE you start addingReport Sorting bands to your report. Take a good look at your database informationand plan on paper how you want the report to be sorted. This will save you time in thelong run and prevent frustration later on. For the example above we want the reportsorted on three different database fields. The most important sort is on the STATEdatabase field; within the STATE information we want it to be sorted by the CITY.Within the CITY we want the names sorted alphabetically by the LAST NAME.

The first order of business for this tutorial example is first deleting the existing SortingBand previously created in the sample report. To delete a Sorting Band you place themouse cursor directly over the words Sorting Band, then click the right mouse button.From the pop up menu select 'Delete Band' - the sorting Band is now gone and thereport is unsorted for the moment.

NOTE NOTE NOTE

If you are modifying your report that already has a Sorting Band created, and havealso created associated Header and Footer bands for this Sorting Band you DO NOTwant to delete the band! If you want to change the existing sort for a Sorting Bandyou only need to right click once on that Sorting Band, select PROPERTIES from thepopup menu, then modify the field to sort by!

NOTE NOTE NOTE

We will be adding Sorting Bands in the same sequence as their order of importance -the primary sort on the STATE database field is first, then CITY, then LASTNAME.From the Report Formatter menu select BAND, then NEW, and then SORTINGBAND. The mouse cursor changes to the hand cursor; place it inside the DETAILband and left click the mouse. Inside the Sort Expression box you click the Dictionarybutton, then select the STATE database field from the Dictionary, then click SAVE.

Repeat the above steps two more times for the CITY and then the LAST NAME

Page 68: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder68

2005-2014 Scott Daughtry/Oleg Fomin

database fields, adding a Sorting Band for each field. The final result will look like this:

You can continue adding more Sorting Bands if you need to; for example, if youwanted the names to be sorted by Last Name, then the First Name you could add afourth Sorting Band with the database field NAM:firstname selected. Once you aredone adding Sorting Bands save the report and then print a sample report to the printpreview screen to see if the output is what you expected:

Looking at the information above we see four names of people living in FL; withinthose 4 names it is sorted alphabetically by the City, and within the 2 people living inOakland, Fl the last names are sorted alphabetically. Perfect!

It may take some trial and error to get the information sorted exactly as you want it toprint. Remember that you can cause no damage to the database file(s) using theReport Builder, so experiment as much as you want.

An important point to remember about multiple sorts - they will slow down the reportgeneration, as more work has to be done by the database engine and your computerto sort the data as you want it to appear within the report. If you have fairly smalldatabase file(s) you won't experience much (if any) of a delay; on large database file(s) you will need some patience for the report to be created. To recap, on this pageyou learned:

How to add additional Sorting Bands within a report to "nest" information throughmultiple sort levelsHow to delete a Sorting BandThe performance impact of multiple Sorting Bands in a report

Page 69: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Basics You Need To Know (aka: The Tutorial)! 69

2005-2014 Scott Daughtry/Oleg Fomin

3.12 Basics: Step 11 (Filters)

Depending on how the developer designed this software application, a Query Wizardmight be employed as a simple means to build/reuse a FILTER that will limit whatdatabase record(s) are sent to the report (e.g. print only customers living in Florida;print only part numbers that were sold between January and June). If a Query Wizardmodule is displayed before the report is generated then use it (as it is simpler, and thefilters that you build using that module can also be used in the application's browsescreens).

If a Query Wizard module is not included in this software application you can stillcreate/use a FILTER within a Report Builder report!

A database FILTER is a means of extracting only a portion of information that youwant (and either display that filtered information onscreen or within the printed report).For example, if you only want to know the names of people living in France in youraddress book why would you print a list with EVERYONE's names? The list could behuge, and take forever to read through and extract only the information you want.

A database FILTER can be very simple (ex: Color = 'blue'), or complex (ex: Race ='Caucasion' AND Income > 25000 AND (Status = 'Single' OR Status = 'Divorced') - itdepends on what the filter situation requires. A FILTER is saved inside of the ReportBuilder report, so you don't need to create it each time that you want to print thereport. There are some basic concepts that you need to understand before creating a filter;some knowledge of the Report Builder functions will prove handy for creating yourreport filters.

A simple definition of a FILTER could be described as comparing databaseinformation against something else. Some simple filter conditions:

STATE = 'Ca'PRICE > $300AGE < 30

As shown above there are 3 parts to a filter:

The database field starts the filterAn operator symbol that describes what is being done with the database fieldA text string or number that the database field is being compared against

You can retrieve the database field name and different operators of the filter conditionfrom the Dictionary. The third part of the filter is up to you to decide - remember that ifyou are comparing database information against textual information you need to makeit a string (enclosed in single quote symbols); if comparing database information

Page 70: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder70

2005-2014 Scott Daughtry/Oleg Fomin

against a number then quote symbols are not used.

Report FILTERS are created by selecting FILE from the pull down menu; selectREPORT PROPERTIES from the menu to display the Report Properties screen:

On the bottom of the Report Properties window is an entry field titled Record Filter; tothe right of the entry field is the now-familiar Dictionary button (flashlight icon). Therecord filter is typed/constructed in this entry field, and once the SAVE button isclicked the FILTER is embedded with the report (NOTE: Don't forget to SAVE thereport after building/changing a filter!).

Until you learn the different functions and operators that are built into the ReportBuilder you should use the Dictionary with creating a report filter (which is fine - I stilluse it too!). Let's start with creating a simple filter to show how to use the Dictionaryto help build the filter condition:

With your report open, and the Report Properties window visible (as shown in theabove screen capture) click on the Dictionary button to display the list of databasefields. Select the STATE field in the dictionary to insert it into the Filter data entryfield above. This completes step one of the filter building process.We now need to decide how we are going to compare the State field in thedatabase. For this example we want to print out database entries for only thosepeople living in Florida. To compare information we use an OPERATOR symbolwhich tells the computer how to manipulate information. After inserting a blankspace after the field name we click on the Dictionary button again and then choosethe entry titled "Equal To" from the list of Standard Operators. This action inserts anequal sign (=) after the field name, which completes step 2 of the filter. Now we have to manually type in how we are going to compare the State databasefield. We wanted to print only those entries for Florida; the state database field is 2positions in length. We will be comparing "FL" against the database field. Add ablank space after the '=' operator and type in (using single quote characters,because this is a text value): 'FL'

Here is what the completed filter appears in the Report Properties screen:

Page 71: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Basics You Need To Know (aka: The Tutorial)! 71

2005-2014 Scott Daughtry/Oleg Fomin

In theory this filter is 100% correct; structurally it IS correct, but there exists aproblem that could result in the report's contents not being 100% accurate. Theproblem is how the State database field is stored in the database - when someoneinputs the State information it is capitalized as "Fl", with the "l" being lowercase. Thefilter shown above (section 3 of the filter condition) is all uppercase 'FL'. Becausecomputers do EXACTLY what YOU tell them to do, the result will be that NOdatabase entries will be found, even though there are 4 entries in this database thathave people living in Florida!

Before throwing your hands in the air, take a minute to compose yourself while we diga little deeper into how filters work. The filter statement shown above is structurallycorrect: we have a database field, an operator, and the text string for what it is beingcompared against. The problem is that we are telling the computer to make sure thatthe State field EXACTLY matches the text string "FL". Computers are stupid - theydon't understand that it should have checked for "Fl" instead. WE have to tell it to dothat!

There are several ways to fix this problem; the easiest way of ensuring that a filtercondition dealing with text strings will always work is to use either the lower() or upper() function to convert the contents of a database field to a 100% consistent output(either 'fl' or 'FL').

Armed with this knowledge we change the filter to look like this:

Now we can click the SAVE button, then run the report to see how the informationlooks:

Page 72: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder72

2005-2014 Scott Daughtry/Oleg Fomin

Perfect - all four people living in Florida now appear in the report!

As mentioned before there is another way of changing the report filter to make surethat the data printed is correct. We would change the filter to perform twocomparisons of the State database field against "FL" AND "Fl". You would piecetogether two different filters by using a CONDITIONAL OPERATOR out of the ReportBuilders dictionary. Here is what the revised filter would look like:

A little more work, but it achieves the same result as using the lower() and upper()function calls.

You may be asking yourself why even bother checking for database entries where theState database field is "FL", since the database program is supposedly capitalizingthe information as the person types it in. The reason is simple - Murphy's law! Nevertake for granted that information typed in by someone else is how you would type it in.

To recap, on this page you learned:

What a filter is, and why one would be usedHow a filter is structured (what 3 components make up a filter)How to use the Report Builder features to easily create a simple filterHow to create a filter that will work 100% of the time without worrying how the datais stored inside of a database field (lowercase, uppercase, proper case)

Page 73: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Basics You Need To Know (aka: The Tutorial)! 73

2005-2014 Scott Daughtry/Oleg Fomin

3.13 Basics: Step 12 (Filters Continued)

The previous tutorial page got your feet wet on creating a filter; here we are going todig a bit deeper in creating some more filters. As mentioned before, you can use theDictionary (or this help file) to see what the different Report Builder functions andoperators are that can be used in a report filter. Some functions will be used moreoften than others; here is a short list of the most popular ones:

Clip() - remove blank space from the end of textInstring() - check for text inside a larger piece of textLower() - convert text to all lowercaseSub() - retrieve a portion of a text string for comparisonUpper() - convert text to all uppercase

For example, let's say a report of only those customers having a last name that startswith the letter "F" needs to be printed. You would use the sub() function to test thevalue of the first letter of the last name; to be safe you would also use the upper()function to make sure that letter was uppercase. Here is what that filter would looklike:

UPPER(SUB( NAM:state ,1,1 ) ) = 'F'

Notice that we used two functions at the same time, one inside the other, with thedatabase field in the middle.

Here's another good example; within the NOTES memo field of the database youwant to find/print those database records that contain the word 'SONY'. Rememberthat you can't assume that people typed in SONY in capital letters; they may havespelled it Sony or sony (or any other possible variation), so we have to convert thememo field first to UPPER case, then check for the word SONY. Here is what thefilter would look like:

INSTRING( 'SONY', UPPER( NAM:Notes ) )

Again, we are using a function inside a function (the function UPPER() inside of thefunction INSTRING()). To recap, on this page you learned:

A filter condition can contain multiple function calls - it all depends on what theresulting report needs to extract from the database to make the report accurate.

To recap, in this tutorial lesson you learned:

How to create increasingly complex filters by using multiple function callsThe existence of the instring() and sub() functions

Page 74: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder74

2005-2014 Scott Daughtry/Oleg Fomin

3.14 Basics: Step 13 (Adding Graphics)

A common reporting need is to include a company/agency logo in the Report Headerband for a letterhead document or corporate branding. An image is also a nice way ofsprucing up otherwise dull reports into a more eye-catching design. The ReportBuilder makes it very easy to add graphic image file(s) to your report.

Image files are normally placed in the Report Header band, but you can placed inother Report Bands as needed (e.g. Page Header, which will print the image on everyprinted page of the report).

After opening the report into the Report Formatter screen create a new frame in thedesired location within the Report Header band. Right click on the new frame todisplay it's Frame Properties window. Underneath the Contents entry field is acheckbox titled 'Contents - image file name'. Go ahead and check this check box, thenclick the Dictionary button (the icon that looks like a flashlight):

Because the 'Contents - image file name' is checked the Dictionary button nowoperates like a standard windows file selection box instead of displaying the ReportFormatter Dictionary. From the pop up file selection box you can choose the desiredgraphic image file from one of these file formats:

o *.Bmpo *.Gifo *.Jpgo *.Pcxo *.Wmf

Some image file formats lend themselves better to resizing (larger or smaller) thanothers; if possible stick with .Wmf (Windows Meta Files), as they seem to resize withthe best image quality. After selecting the image file it's file name will be displayedinside the new frame [NOTE: the image will NOT be displayed inside of the frame/report band]:

Page 75: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Basics You Need To Know (aka: The Tutorial)! 75

2005-2014 Scott Daughtry/Oleg Fomin

Save the report and then run it to see the result:

Remember that you can use the alignment buttons to define how the image will bedisplayed inside of the frame (top / middle / bottom aligned). You can also choose toplace a visible frame around the image file (on one or more sides) and optionallychange the fill coloring used in the frame. To recap, on this page you learned:

That you can use image file(s) in your report How to select an image file to print inside of a frameThat you can draw a frame around the image file (because it is stored inside of aframe)

3.15 Basics: Step 14 (Records Printed Counter)

Knowing how many database records have been selected for printing can be a usefuladdition to some report styles. The Report Builder makes it very easy to add thisinformation to a report; go ahead and open the tutorial report that you've been usingthus far and then:

Create a Report Footer band (from the main menu select BAND, then NEW, thenREPORT FOOTER). An empty Report Footer band is now displayed within theReport Formatter screen.Create an empty frame in the new Report Footer band in the desired location; withthe new frame selected click the Dictionary button on the Frame Properties box.. From the Dictionary pop up tree menu select the node titled 'OTHERS'; under thisentry expand the node titled "Built In Variables" and then select "Record Counter".This will insert this information into the Frame Contents: =Record_CounterThat's it! You can also manually type in the (=Record_Counter) information withouthaving to go through the Dictionary.

You may choose to make this information print a little fancier by adding text to the leftof the Record Counter by replacing the '=Record_Counter' value with:

='Records Selected: ' & left(Record_Counter)

Page 76: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder76

2005-2014 Scott Daughtry/Oleg Fomin

To recap, in this tutorial section you learned

How to print a counter of matching database record(s) for a group of relatedinformation

3.16 Basics: Step 15 (Page Breaks)

Often times a report needs to eject a page whenever a database field value changes;for example, a school teacher wants to print a list of students for each of their sixclasses - when the CLASS NUMBER field changes from first period, then secondperiod, then third period (and so on) a forced page break would make sure that eachstudent roster is printed on a separate piece of paper (so the students can sign intoclass before the bell rings on a unique printed roster). The Report Builder has severalways of forcing a page break, and the page break feature centers on the SortingBand and how you configure that sorting band's options to determine how the pagebreak is carried out.

Using the above classroom report example, you want to create a report that performsa page break whenever the Class Number changes value within the Class database;the first Sorting Band will use the Class Number database field. Printed class sign-inrosters always have student names sorted alphabetically by the student's last name,so the second Sorting Band will use the Last Name database field to perform thesecond level sort.

Here is what the printed page will look like, with comments added to the right of theprinted page that shows how each section of the report relates to a different ReportWriter band type:

A combination of static text and two databases (CLASS and STUDENT) that arelinked together (one class can have multiple students) are printed on the report. Asshown above, the report uses seven different bands to create the printed studentsign-in roster:

Page 77: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Basics You Need To Know (aka: The Tutorial)! 77

2005-2014 Scott Daughtry/Oleg Fomin

Page Header - static text that is printed at the top of each report pageSorting Band 1 - uses the COURSE SEQUENCE NUMBER field - when that valuechanges (14-01-01 to 14-01-02) the page break is desiredGroup Header 1 - contains the COURSE SEQUENCE NUMBER field that will forcethe page break when that database field's value changes and static textSorting Band 2 - uses the LAST NAME field to sort the student's namesalphabetically in ascending (A-Z) sequenceDetail - nothing is placed inside of this report band, but it does play an importantrole to cycle through the databases (explained below)Group Footer 2 - prints the student's FIRST NAME and LAST NAME databasefields, along with other database fieldsGroup Footer 1 - prints database field values from the COURSE database thatshould only print one time on the printed pagePage Footer - prints the page of pages value in the bottom right corner of eachpage

Here is how the above report is displayed inside of the Report Builder:

The report bands properties are configured as such:Page Header - default valuesSorting Band 1 - contains the COU:SeqNbr database field (aka: Class Number)Group Header 1 - default values EXCEPT for one important setting:

Page 78: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder78

2005-2014 Scott Daughtry/Oleg Fomin

This checkbox is required to force the page break after the COU:SeqNbr valuechangesSorting Band 2 - Stu:lname database fieldDetail - default values EXCEPT for one important setting:

Page 79: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Basics You Need To Know (aka: The Tutorial)! 79

2005-2014 Scott Daughtry/Oleg Fomin

A Detail band is required for the Sorting Band(s) to be added to the report; for thisreport, no data is being printed within the detail, so a value of zero is entered in the'Print section, if expression evaluates TRUE' entry field knowing that it will neverhappen - the result is that the COURSE database is forced to be cycled through,from the first database record to the last, which 'pulls' in all of the information thatneeds to be printed on the report.Group Footer 2 - Default settings:

Group Footer 1 - Default settings except for one setting change:

Page 80: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder80

2005-2014 Scott Daughtry/Oleg Fomin

For this particular report design, the Instructor information looked better at thebottom of the printed page, so the checkbox for 'At the bottom of page' is clicked toforce it to be printed at the page bottom. This isn't a mandatory setting to use, but acool option to know of for other reports that you design for your particular reportingneeds!Page Footer - default settings:

Page 81: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Basics You Need To Know (aka: The Tutorial)! 81

2005-2014 Scott Daughtry/Oleg Fomin

To recap, on this page you learned:

How to force a page break when database field information changes for the currentdatabase sortHow to make sure information is always printed at the bottom of the report pageHow to 'skip' printing any information in a Detail band by creating a fake logicalcondition that will never happen to force every database record to be evaluated

3.17 Basics: Step 16 (Using Total Fields)

A common requirement of some reports (especially financial reports) is printing totalfields (such as total sales) or the number of matching database entries for a group ofinformation. This information is normally placed within a Group Footer report band, soit prints at the end of that related group of database information.

For this example let's assume that we want to print the total number of databaserecord(s) for each state. This information will print at the last page of that group ofinformation as a summary; here's how create this effect:

Create a Sorting Band on the STATE database field (if one doesn't already exist)Create a Group Footer report band (if one doesn't already exist) on the STATEdatabase fieldAdd a new frame inside the new Group Footer report bandClick on the Dictionary button for the new FrameUnderneath the 'User Variables' section of the dictionary will be an entry labeled'Gather Totals'. Each of the Group Header / Group Footer report bands that youhave defined will have an entry here titled 'Group Totals'. Highlight the entry for theSTATE database field:

Page 82: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder82

2005-2014 Scott Daughtry/Oleg Fomin

Click the '+' button at the top of the Dictionary dialogue windowA new dialogue box appears to create a new variable based on the selected database field:

As displayed above, there are many different ways of manipulating the information tobe stored in the new variable. Here is a breakdown of each item:

Assign Name: Enter the desired name of the variable here. This name MUST beunique; do NOT use the same name as the database field! An easy way of keepingthe name unique is by using a prefix, such as LOC (which signifies 'Local'); forexample, for the database field NAM:STATE a good variable name would be LOC:STATEField/expression to total: Use the Dictionary button to help select the databasefield(s) that you want to manipulate here.Picture: Define how the variable will be printed on your report by using the PictureWizard.Total Type: Define how the selected database field(s) will be manipulated. Fromthe drop list you can selecto Sumo Averageo Counto Minimumo Maximumo EvaluateEvaluate On: Define when the variable will be modified; from the drop list you can

Page 83: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Basics You Need To Know (aka: The Tutorial)! 83

2005-2014 Scott Daughtry/Oleg Fomin

selecto At Each Record Retrieveo At The End Of The Groupo At The End Of The Report'o At The End Of Every Page

Here is the dialogue box already filled out to build the new variable:

Here is how the dictionary appears after adding the new variable:

And here is the modified Group Footer report band to make use of the new variableinformation:

And an example of what the report output will look like:

Page 84: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder84

2005-2014 Scott Daughtry/Oleg Fomin

To recap: on this tutorial page you learned:

How to create a variable to be used within a Group Header / Group Footer bandHow to manipulate the characteristics of this new variable (e.g. it's appearance,how information is gathered from the database, etc)How to combine the Group Header / Group Footer variable with text for printingmeaningful information in a report bandHow to display a counter within a report band for the number of database recordsthat are printed while using a filter condition

3.18 Basics: Step 17 (Using Group Total Fields)

Printing dollar totals for a group of database information is very common in financialreports (i.e. What are the total dollar sales for all customers in a state?). Theconcepts described in the previous tutorial page are practically the same to satisfythis requirement, with some slight changes to achieve the desired result:

Create the Sorting Band on the desired database field to perform the calculationagainst (in this case, the STATE database field is used because we need to add thetotal sales based upon a state) Create a Group Footer band on this same database fieldCreate a new frame inside the Group Footer bandClick the Dictionary button for this newly added FrameClick the '+' button at the top of the Dictionary dialogue boxCreate a new variable to contain the dollar total value based on the database fieldcontaining the dollar sales (for this example it is the database field NAM:Sales):

Page 85: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Basics You Need To Know (aka: The Tutorial)! 85

2005-2014 Scott Daughtry/Oleg Fomin

NOTE NOTENOTE

Remember that the variable LOC:StateTotal will contain the SUM of the NAM:Salesdatabase field! This means that the variable will most likely be larger (potentiallyMUCH larger) than the largest database entry; when assigning the Picture for thevariable MAKE SURE you increase it's length to accommodate this situation - otherwise your data contained in the variable may be incorrect due to truncation!

NOTE NOTENOTE

After saving the new variable the Dictionary screen will be updated to reflect thataddition:

And here is the Report Formatter screen after adding the variable to the report band(and formatting some text for that variable to make it print nicely):

Page 86: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder86

2005-2014 Scott Daughtry/Oleg Fomin

And some sample output:

Naturally the database field for sales for each customer could be added to the Detailreport band; one could also change the Picture for the "Total Sales" to include aleading dollar sign symbol. In fact, let's also add some lines to this report band toreally spruce it up:

As shown above, the Sales information for each database record was added. Alsoadded were a top border for the first frame (Total Records For The State) and abottom border for the second frame (Total Sales For The State) located inside theGroup Footer report band.

To recap: on this tutorial page you learned:

How to create a Group Total variable within a Group Header / Group Footer reportband

Page 87: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Basics You Need To Know (aka: The Tutorial)! 87

2005-2014 Scott Daughtry/Oleg Fomin

How to use this variable style to store numeric information (such as salesinformation)How to combine this variable with text to print attractive and meaningful reportinformation

3.19 Basics: Step 18 (Using Grand Total Fields)

The topics covered in pages 16 and 17 in the Tutorial help topics can also be used toprint a Grand Total value on the last page of a report:

Add a new Report Footer band to the report (click on BAND, then NEW, thenReport Footer)Create a new frame inside this new report band; click on the Dictionary buttonInside the Dictionary dialogue window left click the Grand Totals item; this is locatedunder the Gather Totals section of the User Variables section.Click the '+' button to add a new variableAssign a UNIQUE name for this new variable; select the database field containingthe dollar amount that you want added together. Change the picture length to alonger length than what the selected database field is already set to, and add the '$'character to the string. The "Total Type" will be "Sum", and it will be evaluated 'Ateach record retrieve':

After clicking the save button the dictionary screen is updated:

Page 88: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder88

2005-2014 Scott Daughtry/Oleg Fomin

Some sample output using the new Grand Total field on a report page:

If you wanted to put forth the effort, you could define variables for each of thepossible states that the database can have (50 states), then modify the Report Footerdetail band to print a state by state breakout of sales. To perform this neat trick youwould:

Create a variable in the Dictionary for all 50 state abbreviation codes in the GrandTotals section of the dictionary. The variable would make use of 3 internal functionsof the Report Builder: Clip(), Upper() and Choose(). The first two functions are usedto convert the State database field into a consistent format for testing with theChoose() function. The Choose() function is used to compare the current databaserecord against the known state abbreviation code; if it matches the database fieldcontaining the total sales for this customer living in the state is added to the variable(to keep a running total); otherwise it is skipped.In the Report Footer report band a new frame is added. The Dictionary button isclicked with the empty frame being highlighted. Under the Grand Totals section ofthe User Variables a new variable is created by clicking the '+' button.For this sample report a new variable is being created for state abbreviation code"FL" (all customers living in Florida). Here is what the variable information looks like:

Page 89: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Basics You Need To Know (aka: The Tutorial)! 89

2005-2014 Scott Daughtry/Oleg Fomin

The Save button is clicked, which inserts the new variable into the selected frame:

Another trick being used is using the Center attribute for the frame contents for boththe text string "Florida" and the Loc:Florida variable. By using the border attributes atable effect is achieved, which makes the summary page look very attractive.The pattern of adding a new frame for the state abbreviation code, and anotherframe for a new variable for that state abbreviation code is repeated. You can electto stack them any way you desire; the choice is yours! Here is how the report bandlooks at the end:

As shown above, 4 different states are being tracked, with the total dollar salesprinted below. Here is the sample output:

Page 90: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder90

2005-2014 Scott Daughtry/Oleg Fomin

To recap: on this tutorial page you learned:

How to use a Grand Total variable field on a report pageHow to use multiple Grand Total variable fields on a report pageHow to use frame borders to create attractive report output

Page 91: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder91

2005-2014 Scott Daughtry/Oleg Fomin

4 "How To" Section

The hyperlinks below provide answers to common reporting situations:

Frame TricksChange default frame settings (border, fill color, etc)Combine text and database field information onto a report pageConditionally print information onto a report pageDate fields are printing five numbers - help!Prevent truncation of a MEMO field during printingDraw A Box Around A Frame

Header/Footer TricksAdd page number counter to the report pageAdd current date/time to the report pageDifferent header on page one than remaining report pagesSame footer text is printed until last report page is reached

Miscellaneous TopicsSave a Report

Report VariationsLabelsMail merge formletters

Sorting TricksMultiple sort levelsSorting in descending sequence

User-Defined VariablesCreating/saving user defined variables

4.1 Frame Tricks

1. Default Frame Settings2. Combine text + database field content3. Conditionally print text4. Date field manipulation5. Prevent memo field truncation on the printed page6. How To: Change a Frame's Border/Fill Properties

Page 92: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

"How To" Section 92

2005-2014 Scott Daughtry/Oleg Fomin

4.1.1 How To: Modify Default Frame Settings

Problem: Removing the border from every frame you add is becoming tedious.

Solution: You can modify the default settings for newly added frames very easily:

Open up a report (any saved file, or create a new file)Select the menu item titled OPTIONSSelect the menu item tited DEFAULT FRAMEThe FRAME PROPERTIES window will now appear onscreen:

By default the checkboxes for LEFT/RIGHT/TOP/BOTTOM will be check marked(screen capture above shows only two of them are checked... this is from a differentexample in this help file). Uncheck all of the desired Border check boxes (left, right,top, bottom) to suit your needs and click the SAVE button. The next time you add a frame to a report it will inherit the default frame border properties that you havedefined above!

4.1.2 How To: Combine Text And Database Fields

Problem: Your report page needs to combine freeform text and database fieldinformation on the same line.

Solution: After adding a new frame to the report page double left click the frame todisplay the Frame Properties window. Inside the Contents entry field you can add thetext that you want to display, a blank space after that text, an Ampersand (&)character, another blank space, and then the desired database field.

Example 1Combine the text "Vendor Name:" and the contents of the database field named INV:Vendor. The Frame Properties Window entry field would resemble this:

'Vendor Name: ' & INV:Vendor

Page 93: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder93

2005-2014 Scott Daughtry/Oleg Fomin

Example 2Combine the text 'Vendor Name:' and the contents of two database fields (INV:Lastname, INV:FirstName) that contain the first and last name of the vendor. Youwant the output to be formatted as the last name and then the first name, separatedby a comma symbol. You also want to make sure that the database fields don't printextra blank spaces to avoid the output from looking odd (ex: Washington , George).The Frame Properties Window entry field would resemble this:

'Vendor Name: ' & clip(INV:LastName) & ', ' & CLIP(INV:FirstName)

4.1.3 How To: Conditionally Print Text

Problem: Some of the information inside the database, when printed, is empty due tothe way it was inputted by the user. When the report is printed this results in blankspaces on the report where the information would/should have been printed. Forexample, the fictional database program has a database field defined for thecustomer's phone number - the customer either didn't have a telephone, didn't providethe information to your sales clerk, or your sales clerk forgot to type it into theapplication.

Solution: By using the CHOOSE() logical operator you can test for a condition andtell the Report Builder how to handle the result.

Example 1For the above problem (empty telephone number) you need to check the length of the database field; if it is less than seven characters in length then you know thetelephone number is bad or empty. To check the length of a database field you needthe CLIP() and LEN() functions; CLIP() is used to remove any blank spaces from theend of the database field value, and LEN() will return the exact number of charactersthat contain an alphanumeric value (A-Z, 0-9). The Frame Properties Window entryfield would resemble this:

=CHOOSE( LEN(CLIP(INV:PhoneNumber)) < 7, 'Unknown', INV:PhoneNumber)

Example 2 If the database field named INV:VendorNumber contains a zero you want the text"unknown" printed on the report page instead of the number zero; if the INV:VendorNumber contained a value higher than zero you want to print the Vendor'sName. The Frame Properties Window entry field would resemble this:

='TOTAL for vendor ' & CHOOSE(INV:VendorNumber=0,'unknown',VEN:VendorName)

Page 94: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

"How To" Section 94

2005-2014 Scott Daughtry/Oleg Fomin

4.1.4 How To: Date Fields

If your date fields are printing something like this on your report:

92716

there is no need for panic. Your database application is storing date field informationas a five digit number to avoid the dreaded Y2K problem that occurred in 2000 (i.e.date fields were stored as a two digit year - when it became 2000 the database didn'tknow if it was 1900 or 2000).

This is an easy problem to fix by using the FORMAT() function and the appropriatePicture!

Let's assume that you have a database field named "CUS:BDATE", and it stores thecustomer's birthday. When you print this database field onto a report page it printsusing the 5 digit number. The FORMAT() function is passed the database field thatneeds manipulated (CUS:BDATE) and the type of Picture that you desire to changeit's output:

Desired Output Format Picture To Use Examplemm/dd/yy @D1 format(CUS:BDATE, @D1)mm/dd/yyyy @D2 format(CUS:BDATE, @D2)mm dd, yyyy @D3 format(CUS:BDATE, @D3)mmmmmmmmm dd, yyyy @D4 format(CUS:BDATE, @D4)dd/mm/yy @D5 format(CUS:BDATE, @D5)dd/mm/yyyy @D6 format(CUS:BDATE, @D6)dd mmm yy @D7 format(CUS:BDATE, @D7)dd mmm yyyy @D8 format(CUS:BDATE, @D8)yy/mm/dd @D9 format(CUS:BDATE, @D9)yyyy/mm/dd @D10 format(CUS:BDATE, @D10)yymmdd @D11 format(CUS:BDATE, @D11)yyyymmdd @D12 format(CUS:BDATE, @D12)mm/yy @D13 format(CUS:BDATE, @D13)mm/yyyy @D14 format(CUS:BDATE, @D14)yy/mm @D15 format(CUS:BDATE, @D15)yyyy/mm @D16 format(CUS:BDATE, @D16)

The first nine examples above (@D1-@D9) will NOT print a leading zero if the day ofthe month is 1-9, or when the month number is 1-9; for example, if the date is 1 Jan2000 and the @D1 picture is used the output would be 1/1/00. To change the outputto 01/01/00 you would change the format string to this:

format(CUS:BDATE, @D01)

Page 95: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder95

2005-2014 Scott Daughtry/Oleg Fomin

You would do likewise for the @D2-@D9 pictures (making them @D02, @D03, etc).

4.1.5 How To: Prevent MEMO Field Truncation

Problem: When a MEMO field is printed it is only partially printed...

Solution: Double left click the MEMO field frame in the report. In the FrameProperties Window change the default picture (which may show up as @S255) tonothing - the entry field should be BLANK. This will now print the entire contents of theMEMO field onto the report.

4.1.6 How To: Change a Frame's Border/Fill Properties

Whenever a frame is added into a Band (regardless of the Band type), a box isautomatically added around the frame (as shown above).

In the toolbar area (highlighted, top row) are four buttons that toggle that Frame"side" either on or off.

By manipulating these frame border "toggles", combined with the option to 'fill' a framewith a color, you can create some interesting effects. For example, you can placeframes side by side within a band (e.g. Page Header Band), untoggle the top/left/rightframe sides for each of those frames to create an underlined effect to the text:

Using this method when a straight horizontal line is desired that runs the full width of aBand is far easier than using the UNDERLINE EFFECT for that text Frame!

You can use the FILL feature of a Frame to create an interesting design effect;usually the frame would have all four Frame borders toggled back to True statusagain (i.e. the default Frame side value):

Page 96: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

"How To" Section 96

2005-2014 Scott Daughtry/Oleg Fomin

Select the first Frame and then click the FILL button in the toolbar

; a popup window will appear onscreen to select the desiredcolor to fill that Frame with:

Select the desired color and click the OK button to fill the Frame with that desiredcolor; repeat for each of the Frames until completed (NOTE: You cannot selectmultiple Frames and change their fill color at the same time - you must change eachframe individually). Here is an example of a Page Header band with each frame filledwith dark gray, and then the text contents of the Frame changed from black colored towhite colored text:

Page 97: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder97

2005-2014 Scott Daughtry/Oleg Fomin

4.2 Header/Footer Tricks

1. Add the current date / time to a report page2. Add a page number counter3. Different page footers4. Different page headers

4.2.1 How To: Add Date & Time To Report Page

The majority of reports that you create will require the date (and possibly time) thereport was generated to be printed on a report page. Here is how to do it:

Add the report band that will contain the date/time information. Typically, the top leftof the Page Header will display the date/time the report was generated.Add a new frame onto the report band referenced in the previous step.Double left click the newly added frame to display the properties for that frame andtype this information into it:

=FORMAT(TODAY(),@D17) &' '& FORMAT(CLOCK(),@T01)

Optionally remove the borders from the newly added frame (top/left/bottom/right)

Your report page will now print the text dd/mm/yyyy hh:mm onto the top left of thereport page. You can use different pictures to format the current date or time to suitthe report's needs.

4.2.2 How To: Add Page Number Counter

Most reports will display a page number counter printed within the Page Footer; hereis how to do it:

Add the Page Footer band.Add a new frame onto the Page Footer band.Double left click the newly added frame to display the properties for that frame andtype this information into it:

='Page '& Page_Counter &' of '& Total_Of_Pages

Page 98: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

"How To" Section 98

2005-2014 Scott Daughtry/Oleg Fomin

Optionally remove the borders from the newly added frame (top/left/bottom/right)

Your report page will now print the text Page n of nn onto the bottom right of thereport page (n representing the current page number, as grabbed by the PAGECOUNTER variable; the nn represents the total number of pages in the report, asgrabbed by the TOTAL_OF_PAGES variable)

4.2.3 How To: Different Page Footers

Sometimes a report will need a different report page footer on page one than on therest of the report pages. This is very easy to do:

Add a REPORT FOOTER band to the report.Inside the newly added Report Footer report band add a frame; inside the frameyou'll add the text to be printed only on the final report page ONLY inside the FrameProperties window.Add a PAGE FOOTER report band to the report.Double left click on the newly added Page Footer report band to display it's BandProperties dialogue box; you'll insert the following text inside the 'Print section, ifexpression evaluates TRUE' entry field:

NOT LastPage

The Band Properties dialogue box will look like this:

Click SAVE, and then save the report. When the report is generated anything you'veplaced inside the Page Footer report band will be printed on all pages UNTIL the lastreport page is reached - at that point, whatever you've placed inside the ReportFooter report band will be printed on the final report page instead of the Page Footerband contents!

4.2.4 How To: Different Page Headers

Sometimes a report will require a different report page header on page one than onthe rest of the report page headers. This is very easy to do:

Page 99: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder99

2005-2014 Scott Daughtry/Oleg Fomin

Add a REPORT HEADER report band to the reportInside the newly added Report Header report band add a frame; inside the frameadd the text that will be printed only on page one inside the Frame PropertieswindowAdd a PAGE HEADER report band to the reportDouble left click on the newly added Page Header report band to display it's BandProperties dialogue box; insert the following text inside the 'Print section, ifexpression evaluates TRUE' entry field:

Page_Counter > 1

When the report is generating it will print the Page Header report band ONLY afterpage one has printed. You can place anything you wish inside the Page Header reportband that is needed (text, database fields, etc) to meet the report's output needs.

4.3 Report Variations

1. Create / print labels2. Create a mail merge formletter

4.3.1 How To: Labels

Labels are a common report type that Report Builder can create, provided you havesome patience for some trial and error fiddling around with the Detail report bandwidth settings:

Create a new reportAdd a Detail band to the newly created reportResize the Detail band right margin by first selecting the Detail band (left click onceon the Detail band - eight red resize boxes will be displayed along the outer edgesof the band) and then moving the right side of the Detail band inward to the desiredlabel width:

Obviously it would be extremely handy to have a blank sheet of labels that you canmeasure for the desired label height/width. Remember that the Detail band needs tobe large enough to cover the blank space that SURROUNDS each label and not justthe printable area of the label itself!The screen cap above shows the resized Detail band. After you've resized theDetail band you can add the desired text/database field information by adding aFrame, and then add the text or database field information. Clean up the information(e.g. remove the frame borders, align the frames into neat columns, etc) and then

Page 100: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

"How To" Section 100

2005-2014 Scott Daughtry/Oleg Fomin

save the report.Generate the report and print it to a blank piece of paper; place a blank sheet oflabels on top of the printed output and hold both sheets together against anoverhead light to see if the Detail band needs to be reduced/enlarged in size toproperly print onto the label stock. It will take a few tries to get it right, so bepatient!

A sample output from the screen cap shown above (with text and database fieldinformation added to the Detail report band) looked like this in the Print Previewscreen:

If more space is needed between the labels I would move the right side of the Detailband slightly to the right. If more space is needed horizontally between the labels Iwould move the bottom side of the Detail band slightly downward, and so on.

* NOTE * * NOTE * * NOTE *

This type of report would not have any other type of Report Bands added to thereport; you will be working with only ONE Detail band!

* NOTE * * NOTE * * NOTE *

4.3.2 How To: Mail Merge Report

Mail Merge form letters use a combination of database field information and hard-coded text (that you define) to print a formatted report - you probably receive a MailMerge form letter in your mailbox from solicitors every week! This type of report iseasy to create within Report Builder:

Create a new report fileAdd a Detail report band to the report pageDouble left click the newly added Detail report band to display the Band DetailProperties dialogue boxMake sure a check mark is displayed inside the Mail Merge check box and thenclick the EDIT TEXT button:

Page 101: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder101

2005-2014 Scott Daughtry/Oleg Fomin

After you've clicked the EDIT TEXT button a pop up window is displayed to enter yourform letter's text:

The window is resizable (drag the bottom right corner of the window to make itlarger); the screen capture above shows a combination of text and database fields.The top of the window has a small toolbar with six icons; from left to right theirfunctionality is:

o Save changes and return to the Report Formatter windowo Cut selected text to the Windows clipboardo Copy selected text to the Windows clipboardo Paste Windows clipboard information to the EDIT TEXT dialogue boxo Display the Font selection dialogue boxo Display the Dictionary

To insert the contents of a database field into the form letter click the Dictionarybutton to select the desired (fields) within the sentence where it should be printed.

The example above shows that every time a database field was added to the text thatdouble quotation marks and arrows are needed; the sequence is:

Double Quote + Less Than Arrow + Database Field/Variable + Greater Than Arrow +

Page 102: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

"How To" Section 102

2005-2014 Scott Daughtry/Oleg Fomin

Double Quote

When the Dictionary adds a database field/variable to the EDIT TEXT window it willAUTOMATICALLY add the arrow symbols for you; however, it WILL NOT add thedouble quote symbols (leading and trailing), so YOU MUST DO IT! If you fail to addthe double quotes your report will probably fail when it is executed. The fix is easy(find where you failed to add the double quote symbols) - just irritating.

* NOTE * * NOTE * * NOTE * * NOTE *

You can use the Dictionary to access all of the internal Report Builder functions tomodify the database information to suit your needs; examples of what you can dowould include:

Combining multiple database fields into one formatted text string (e.g. First Name,Last Name) by using the CLIP() function and the Ampersand (&) symbolUse the CHOOSE() function to evaluate a database field and generate theappropriate text field; for example, you have a database field that stores thecustomer's gender as M or F; you can use the CHOOSE function to instead printMister or Misses onto the form letterEvaluate the last time the customer was contacted against the current computerdate to generate a text string like "it has been 14 months since we last contactedyou regarding your policy."

* NOTE * * NOTE * * NOTE * * NOTE *

The Font Dialogue Box won't allow you to use multiple font types/sizes/styles on theform letter - you can only use one font type/style/size for the form letter!

After you have entered the Mail Merge letter information click the OK button to savethe text and return to the Report Formatter window. Save the report and run it to seewhat needs revised/tweaked.

4.4 Sorting Tricks

1. Sort output in descending sort sequence2. Multiple sort levels within a report

4.4.1 How To: Descending Sort Sequence

By default a Sorting Band assumes you want to print database information inascending sequence (0-9, A-Z); there may be times where you need descendingsequence (Z-A, 9-0), especially when dates are involved (e.g. print the most recenttransactions first, and then go backwards in time). This is very easy to do:

Add a Sorting Band to the report (it is assumed you've already added the Detail

Page 103: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder103

2005-2014 Scott Daughtry/Oleg Fomin

band to this report - you can't add a Sorting Band with a Detail band already beingdefined in the report)Double left click on the Sorting Band to display the Sort Expression dialogue boxClick the Dictionary button to select the database field that you want to use to sortthe information; after it is inserted into the Sort Expression entry field you need toadd a dash character (-) in front of the database field:

As shown in the above screen capture, the database field INV:Date was selectedfrom the dictionary; a dash character (-) was added to the first position of the entryfieldClick the SAVE button to return back to the Report Formatter window; in thisexample, there were three Sorting Bands for the report (and I modified the thirdSorting Band); the Report Formatter window now reflects the changed information,as confirmed by the -INV:Date information:

4.4.2 How To: Multiple Sort Levels

See this help topic (link) for instructions how to sort a report using multiple layers

4.5 User-Defined Variables

1. Creating / implementing user variables on a report page

4.5.1 How To: Creating User Variables

Creating reusable variables that contain a database field and/or text information canbe a time saver if you create a lot of reports:

Open the desired report (or create a new report)Open the Dictionary (by creating a new empty frame or an existing frame placed onthe report)Click on USER VARIABLES, and then left click on CALCULATED FIELDS:

Page 104: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

"How To" Section 104

2005-2014 Scott Daughtry/Oleg Fomin

Click the + icon on the Dictionary toolbar to display the Properties window:

The screen capture above shows an example of a user variable titled "CityState",with the "Field/Expression To Total" information already filled in. Two different functions (clip and upper) have been used to remove trailing empty spaces andensure the State database field is printed as upper case on the report page. The "Picture" entry field has been left blank on purpose - this ensures that theinformation isn't truncated when printed on the report pageThe "Evaluate On" drop list is left with the default setting of "At Each RecordRetrieve" - this setting is EXTREMELY important, because if you change it youroutput will be very erratic (i.e. the information you thought would print for everydatabase record only prints every 5, or 10, database records, or only once perprinted page). If your report output is "goofy" for this user variable, chances are thissetting is incorrect!You can combine text with database field information; make sure that you enclosethe text with double quotation marks (otherwise a run time error will occur when thereport is executed). For example, if you want the text "Location is" printed beforethe City database field your "Field/expression to total" entry field would resemblethis:

'Location is: ' & clip(ZIP:CITY) & ', ' & upper(clip(ZIP:STATE))Click the SAVE button to save the variable - it will now show up in the Dictionary andcan be used in ANY report for that report category!

4.6 Misc Topics

Page 105: Fomin Report Builder - sdaughtry.comsdaughtry.com/downloads/frbuser.pdf · 7 Fomin Report Builder 2005-2014 Scott Daughtry/Oleg Fomin 2 Introduction Databases - what are they? Dictionary

Fomin Report Builder105

2005-2014 Scott Daughtry/Oleg Fomin

4.6.1 Help File Modification History

May 2014Added topic 'How To: Change a Frame's Border/Fill Properties'Moved Band Properties information from the Page Break help topic to the BandProperties Window help topic and fixed some of it's outdated textFixed the topic 'Basics: Step 15 (Page Breaks)' that contained incompleteinstructions on how to force a page break in a reportRecompiled into the Windows 7/Windows 8 help file format (*.CHM)Fixed grammatical mistakes in all help topics!

4 Aug 2013Minor content changes

8 Aug 2005Content expanded

30 Aug 1996First version created

4.6.2 How To: Save A Report

Step 1: Define the Report Title (that will be displayed within the Report Managerwindow)

Click FILE from the Report Builder Main MenuSelect REPORT PROPERTIES from the list of choicesEnter text inside the Report Title entry field of the Report Properties pop upwindow; try to use a short name that accurately describes the report's purpose

Step 2: Save the reportIf saving a BRAND NEW report that you've just created:o Click FILE from the Main Menuo Select SAVE AS from the list of choiceso A popup window will appear to enter the file name.o Do NOT use an existing file name! This will permanently overwrite that existing

report!o Do NOT change the file extension from the default of .RPT!o After typing in the report name click the SAVE button and wait for the popup

window to disappear on it's own (1-5 seconds)o If saving an existing reportUsing the Main Menuo Click FILE From the Main Menuo Select SAVE from the list of choices