Reports
Now that the tables are there and the form populates and does CRUD operations on them, we can look at how a report is generated (PDF) in this case, a specific Invoice Print.
1. We generate a nuSQL to populate the Invoice PDF by navigating to Home => Builders => SQL => Choose customer, product, invoice and item tables and prepare the relationships.
ReportSQL_Design.png
ReportSQL_Design_2.png
The SQL so obtained is:
Code: Select all
SELECT
customer.*,
invoice.*,
item.*,
product.*
FROM
customer
JOIN invoice ON customer.customer_id = invoice.inv_customer_id
JOIN item ON invoice.invoice_id = item.ite_invoice_id
JOIN product ON product.product_id = item.ite_product_id
WHERE
((invoice.invoice_id = '#RECORD_ID#'))
2. Prepare a Fast Report using the nuSQL created above as the "
Table"
PizzaFastReport.png
3. Build the Report by adjusting the Fast Report created above navigating to
Home => Builders => Reports and choosing the Fast Report just created above as:
BuildReport.png
3. Now Adjust the Report Layout by clicking the
Report Designer button to finally become:
ReportDesigner.png
4. The Report Orientation is set using
Report Properties:
ReportOrientation.png
5. Alignments are done using
Adjust Objects:
AdjustObjects.png
6. Field object parameters are set in
Object Properties:
ObjectProperties.png
7. In the Invoice Form, we put in a "
Print Invoice" Button by going to
Home => Forms => Invoice => Form Properties and in the JS we put in:
Code: Select all
if(nuFormType() == 'edit' && !nuIsNewRecord()){
nuAddActionButton('InvoiceButton', 'Print Invoice', 'nuRunReport("INV")');
}
Invoice_Form_Print_Invoice_Button.png
8. Finally we navigate to
User Home => Invoice => Choose the Invoice => Print Invoice at:
PrintInvoice.png
You do not have the required permissions to view the files attached to this post.