Reports: Difference between revisions
Line 26: | Line 26: | ||
==Table== | ==Table== | ||
A Table can be created in 3 different ways. | A Table can be created in 3 different ways. | ||
#A single table. | #A single table. | ||
#An SQL statement created with the [[SQL Builder]] | #An SQL statement created with the [[SQL Builder]]. | ||
#A PHP [[Procedures|Procedure]] that | #A PHP [[Procedures|Procedure]]. | ||
The point of using a Procedure is to create a temporary file that will be used as the data for the Report. | |||
(By choosing a single table or SQL record created by the SQL Builder, this is done automatically) | |||
A Procedure example... | |||
<source> | |||
$s = " | |||
SELECT | |||
sta_last_name, | |||
sta_initials, | |||
sta_games, | |||
sta_runs, | |||
sta_captain, | |||
CONCAT(sta_last_name, ',', sta_initials) AS full_name, | |||
1 AS player | |||
FROM | |||
stats | |||
"; | |||
nuRunQuery("CREATE TABLE #TABLE_ID# $s"); | |||
</source> | |||
This Lookup contains all these types. | This Lookup contains all these types. |
Revision as of 21:38, 20 January 2018
nuBuilder Forte can create PDF Reports from the data stored in its database tables.
There are 3 things needed to create a Report.
- An Edit or Launch Form that contains values used by the Report eg From Date and To Date.
- A Table containing data to be used by the Report.
- A Report designer to create the way this data is displayed.
These Reports will allow the user to do things like...
- Share information with others.
- Help make business decisions.
- Create invoices.
- Print graphs.
Building a Report
Code
A unique code for this Report
Description
The description of this Report
Group
A field that can be used to help organise Reports.
Table
A Table can be created in 3 different ways.
- A single table.
- An SQL statement created with the SQL Builder.
- A PHP Procedure.
The point of using a Procedure is to create a temporary file that will be used as the data for the Report.
(By choosing a single table or SQL record created by the SQL Builder, this is done automatically)
A Procedure example...
<source>
$s = "
SELECT
sta_last_name, sta_initials, sta_games, sta_runs, sta_captain, CONCAT(sta_last_name, ',', sta_initials) AS full_name, 1 AS player
FROM
stats
";
nuRunQuery("CREATE TABLE #TABLE_ID# $s");
</source>
This Lookup contains all these types.
- All of the tables have 'nuTable' as their code.
- All of the SQL records have 'nuSQL' as their code.
Launch From
A Launch Form will allow..
- The user to define the information to be stored in the table that will be used by the report.
- Run the Report from an Action Button at the top of the Form.
Report Designer
nuBuilder Forte has its own Report Designer.
Running A Report
There are 2 ways to launch a Report.
- Click the Run Report Button on the Setup Tab of the Home Form.
- Create a Button with a custom click event using nuRunReport().