Hi,
My Client needs a report that list all the Sales Order information(invoiced or not invoiced yet).
I got the information for this report from 2 tables, Sales Header (table 36) & Sales Invoice Header (table 112), cos Sales Order will be deleted whenever it invoiced.
The problem is, i need to union this 2 tables then sorted it by Sales Order number. How can I solve this?
Thx. Any help would be appreciated
0
Comments
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Thx for the reply. Sory, I'm still quite new in NAV.
A temporary table is variable with record type and set the property temporary:yes. Right?
Or a temporary table is a table (create new table), that is used only for this report?
Thx. Sory if my question kinda stupid
A temporary table is variable with record type and set the property temporary:yes.
Remember ... there are no stupid questions !
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Base on the replies from this post & the tutorials, I've created a new table, named TempHeader (No., SO number, Inv number, posting date, Cust No.).
In the report, I created a temporary table from TempHeader. Fill the temporary table from Sales Header & Sales Invoice header, then showed it using data item integer in the report. It worked.
But I need to group the TempHeader by Country, then by Customer. Also i need to show the detail of each tempheader (item, qty, amount, etc).
How to groupped temporary table in report?Thx a lot
Thanks
Country,Customer,order no,Invoice no,item no,line no,quantity,.....
//"Line No." is to make it unique in case the same item no is more than once in the same document.
-create an index on the fields on which you need to sort, so e.g.:
"Country,Customer,order no,Invoice no,item no"
-in your report, define multiple temptables based on the same table in which you fill only the fields you need for the grouping:
Now you define 3 dataitems in your report:
first : tmpGroup1
second : indented : tmpGroup2 with "Country" = tmpGroup1.Country.
third : indented twice : tmpDetails with Country and customer = the ones from tmpGroup2.
BTW : real tables you ONLY use as temptable (so you NEVER write them to the DB) you don't even need to put them in the license of the customer!
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
IMO, that's one for Tips&Tricks =D>
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
Use the Search,Waldo
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
So tmpGroup1, tmpGroup2, tmpDetails are record variables which are temporary:yes. Right?
How to define dataitem from those variables(tmpGroup1, tmpGroup2, tmpDetails)? Cos, as far as i know, i can't make dataitem from temporary records.
Thx
Check this for a report on temptables: http://www.mibuso.com/howtoinfo.asp?FileID=6.
And extra :
-the first dataitem works on tmpGroup1.
-the second dataitem works on tmpgroup2 and is indented AND shows only records in which tmpGroup2."Group Level 1" = tmpGroup1."Group Level 1".
So in the OnPreDataItem of group2, you put:
-third dataitem on the details filtered by group level 1 and group level 2.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Anyway, I'll try to convice my client to get the data from sales shipment header instead of sales header & sales invoice header. So we don't need to make any temporary table to do the sorting.
Thx for helps
How many records are there between the 2 tables and between header and details?
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
These are the records, my report read:
- Sales Header : 251 records
- Inv Header : 8089 records
- Sales Line : 305 records
- Inv Line : 11557 records
It generate 929 pages, in 2 minutes 55 sec.
I used 2 temporary tables before, for the header & the detail. But now, i used 1 temporary table to store both sales header & inv header.
Thx a lot for the helps