Reports

david.weeks
Member Posts: 96
Hello All
I have two data items, Item and Item Ledger Entry.
Sometimes, no records will exist within the Item Ledger Entry.
I still want the Item section to be output and my question is therefore, what approach should I take to output a message of "item ledger history does not exist", if no records exist in the Item Ledger Entry table.
Currently, the sections I have are Item body, Item Ledger Entry body(i dont output this as this is used to calculate totals only) and Item Ledger entry footer for the totals.
Ideas?
Thanks
I have two data items, Item and Item Ledger Entry.
Sometimes, no records will exist within the Item Ledger Entry.
I still want the Item section to be output and my question is therefore, what approach should I take to output a message of "item ledger history does not exist", if no records exist in the Item Ledger Entry table.
Currently, the sections I have are Item body, Item Ledger Entry body(i dont output this as this is used to calculate totals only) and Item Ledger entry footer for the totals.
Ideas?
Thanks
0
Comments
-
u should create and third dataitem Integer on the same level as Item, then use in its OnPreDataItemTrigger :
VarDispNoILE:=(DataItemLedgerEntry.COUNT=0)
and use this var to condition the display of the messageNavision 3.70 Developper0 -
Hi,
if you need the item ledger entry's for totals, can't you do it using the existing flowfields in combination with flowfilters on the item card ?0 -
Hi Coslau,
Thanks for the message. This did give me alot more ideas.
Unfortunately, its still not working.
(Although I "think" I have tried every section, what section would you place the label and subsequent onpresection code in?
Also, should I definately place the integer data item in this order?
Item
Item Ledger Entry
Integer
Thanks again0 -
Hello David,
If you decide to use the Integer dataitem remember to set maxiteration to 1.
Add a variable type boolean set it to true in the Item Ledger Entry dataitem if it finds a related item ledger entry for the item.
Then on the body section for the integer display your message if the boolean is false else don't display the message.
Remember to reset the boolean for each item.
You can also just a a second body section for the item which will display the message. Insert code on the related section to see if it can find any related item ledger entry. If it FIND('-') don't display the section else display.
Hope it helps
Regards
Rabe0 -
If I understand correctly, you always show some Item details in Section “Item body” and then some totals from Item Ledger Entries shown in “Item Ledger Entries Footer” if entries exist.
You don’t need ILE body section if you never show it. Delete it. If you have some calculation there behind, you should move it to ILE-OnAfterGetRecord Trigger.
Now define a Global Boolean “EntriesExist”.
In ILE-OnPreDataItem write:EntriesExist := FALSE;
In ILE-OnAfterGetRecord write:EntriesExist := TRUE;
Then Add another ILE Footer section after your’s Totals footer and put a single label there with caption “No entries for this item…”
Then put following code in first ILE-Footer OnPreSectionTrigger (for totals):CurrReport.SHOWOUTPUT(EntriesExist);
And on the second ILE-Footer OnPreSectionTriggerCurrReport.SHOWOUTPUT(NOT EntriesExist);
It means if entries exist for item the “totals footer” will be displayed (OnAfterGetRecord will set entriesExist=TRUE).
If Entries does not exist then the second footer will be shown (OnPreDataItem will set entriesExist=FALSE, but ILE-OnAfterGetRecord will not happen for this item).
No additional dataitems, no additional counting…®obi
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions