I.T. Discussion Community!
-Collapse +Expand
Paradox
Search Paradox Group:

Advanced
-Collapse +Expand Paradox To/From
To/FromCODEGuides
-Collapse +Expand Paradox Store
PRESTWOODSTORE

Prestwood eMagazine

January Edition
Subscribe now! It's Free!
Enter your email:

   ► KBDesktop Data...Paradox & Ob...Interactive ...   Print This     
  From the April 2015 Issue of Prestwood eMag
 
Interactive Paradox: Reports:
A 10 Minute Paradox Reports Quick Start
 
Posted 11 years ago on 6/19/2008 and updated 6/22/2010
Take Away:

Paradox has a built-in report writer that will suffice for nearly all reports you wish to create. You base a report on one or more tables or on a query. It uses a banded approach so you think in terms of records, pages, and report. Except for the record band, each section has a header and a footer. Paradox also offers a quick report which is useful for printing data quickly.

KB101218



Got 10 minutes? Want to get started with Paradox Reports?

This article is part of our series of 10 Minute Quick Starts. Each quick start is step by step, assumes you know very little about the subject, and takes about 10 minutes. You can use them to scratch the service of areas you want to learn and as a quick review when returning to something after a long absence.

Paradox Reports

This article is intended for anyone who wants to learn more about creating reports in Paradox. This includes Paradox users just starting with reports as well as analysts who want to use Paradox to prototype a report for a development team.

About Prototyping
Prototyping a report means to mock up a rough version of a report. For analysts, prototyping means they are mocking up a report for a developer to re-create in another tool. Paradox users will use the skills they learn in this article to create their own reports.

Setup
To get started, you have to have Paradox for Windows installed. This article is based on Paradox 11 but you can use any version of Paradox for Windows you wish (there may be slight variations in menu options but we try to keep our 10 Minute Quick Starts as generic as possible).

A quick report creates a pre-defined tabular report (a simple list-type report) and is part of the Quick Design features of Paradox which allow you to view a table and quickly generate a default item from the Tools menu.

  1. Set Working Directory to :Samples:. Set your working directory to Paradox's samples folder that contains both a BioLife.db table and BioLife.fsl form. We will use the tables in this folder for this article. Select File | Working Directory... to change your working directory.
     
    Notice I have moved the location of my Samples folder to Vista's Public folder in order to work around Application Virtualization.
     
    Paradox Set Working folder to Samples.
     
    Paradox 10/11 Note: With Paradox 10 and 11+, Corel renamed the Samples folder to Classic and moved it and they no longer define the Samples alias during installation. Once you find that folder, you can either create a :Samples: alias that points to it or simply change your working directory to it.
     
  2. Open Customer table. Select File | Open | Table. The Open Table dialog displays. Select the customer.db table and press the Open button.
     
  3. Generate a Quick Report. To generate a quick report, select Tools | Quick Design | Quick Report (you can also press Shift+F7). Once generated, I want you to notice the vertical gray dashed line. It indicates those fields will be cut off when printed on the current paper size.
     
    Paradox Quick Report
     
  4. Switch report to design mode. Select View | Design Mode. You can also press F8 to toggle between design mode and view mode with reports, forms, and scripts or use the two icons on the toolbar.
     
    The report designer is a banded report writer because it uses bands to group sections of a report into three bands: Report, Page, and Records. The Report band
     
    The Report band is the most outer band and surrounds the other two bands. It allows you to add one-time content to the beginning of your report (such as a report title and author) and to the end of the report (such as summary information or a conclusion).
     
    The Page band allows you to add recurring content to the top and bottom of every page. It is the middle band.
     
    The Record band loops through your data and displays all records unless you filter the records in the data model. Another technique for filtering what shows up on your report is to build a table and base the report on that new table. You can easily do this with a Paradox query also known as Query By Example (QBE).
     
     Paradox Report Designer
     
  5. Filter data to State='CA'. You can filter the data that shows up on a report by filtering the Data Model used in the report. A data model is a diagram of the tables used in a form or report. It identifies the tables, defines the relationships between them (links), and has features including the ability to filter each table and mark any table as read-only. You can save a data model (.dm) and reuse it with another form or report too.
     
    Select Format | Data Model, the Data Model dialog displays. Right-click on the customer table in the right pane and select Filter.
     
    Paradox's Data Model
     
    On the Filter Tables dialog, set State/Prove to "CA" and select OK. Then select OK to close the Data Model dialog.
     
    Note The Order by option is not available for reports for ordering records. On Forms, it's used to order records. For reports, you use the Sort option of the All Records band. The Range option (see button below) is used to restrict the range of records. However, to use the Range option, you must enable the Order by option and choose either the primary key or one of the table's secondary indexes.
     
    Paradox Report Designer Filter
     
  6. Run report. Notice the records are now filtered to State='CA'. Also notice the records are not sorted by the Name field.
     
  7. Sort Report by Name. Return to design mode, right-click on the All Records band and select Sort to display the Sort Record Band dialog.
     
    Paradox Report Designer sort
     
    Move the Name field to the Sort order list and select OK.
     
    Paradox Sort by Band dialog
     
  8. Run report. Notice our records filtered to 'CA' are now also sorted by 'Name'.
     
  9. Format Customer No as an Integer. The Customer No field looks a bit strange with a comma and two decimals so let's format it as an integer. Return to design mode and select the Customer No field. This is a bit tricky because you have to select the Customer No field within the record object which is within the TableFrame object. This takes three clicks before the field object is highlighted:
     
    Paradox TableFrame - Select Field


    Right-click on the Customer No field and select Properties to display the Field Properties dialog. On the Format tab, set the Format option to Integer, and select OK.
     
  10. Run report. Notice the Customer No field is now formatted as an integer.
     
  11. Switch to Landscape. We have a lot of fields in the customer table and we want to show as many as we can on a page. You adjust the page setup just like you do with other programs. The only catch with Paradox is that you have to switch to design mode then select File | Page Setup. to display the Page Setup dialog. In the Orientation panel, select Landscape, then OK.
     
  12. Delete the State/Prov and Country fields. Our report almost fits within a single landscape page but not quite. In design mode, select the State/Prov column and press your [Delete] key. Also delete the Country column.
     
    Note You may have to make the table larger in design mode to get to the State/Prov and Country columns.
     
    Paradox TableFrame - select column
     
  13. Moving bands. To add something between two bands, you first have to make a little room for the object. This is a bit tricky but once you get used to it, it's easy.
     
    To increase or decrease space between bands:
    1. Select the band you wish to add or remove space.
      Paradox Select Band
       
    2. Move your mouse to the bottom of the band (the mouse arrow will turn into a double-headed arrow).
      Paradox Report move band
       
    3. Click and drag to increase or decrease space.
       
  14. Add a "California Customers" Report title. To add a report title, you use the report band. Specifically, you add a text object between the Report and Page bands at the top of the report. In design mode, increase the space between the Report and Page bands, select a text object from the design bar, and place it on the report between the Report and Page bands.
     
    Optionally, you can change the size and style of the font. Right click on your text, select Properties to display the Text Properties dialog. On the Font tab, select the font size and style you want.
     
    Paradox Report Title
     
  15. Run report. This is the finished report with all of the above changes.
     
    Paradox Customer.db Report

Summary
This quick start helped you understand the main elements of Paradox's report designer starting with a single table quick report. Now that you understand the basics, I suggest you experiment with your new found skills and create the following reports:

  • Two table report - Customer Orders report which demonstrates a one to many relationship. To get started, select File | New | Report, then Data Model, then add the two tables to the Data Model, link them, and press OK.
     
  • Report based on a QBE query - First create a QBE query, then select File | New | Report, then Data Model. On the Data Model dialog, select queries from the drop-down located in the lower left. 

You might also want to save a data model and base a report off of it (similar to using a QBE query above). Finally, if you know standard SQL, you can also create an SQL file and base a report on it (also similar to using a QBE query above).

 

More Info

KB Post:  Power: Chapter 12, Handling Reports

Comments

0 Comments.
Share a thought or comment...
 
Write a Comment...
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1175A1
Enter key:
Article Contributed By Mike Prestwood:

Mike Prestwood is a drummer, an author, and creator of the PrestwoodBoards online community. He is the President & CEO of Prestwood IT Solutions. Prestwood IT provides Coding, Website, and Computer Tech services. Mike has authored 6 computer books and over 1,200 articles. As a drummer, he maintains play-drums.com and has authored 3 drum books. If you have a project you wish to discuss with Mike, you can send him a private message through his PrestwoodBoards home page or call him 9AM to 4PM PST at 916-726-5675 x205.

Visit Profile

 KB Article #101218 Counter
21380
Since 6/19/2008
-
   Contact Us!
 
PrestwoodBoards.com was developed and is maintainted by me. Do you have a question or suggestion? Do you see a problem? Contact me now. My goal is to build an ad-free and spam-free source of I.T. information with many contributers (ok to promote your website/company in your bio). Yes, my company Prestwood IT Solutions is mentioned in my bio which shows with every post, but you can contribute and promote your pet project too!

2,431 People Online Now!!  
Sign In to see who's online now!  Not a member? Join now. It's free!
Show more stats...


©1995-2019 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech