Preview
Preview
Unless you limit your selection, the Preview feature tries to pull up the entire database. Do not use this feature without limiting the amount of data you are previewing! Depending on the size of your database, PowerBuilder could spend hours trying to pull up all your records for preview. If you accidentally select Preview without limiting its selection, click the hand to stop it.
To set up Preview Selected Records as You Create a Report
- As you create your report, select SQL Select instead of Quick Select as your datasource.
- After you've selected the tables to be included in your report, click on the Where Tab (on the bottom grid).
- In the Column column, type field to limit selection (or right click to select criterion from dropdown list).
- Click on the Operator column, which has a default of "=". If a different operator is desired, make a selection from the dropdown list.
- Click on the Value column. Right click select a value to be compared, matched or avoided from drop down list, or type in criterion to be compared, matched, or avoided
| |
- You can type in a another field (for a comparison), a constant, or an expression.
- If you are looking for a constant, enter the desired value surrounded by single quotes (ie. for 1998.232, enter '1998.232')
- Click on the x to leave SQL screen. At prompt, select cancel to proceed to your report.
|
Example: Where,
In Column column: "Object"."Object_id"
In Operator column: =
In Value column: '2000.86.7'
A preview of your report will pull information only from records with the
object id 2000.86.7
To set up Preview Selected Records as You Edit a Report
- From within your report, click on SQL icon (or select Design menu, and click on Data Source)
- Click on the Where Tab (on the bottom grid).
- Follow steps 3-5 as above.
To Preview One Record
- In existing report, click SQL button.
This shows you the internal guts of the report. Behind every report there is a table. Your data lives on multiple tables. For every report, there is a table behind the scenes. You could have two back there, but most have only one.
- In grid at bottom of screen, select the Where tab
- In Column field , right click to select "Object"."Object id" from dropdown menu (or other field to be matched).
You're choosing a field in a table in this example: From Object table, you're looking for the object id field.
- The equal sign appears in the Operator field.
- In Value column, type an object id number (accession number) between single quotes.
eg. '2000.4.1'
- Click on SQL to return to front of the report.
- Click Preview icon to view preview.
If you get the retrieval argument on the preview, it means you have a nest in your report that needs retrieval arguments. (See Adding Nests for Retrieval Arguments instructions.)
- To return to report, toggle the preview icon.
- After previewing and refining your report, remember to delete selection criterion before using the report in Argus or it will act as a limiter.
- Go back into SQL
- Remove the Object id = statement
- Save the report again.
Note: Sometimes PowerBuilder has trouble previewing superfields. When this happens, test the
report in Argus.
Two Kinds of Preview
- Run/Preview (File menu) - Previewing the Data Window object. It is the sort or filter or the select SQL (selected in the main report itself). You don't want to run the whole report, you want to test something. This is the test module of the report.
- Preview (View Mode) - Real preview menu that runs against
To Preview More than One Record - Run Preview
- From the main report screen click on the Preview icon using an empty SQL set. A tool bar will appear and the far left icon is a hand retrieving a page. The bottom of the page shows the progress of records being retrieved.
- Click on the red hand icon to cancel the retrieval. The records retrieved to that point will load into the report preview.
Caution: Load time can be several minutes using this method. Additionally, this can cause problems when retrieving data into complex reports, particularly ones containing nests. You may find that if you click on the red hand to stop retrieval before all the records have loaded, that some or all records contain only part of the data. If this happens, try using a limiter instead (as in the next example).
OR
- In existing report, click SQL button.
- Click on Where Tab
- In Column column, right click to select "Object"."Object id" from dropdown menu.
- In Operator column, right click to select > from dropdown menu.
- In Value column, type an object id number (accession number).
Example: 1989.0
- In Logical column, right click to select AND from dropdown list.
- On next line, in Column column, right click to select "Object"."Object id" from dropdown menu.
- In Operator column, right click to select < from dropdown menu.
Example: 1999.0
When your report is run, the combination of these selections will yield all object records with id numbers greater than 1989, but less then 1999, or all accessions within that ten year period.
- After previewing and refining your report, go back into SQL to remove the Object id < and > statements and save the report again, or else you'll limit that report to only those records selected.
Example: Where,
In Column column: "Object"."Object_id"
In Operator column: >
In Value column: '2000.85'
In Logical column: And
In next row,
InColumn column "Object" "Object_id"
In Operator column: <
In Value column: '2000.87'
A preview of your report will pull information only from records with the
object id 2000.86.1, 2000.86.2, 2000.86.3, 2000.86.4, etc, but will not pull
information from 2000.84.7 or from 2000.87.1
|