I know what I want.
A simple report based on Sales Invoice Line table that will show only a single instance of "No." in the report even if it shows up multiple times. Explained in simpler terms: I want to provide the Type=Item, Posting Date=Whatever, Quantity=0 and just show me what was invoiced at ZERO in a DISTINCT fashion no matter what the date range happens to be.
When I run this report I am setting the following on the request form:
Type = Item
Posting Date = 02/01/07..02/28/07
Quantity = 0
I'm pretty sure I know what steps need to be done just not how to do each step or so I think so anyway.
I believe I need to create a TEMPORARY TABLE and somewhere in a "OnPre" section I need to write some code that takes my input from the request form then somehow ONLY INSERT into the TEMPORARY TABLE when the value for "No." DOES NOT exist in the TEMPORARY TABLE. I believe this will leave me with a TEMPORARY TABLE full of lines/records that are DISTINCT.
If Navision Native DB C/SIDE had a SELECT DISTINCT type function for Native DB then I wouldn't be so confused.
I have already tried creating a KEY on the Sales Invoice Line table and grouping by it, that did not work at all.
Can someone please help me out? Explanation of how and I will be grateful. Some code or an actual object with ID set to 50111 and I will be forever grateful, heck I may even send a gift out.
Any help would be great. Thanks.
Half-empy or half-full how do you view your database?
Thanks.
0
Comments
How did that not work? If you added a new key of "No." you'll will be able to create a group for it using the report wizard. "Tabular type". I know my posted sales line table is very large adding another key would really make it huge
more info...
http://www.mibuso.com/forum/viewtopic.php?t=6773
http://www.BiloBeauty.com
http://www.autismspeaks.org
Sort this dataitem by using this key.
Then at the begining of OnAfterGetRecord triger put a code
SETRANGE("No.","No.");
FIND('+');
SETRANGE("No.");
Okay I have created a new report but it seems like it runs forever, it never actually stopped after about 5 minutes of letting it run with the following in the request form:
Posting Date = 02/02/07..02/26/07
Type = Item
Quantity = 0
Here is the code:
Thanks.
(4,207,215 Records) it's not gonna be a fast report.
did you make your new key
No.,Posting Date ?
http://www.BiloBeauty.com
http://www.autismspeaks.org
Would it be faster to set some keys, ranges, filters, etc.. loop through them extracting "No." = 0 writing it the TEMP table and then at the end showing it on the report? Wouldn't the Navision C/SIDE Native DB INSERT act just like a SQL "INSERT IGNORE" statement?
I wish this was faster. The only values I care to know about are the "No." and its Quantity by whatever filters I specify of course.
Thanks.
I would add the fields that you would be using as your main filters.
Item , Posting Date , Type or maybe Type,Item No,Posting Date.
I'm assuming your trying to get something like
Item ABC
-2/12/2008 = 12 outs
-3/14/2008 = 10 outs
-4/15/2008 = 9 outs
You can always delete the key later if it doesn;y give you what you need.
This is the kind of report I love Crystal Reports for =P~
have you tried the report with just todays date to see it's speed before jumping right into feb 2007 n such?
Also that link to reports & temp tables is good.
http://www.BiloBeauty.com
http://www.autismspeaks.org