Making Reports
 
 
Entrance generates simple text reports and displays them in the "Results" tab using a single font, which is monospaced by default.  These reports can be customized using the REPORT keyword.   For example, this Entrance script:  
 
     REPORT
         AUTO, PLAIN, PLAIN, PLAIN
       WITH
         MARGIN 5
     SELECT name, area, population
       FROM country;
 
produces this output:
 
     name                            area     population      
     ------------------------------  -------  ----------      
     Afghanistan                      647500    21251821      
     Albania                           28750     3413904      
     Algeria                         2381740    28539321      
     American Samoa                      199       57366      
     Andorra                             450       65780      
     ...
 
The Entrance command REPORT is placed before a normal MySQL SELECT command.  It can contain these keywords:
 
    TITLE "(string)"    adds a title line above the report
    NOTE "(string)"     adds a note below the report
    NO HEADING          suppresses the column name heading
    NO BLANKLINE        suppresses the blank line above a table
    MARGINS (n)         sets left and right margins
    TABBED              generates tabbed output
 
These keywords will be supported, but are not yet (as of version 0.80.0):
    FIXEDWIDTH          turns off padding and space between columns
    FONT (family) (style) (size)   sets the report font
 
In addition, it is possible to override the way field values are formatted using these keywords:
 
    TEXT             text
    SCIENTIFIC       1.234E99
    PLAIN            plain integer (rounds double)
    AUTO             automatic
    PRINTF (format)  a printf format
    MONEY            locale specific money format, eg. ###,###.00
 
 
Report statements will be more readable if any format overrides are grouped together and followed by WITH:
 
   REPORT
       SCIENTIFIC, PLAIN, MONEY
     WITH
       MARGINS 2
       TITLE "This is the first of many titles"
       TITLE "This is the second"
       TITLE "and so on"
       NOTE  "This goes below the table"
   SELECT * FROM foo;
      
Copying query results to the clipboard
There are two ways to copy query results to the clipboard:  Use Edit | Copy when you want to copy results as they appear in the Results tab, and use Edit | Copy results data... when you want to copy query results as data, for example to move values into a spreadsheet.
 
Sample data
A script for creating the 'country' table is online:   create_country.sql and here is the first sample report:   report_country.sql
 
 
Please note:  This web page and other Entrance documentation web pages are copyrighted material and have not been released under the terms of the GPL.
 
Copyright (c) Tod Landis 2006,2007 All Rights Reserved                           Modified:  May 23, 2007
 
MySQL is a registered trademark of MySQL AB in the United States, the European Union and other countries.