Got a report I need to create for an auditor and wondering if anyone has created anything similar or has any ideas on the best way to approach.
The report will be based off of the Item and Item Ledger Entry tables. For each item I'll want to report the total quantity on hand by Variant, Location and Bin. Anytime Item No., Variant, Location or Bin has a change in value I'll need to show the total quantity for that group. Would look something like this....
Item No.........Variant.........Location...........Bin.........Qty.
12345............XYZ................01..................A............10
12345............XYZ................01..................B............12
12345............XYZ................02..................A............20
12345............ABC................01..................A............15
TOTALS...................................................................57
Never tried writing a report with this many group totals before and am wondering if I can accomplish this easily by adding some keys and using the GroupTotals property on the item ledger entry data item, or am I better off just writing my own code to achieve this.
Any thoughts or suggestions are much appreciated.
0
Comments
2 dataitems on integer: 1 for the items and 1 for the item ledger entries. The one for the item ledger entries must be indented by 1.
Item - OnPreDataItem()
Item - OnAfterGetRecord()
Item Ledger Entry - OnPreDataItem()
Item Ledger Entry - OnAfterGetRecord()
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Just so I'm clear, how are you defining these?
recItemLedgerEntries
tmpItemLedgerEntries
tmpItem
tmpItemLedgerEntries : Table 32 but temptable
tmpItem : table 27 but temptable
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
First, where it shows the code to create the temptable. How are you setting up the dataitems for this report? Is this report setup with Integer as the main dataitem, and then recItemLedgerEntries, tmpItemLedgerEntries and tmpItem are setup as global variables (with the property on the later two set to temporary)? I guess in short, what is the correct way to set this up when I’m looking at the dataitem page? And is this code in the PreDataItem or OnAfterGetRecord trigger?
Second, where it discusses running the report on the temptable, and how that’s done I’m a little confused. Is this done is this done in the same report that the temptables are created? If so, again I’m not quite understanding how the DataItems would be setup for that.
Sorry for the newbie questions, but any clarification that can be provided is appreciated.
Mark
I created a small example that I saved as text and put it under here. You can copy the code, put it in a text-file and import it into Navision. So you can easily see how it works. I hope it will make things clearer.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n