MYOB Greentree

HideShow

  • Contents
  • Index
  • Search
 
Display results with all search words

 

Adding Collections (Repeating Sections)


You can create repeating data sections in reports using database collections, which contain the data you are most likely to need access to. For example, to report information about customer invoices. To do that:

Step 1:

Select the Report Body section and click the Field Palette toolbar icon to display the Available Fields Palette.

The Database tab always default in the first instance to display Company as the base class, from which you can drill down to find the information you require. The basic principle is that the company owns various collections, such as a collection of branches (allBranches).

Click the allCustomersCode collection in the myARControl reference, then drag and drop the collection into the report body section (blue area).

The ARControl.allCustomersCode collection is imbedded into the Company collection. The Available Fields Palette now displays the database fields for the Customer class.

Note: Each report uses Company as its base class. To write a report that has multiple repeating sections, you can change the base class to be the first collection — in this example, the Customer class. When you drag the first class to the report, drag it into the grey area named Report body instead of dragging it into the blue section area.

When a new section is added, the section name defaults to the database field name (in this example: myARControl.allCustomersCode. You can re-name the section to something more meaningful by accessing the section properties and changing the name.

Step 2:

Since it is ultimately customer invoice information to output to the report, the next step is to find the transaction collection in the customer class — in this case, allARInvoices. Drag and drop the allARInvoices collection into the report section.

The allARInvoices collection is now imbedded in the myARControl.allCustomersCode collection, and the Available Fields Palette displays the Transaction class, which contains data relating to all transactions.

Step 3:

In this example, an additional step is required to limit the Transaction class to a subclass containing AR invoices only. This is because the Transaction class contains data relating to all transactions, not just AR invoices (as all transactions have some common properties).

Information generic to transactions can be accessed using the Transaction class, but to access information specific to AR invoice transactions, you must limit to the ARInvoice subclass. This is done using the Section Properties for the allARInvoices section.

Access the section properties for the allARInvoices section.

In the Type section, change the type from Transaction (class) to ARInvoice (class). This is done by clicking the arrow icon and scrolling down the list of transaction subclasses until you find the one you require. When you select ARInvoice, the Available Fields Palette for the allARInvoices section updates to display database fields specific to the ARInvoice transaction subclass.

Note: When this report runs, the collection of AR invoices print for each customer. Since the allARInvoices collection is embedded into the allCustomers collection, the first customer prints, followed by the invoices for that customer.

The second customer prints, followed by the invoices for that customer, and so on. You can determine the sort order within sections using section properties.

Step 4:

When you have created the repeating data sections you require, you can begin adding fields to report sections.

Data can be totalled, sorted and queried within sections and various properties can be assigned.

When you are designing a report, check the output throughout the process to ensure you are on the right track. If you make an mistake, it is easier find and fix it as you make incremental additions, rather than when the report is complete.