Posted 16 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.
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 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.
Open Customer table. Select File | Open | Table. The Open Table dialog displays. Select the customer.db table and press the Open button.
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.
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).
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.
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.
Run report. Notice the records are now filtered to State='CA'. Also notice the records are not sorted by the Name field.
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.
Move the Name field to the Sort order list and select OK.
Run report. Notice our records filtered to 'CA' are now also sorted by 'Name'.
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:
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.
Run report. Notice the Customer No field is now formatted as an integer.
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.
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.
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:
Select the band you wish to add or remove space.
Move your mouse to the bottom of the band (the mouse arrow will turn into a double-headed arrow).
Click and drag to increase or decrease space.
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.
Run report. This is the finished report with all of the above changes.
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).
It‘s great to be able to read a high-quality article here. I will have to learn a lot from you guys to make a better share of Slope 2 unblocked this is my favorite game that I want to share with as many people as possible because it is very beneficial.