Is it possible to group the data from two tables?

In a Report I need to group the data from “Employee Code”, and “Item Category Code”. “Employee Code” is from Sales Invoice Header Table and “Item Category Code” is from Sales Invoice Line table.

Is it possible to group data from two tables?

No.

You need to take data in buffer table from both the table or else add one of the column in another table

i.e. Employee code in Sales Invoice Line

and create a key required fields.

No, but your grouping wouldn’t make sense anyway. If employee code is on the header then there is only one of them.

What I understand here is that you need the report to print the data in the following manner:

First Employee from Sales Invoice Header, then all the records from Sales Invoice Line linked through the Sales Invoice number (from header) and group the records on Item Category Code, then probably a total and the next item category code and so on. One the first invoice is complete you start with the next invoice number for the same employee. Once the first employee records are all printed, you will start printing the next employee.

If this is your requirement, you can achieve this in NAV.

4073.GroupedReport.jpg

Thank You Chinmoy Sir,

But I need the data from both the sales header and sales line synchronizationly.

The “Field Office” and “Employee Name” comes from the sales header table while the “Product” comes from sales line table.

So I want to know if this is possible, after all i need to group the data and find the total.

Yup… that’s what I have suggested. In the report you have to take the first dataitem as Sales Invoice Header and second one (indented below) as Sales Invoice Line linked with the Sales Header through No. = Document No. field. You have to create a key in Sales Invoice Line table on “Item Category Code” and set this key in the DataItemTableView property of the Sales Invoice Line dataitem and the data in the report will automatically come in the proper order.