You can call a sproc or view that joins and/or unions tables together. Include all the fields you need in your report and group them, then supress groups to avoid dup headings, "customer name" in your case so the name only prints once, and set the group properties to print on each page; keep 'em grouped together, too. Your sproc would return a recordset looking something like:
(CustomerName, InvoiceID, ItemCode, Desc, Qty, Amount, Total, ...)
'Sam Adams', 123, 'ABC', 'Pencil', 3, 0.19, 0.57, ...
'Sam Adams', 123, 'DEF', 'Eraser', 1, 0.39, 0.39, ...
'Sam Adams', 124, 'XYZ', 'Folder', 2, 1.39, 2.78, ...
'Bob Smith', 301, 'AAA', 'Box', 2, 3.95, 7.90, ...
'Bob Smith', 302, 'BBB', 'Box', 1, 3.95, 3.95, ...
'Bob Smith', 302, 'CCC', 'Labels', 1, 4.95, 4.95, ...
You can also call a sproc that returns a dataset of 2+ recordsets, but it's usually not necessary for simple reporting.
|