Create an Item Report by Customer

A guide on creating a report to track items by customers.

Updated over a week ago

This article will walk through creating a report listing customers and the items they have purchased.

In this article, we will first cover how to create the report:

And then we will show how to customize the Invoices List to show the report with filtering.

NOTE: This article will assume an intermediate knowledge of the Web Report Designer as well as customization. Objects you will use and properties of basic elements will not be explained in detail.

Create a New Report

  1. Navigate to Account Settings Reports and Print Templates.

  2. On the Reports' All Templates screen, click New.

  3. Name the report "Item Report by Customer" with a description of "InvoiceLine report by Customer".

  4. For the Base table, select the InvoiceLine table. Any items a customer purchases will be stored in the InvoiceLine table, which keeps track of line items on an invoice.

  5. Click Launch Builder to start creating the report.

List out Items in the Report

In this section, we will build an initial report to show all the items from the InvoiceLine table.

  1. Select the database icon on the right menu, and expand your account and then the InvoiceLine table.

  2. From the InvoiceLine table, drag these three fields into the Detail1 band: Item, Quantity, and Amount. Remember to resize the Detail1 band so each row is smaller in the report.

Feel free to preview the report to see if the items list properly.

Create a Customer Name Linked Field in the InvoiceLine table

In order to group the items by customer, the report needs the customer name in the InvoiceLine table, however the table does not contain the Customer name. It does, however, contain a dropdown field of the Invoice table which holds the customer name, so we'll add in a linked field to pull in the customer's name.

  1. Save your report.

  2. Open up a new tab or window and sign into your Method account.

  3. Navigate to Account Settings Tables & Fields.

  4. Search for the InvoiceLine table and select it in the grid.

  5. Add a new field:

    • Field Name: InvoiceCustomerName

    • Field Type: Linked

    • Linked Using: InvoiceRecordID

    • Linked Field: Customer

Group Items by Customer

  1. Go back to your report and refresh the screen. This will ensure the new field you created will show up.

  2. On the right menu, select the cog icon, and then click the icon to Insert Group Header Band.

  3. On the right menu, select the database icon. Into the group header, drag in the new InvoiceCustomerName field you created within the InvoiceLine table.

  4. Select the GroupHeader1 handle on the grid to bring up its properties.

  5. Expand the ▶ GROUP FIELDS and then click the Add icon.

  6. For Group By, select the InvoiceCustomerName field.

  7. To make it easier to see, style the report.

    • Bold the Customer name field

    • Indent the fields in the Details1 band.

    • Make the rows shorter.

    • Format the Amount field: set its Text Format String to Currency.

    • Add a GroupFooter1 band (best practice to have matching group header and footers.

Preview the report to see if things list out to your satisfaction.

Summarize Items

You may have noticed in your preview each item is listed individually because they are taken from separate invoices. You can group all the items into one line.

  1. Add another group header and footer to get GroupHeader2 and GroupFooter2.

  2. Change the Level of GroupHeader1 to 1 so that it's the top header. I've also changed the name of this group header to "GroupCustomer".

  3. Select and change name of GroupHeader2 to GroupItem. This header will group the items so the same items will be grouped together. Note, there are no fields inside of this band, it's empty.

  4. Still with the GroupItem header band selected, add a new Group Field. Change the Group By to the Item field.

  5. Of course, now that the items are grouped together, you only want to see one of each item, as well as a sum of their amounts and totals. This will be done in the footer band we created. Select all the fields in the Details1 band, and drag them to the footer below, GroupFooter1. Change the name of the band to "GroupItemSummary".

  6. Fields that are placed in a group band can have summary functions applied to them. Select the Quantity field, and expand Summary. Change Running to Group, and keep the function at Sum.

  7. Do the same for the Amount field. Select it, and change its Running to Group with the default Function of Sum.

When you preview this, items will be grouped under each customer with their total amount and cost.

Customer Total Amount

The second footer created will give a summary for the customer. Similar to the item summary, this will be a customer summary that will show the total amount spent.

  1. Copy the Amount field which is in the GroupItem footer band.

  2. Select the GroupFooter2 band, and paste a second Amount field. Feel free to rename the footer band to GroupCustomerSummary.

  3. You can also drag in a line object and place it about the second Amount field.

  4. Save the report!

With this, the basics of the report are done! Feel free to style the report with a proper report title, date field, page numbers, coloring, whatever you feel is necessary for your reports.

Customize the Invoice List Screen

When you are satisfied with your report, you will want it display results in Method, probably with filtering. In this example, we will display the report with date filtering, and set the parameters for the filter on the Invoice List screen.

  1. Back within Method, customize the Invoice List screen and Create a copy of the screen.

  2. At the bottom of the screen, drag in a new section and call it SectionReporting. Give it three rows and four columns. Change its Top Padding to 1x.

  3. Select the first row and column, and set its Column Width to 25%.

  4. Into their own rows, drag in two DateTimePicker objects and a Button object.

  5. Name the first two DateTimePicker objects "From" and "To" respectively, and name the Button object "Generate Item by Customer Report".

  6. Change the Display Format for the DateTimePickers to be Short Date.

  7. Edit the Button's Click Event.

  8. Add a Generate Report action.

  9. For the report, select the report we created "Item Report by Customer".

  10. Click Open Criteria Builder. and then ⊕ Add a Condition.

  11. For the first condition:

    • InvoiceTxnDate for first field to compare to

    • Greater than or Equal to Operator

    • From for second field to compare to

    • Compare dates using Date.

  12. Click ⊕ Add another Condition and for the second condition:

    • InvoiceTxnDate for first field to compare to

    • Less than or Equal to Operator

    • To for second field to compare to

    • Compare dates using Date.

  13. Keep all the defaults for this action, but put in an internal note for this action.

  14. Close the action list and also close the designer screen.

Your page is done! Feel free to add more buttons that filter by other customer, sales rep, item, etc.

Did this answer your question?