54.1.8 Detail Report: Input Form: Fields Selected
There are several distinct areas on this page:
Documents - General or Documents - Date Time
This area allows you to specify the documents that will be used as containers for the exported data. You can specify many documents. Each document will be evaluated separately and the result sent to a separate document on disk. This is useful when you want to create several similar documents that use the same Master Query for instance:
Available Fields and Fields selected for document areas
This area contains a two part drop down list that gives you access to Tables and Fields available for export and displays the Fields already selected:
Mixing Fields in the same document
This area is essentially the same for both DT Stamp exports and Master exports with ONE IMPORTANT exception. In a General Query Export you can mix fields from different Tables in the same document. This is not allowed for Date Time Stamp exports. You will be warned if you try to do this.
The Date Time Stamp Export facility within STATIC exists to allow for the export of changed records. To do this we need to find all the changed records for every table and then export the contents of these changed records. Mixing the contents of these records by defining fields from different Tables within the same document does not make sense within this context.
Document Slave Query for General Query
Except for Place Holders, this area behaves in a very similar manner to the Query area as described in the Chapter Reports: Query Store on page 427.
For details on setting Placeholders see the Place Holder Section on page 349
Every Document MUST have a Slave Query defined for it. Within this Slave Query there MUST BE at least one USE SET command. The table of the last USE SET command in the Slave Query also determines the Master Table for the document
If you do not define a USE SET command, then there will be no Master Table and no Current Selection of Records (for that Master Table) that the export can use to generate the contents of the specified Documents and you will end up with an empty document.
You are warned if a USE SET command has not been defined.
The Slave Query is evaluated only once for each Document.
Document Slave Query for Date Time Stamp Order By
This area is in fact a Query area with most of the Query commands made invisible. This means it functions like a regular Query area in all other aspects.
For a Date Time Stamp Query, the only other action that would make sense to perform on a selection of records would be to sort them into a particular order. This area allows you to do this. See Query Store: Command: Order By on page 443 and Query Store: Command: Order by Formula on page 443 for more details.
Note: If you import Queries into this area and they contain Query commands, you will get unexpected results as the imported Query could change the selection of records to something other than those created through the Date Time Stamp fields in the Master Query area.
As there can be a mixture of Fields selected for a document that is generated by a Master Query, you must tell the Report what you consider to be the Master Table for the current Document. This is automatically done by the USE SET command. Whatever is the table for the last USE SET command used in the Slave Query also determines the Master Table for the document.
The Master Table will determine how the exported data is treated when a relation exists to the selected Master Table.
For instance, if a field from a Table is selected that has no relation to the Master Table selected, then no data is exported for that field and you will be warned in the resulting output by an error message.
If a field from a table is selected that has a Many relation to the Master Table selected, then there may be 2 or more records that could be used to fill the field - STATIC has to make a choice - it may not be the choice you expect or want.
As an example, say the Master Table is set to [HospitalRecord] and you are exporting 2 fields - [HospitalRecord]Demog_Last_Name and [ICURecord]Adm_Date. For each [HospitalRecord] record, STATIC would now export the Last_Name but when it comes to the [ICURecord]Adm_Date, and there happen to be 2 records, which Admission date does it use? There is clearly a choice because there is more than one record! STATIC (unlike many other database systems that would just report an error at this stage) will in this case use the first record it comes across to fill the field.
It may of course be better to export this data using the [ICURecord] table as the Master table - in this case you would have more rows in your output compared to using the [HospitalRecord] Master Table as there will be a row for every [IUCRecord] record. This is because there are always more [ICURecord] records in a given selection than [HospitalRecord] records because there can be more than one ICU Admission per Hospital Admission.
Note: Make sure you have a Current Selection of records to work with for the selected Master Table for Document. Do this by executing the Slave Query and ensuring there is a selection of records returned for the Query as displayed in the Query display area. This is a god habit to ensure there is something available that can be worked with to create output!
This controls the Headers for a Document.
Sometimes you will want to create documents without any Headers at all - for instance when exporting a Document that will be used as the import source for another database. In this case you would certainly not want a Header at the top of the document - it would spoil the import of the document and would have to be stripped out before import.
Usually you will want to export the document with a Header in order to identify the document.
Detail Report: Input Form: Fields Selected: Document Headers
If this is selected then the exported document will have headers exported before the actual data. The Headers include the Name of the Document, the Date Time stamp and the names of the individual fields for each column.
If this is checked then the full field name is exported as the column header other wise the short field name is used.
This is a Title that can be displayed at the top of the document. This title can include placeholders. Placeholders in this area are of the Text type. See Detail Report: Input Form: Place Holders page on page 359 for more.
This inserts a placeholder at the current insertion point in Title of Document in Header.
|