<TABLE>
<tr><td><h1>Bring It To Everybody - SQL Reports</h1></td></tr>
<tr><td><h2>User Manual</h2></td></tr>
<tr><td><em><b>Fair Warning</b> : BITE is for database and software developers.  Using BITE requires a knowledge of SQL syntax, and building reports requires an intimate knowledge of your database structure.  As such, this manual assumes that you have this knowledge, and covers only the features of BITE, not how to use SQL.</em></td><tr>
<tr><td>
<img src="img/main.jpg" align=right>
<p>BITE SQL Reports is a report rendering library for SQL databases.  It has no support for data entry or validation.  It allows you to build reports for your database, and store them in the database to run easily.  BITE can easily handle many databases this way, and each database can have customized reports.  Your reports can be grouped together with "Trigger" commands, and you can use the BITE library to render all the reports when a trigger is called.</p>
<p>There are 3 main functions of BITE - Report Building, Data Selection, and Report Rendering.  All functions are included in the software, though you could use report rendering engine as a library in your client software and not include the report building functionality.</p>
<ol>
<li><h3>Getting Started</h3>
 <ol>
  <li><h4>Requirements</h4>
  <p>MySQL Client Library and wxWindows 2.4.1.  We used wxWindows for the cross platform functionality - in hopes of being able to make reports render the same across any clients.</p>
  <li><h4>Database Setup</h4>
  <p><img src="img/database.jpg" align=right>First step is to create database connection.  To do this, click open BOLT, click 'Setup' and then click 'New'.  This doesn't create a database on your server, it just tells the client where it is.  Put in the important information, click Save.  Then click Ok to leave setup mode.  Double click on your database to get to the main screen.
  </p>
  <li><h4>Table Initialization</h4>
  <p>The first time you connect to a database, you should initialize the BITE tables.  These are the tables that will store the reports that you are building.  The table structure is included in a file called 'Init_Reports.bck' included in this distribution.  Click on the 'Restore' button, choose that file, and click 'Restore'.  The software will ask where the MySQL.exe program is locate (available in the tools folder), and you are ready to go.</p>
 </ol>
<li><h3>Data Selection</h3>
  <p>Since people vary rarely want to type in ID number of a record, BITE includes an easy way for the user to choose a record from the database.  These are called QuickPicks.</p>
 <ol>
  <li><h4>QuickPicks</h4>
  <p><img src="img/quickpick.jpg" align=right>QuickPicks are SQL queries that are grouped under a keyword.  The default databse include 4 QuickPicks under the class 'Reports'.  When you click on the 'Reports' button, those 4 queries are displayed.  When you expand a query, the results are shown, and you can choose a record to modify.  This functionality is available to you for your reports.  You can decide on a keyword, and make a number of queries that the user can navigate the records and make a selection.</p>
  <li><h4>QuickPick Editor</h4>
  <p><img src="img/quickpick_edit.jpg" align=right>QuickPicks must return an unsigned integer, and the integer is the first field in your query.  All other fields in the query are concatenated to form the label for the selection.  The title is the text that will be displayed in the quickPick list, and the class is the keyword you will use to identify a group of quickPicks.  Use the test button to see what the query will look like, and to test for syntax errors. <em> Make sure to Save the quickPick when you are satisfied.</em>.  Done closes the windows.
  </p>
 </ol>
<li><h3>Report Building</h3>
 <ol>
  <li><h4>Report Basics</h4>
  <p><img src="img/report_edit.jpg" align=right>A report is a collection of SQL queries laid out on a page.  The reports can be grouped together using triggers.  Queries can be be displayed as text, images, or subreports.  Your report can have a background image, which will be stored in the reportPictures table.  Lastly, your report can have parameters which the user inputs before the report is ran.</p>
  <li><h4>Triggers</h4>
  <p><img src="img/trigger.jpg" align=right>
  Using triggers you can group a series of reports together to call them all at once.  You can trigger these reports using the 'Stored Reports' section <em>see below</em>, or use the triggers in your application that has the Report Rendering library.  Using the trigger you can define the number of copies that will be output, and where to output them.  You can output to the screen, printer, disk, or another computer via FTP.  The details about these work just like clicking the similar buttons in the report editor, only the specific target is used when the trigger is sent.  This can enable you to display one report, print another 3 times, and save another on the hard drive; all with one command.  See the section on report rendering for more details.
  </p>
  <li><h4>Queries</h4>
  <p>
  The main reason for BITE is to display SQL queries.  You define queries, set the size and location, number of columns, and how many results per page.<br>
<img src="img/query.jpg"><br>
  Queries can include parameter values <em>(see next section)</em> that will be replaced at render time with the values of the parameters.
  </p>
  <p>There are 4 types for the output of the query.  
<ul><li>Text is used for formatted text, and you can define the font and size of text.  
 <li>String is useful for text only reports (like csv).  You set a character to seperate the fields and the rows.  <li>Image is used for outputing images stored in the database (assumes jpg format).  The query should return the actual data for the image (the BLOB field).  <li>Subreports are very useful, for each row of data that is returned by the query, the subquery report is ran using the fields to fill in the parameter values.
 </ul>
 The results are scaled to fit inside the space available.  You can set the records per page field to limit how many results will go in the box.  If more results than will fit are returned, a second (or more) page will be produced.</p>
  <li><h4>Parameters</h4>
  <p><img src="img/param.jpg" align=right>
  Parameters are variables for you report.  The parameter value is determined before the report is ran, and every time a query is processed, any term inbetween percentile marks (%%) will be replaced with the value of the parameter, as set by the user or parent report.
  </p>
  <p>Parameters can come in a number of types
 <ul><li>Date - a calendar is displayed for the user to choose a date.
 <li>Number - an integer value
 <li>Money - a number value with decimal information
 <li>QuickPick - this is where your quickpicks come in useful <em>(see above)</em>.  A drop down will let you choose which QuickPick Class that the user will be presented with.  QuickPicks can only return unsigned integer values, making it most useful for the auto_incrementing primary key of a record.
 </ol>
<li><h3>Report Rendering</h3>
 <ol>
  <li><h4>Stored Reports</h4>
  <p><img src="img/stored.jpg" align=right>
  The main screen of BITE has a list of 'Stored Reports'.  These are triggers that will be run (with optional parameter <em>See the Queries</em>, Setup, and Cleanup queries.  This can be useful for running database maintenance tasks and a set of reports in one step.  Type in a descriptive label (which will be displayed on the front screen), choose the trigger to run, and fill in any queries (not needed).  Click 'Done', click on the report in the list, and click 'Run'.
  </p>
  <p> The parameter Query is useful for setting parameter values of the query.  If the report takes a data parameter, and you want to have a report that runs for today, simple type 'select now();' in the parameter query field.
</p>
  <li><h4>Viewing</h4>
  <p>Either using triggers, or the 'View' button in the report Editor
<img src="img/view.jpg">
  </p>
  <li><h4>Printing</h4>
  <li><h4>Saving</h4>
  <li><h4>FTP</h4>
  <p>
  <img src="img/send.jpg">
  </p>
 </ol>
<li><h3>Data Backups</h3>
 <ol>
  <li><h4>Backup Reports</h4>
  <li><h4>Backup Database</h4>
  <li><h4>Restoring Backups</h4>
 </ol>
</ol>
</td></tr>

</TABLE>
