a

Customers x Orders Report

On this tutorial it is shown how to use nested grids / reports. To build this sample application it is used two grid applications, one based on the Customers table (Master app) and another based on the table Products (Detail app).

Creating the "detail" application

1. Create a new grid application based on the Orders table.

2. Update the properties Table Width and Table Width Unit to 100 and Percent respectively.

   

3. On the application menu , click in the SQL item.

   

4. Add the lines below to the SQL existing statement, the content between [square _brackets] is a global variable, using global variables it is possible to pass parameters between applications. Nested grids usually require a parameter to run.

WHERE
CustomerID = '[v_customer]'

5. On the ScriptCase's toolbars click in the button Generate Source.

   

Creating the "Master" report

6. Create a new report application based on the Customers table.

7. Set up the Orientation property to Slide.

   

8. Access the Toolbar menu.

   

9. On the Top Toolbar enable the buttons: First, Previous, Next, Last, Rows Limit, PDF e HTML. Use the Center alignment.

   

10. On the Toolbar menu access the Options tab.

   

11. Enable only the properties Display Titles e Display Summary

   

Creating the "SubGrid" link

12. Click in the Nested Grid folder. Open the Links menu an then click in New Link.

   

13. Enter subgrid and Orders for the properties Name and Label respectively. Click in the Create button.

   

14. Select the "detail" report an then click in Next.

15. Enter the value to pass to the parameter [v_customer]. Select the Field option and choose the CustomerID field on the drop list, click in the Save button to end this process.

Using Blocks to organize the report lay-out

16. Open the Layout folder and click in the Blocks item.

   

17. Click in Create New Block to create a new HTML table.

   

18. On the properties Name and Label enter Business. Click in Create.

   

19. Repeat the last step and create a block called: Orders.

20. Set up the two blocks using the settings below.

   

How to arrange the fields "into" the BLOCKS

21. On the Application menu access the item Select Fields.

   

22. Arrange the fields using the model bellow:

Block Field
General CustomerID
CompanyName
ContactName
ContactTitle
BirthDate
Adress
CityID
RegionID
PostalCode
Country
Phone
Fax
Business CreditLimit
Notes
Orders subgrid

Untitled Document

Rate this Tutorial
Bad Great
Leave your comments (optional).