Run a report day by day by with a specified date range
                
                    emulsified                
                
                    Member Posts: 139                
            
                        
            
                    I need to have a report that runs for a given date range: 04/01/12..04/30/12
Normally I enter this into a Posting Date or Date Range on the request form of the report.
For reasons that are too cumbersome to explain I need to be able to specify my date range of 04/01/12..04/30/12 and have the report run each day within the range one at a time.
I know this is possible but not sure what code would be best and where in the report to put it. I'm thinking I can grab the Posting Date/Date Range filter entered and then manipulate that and tell the report to do one date after the other withing the range.
I don't want my user to have to manually run the report one date at a time.
So how would I get the filter and tell the report to run through the date range one date at a time?
                Normally I enter this into a Posting Date or Date Range on the request form of the report.
For reasons that are too cumbersome to explain I need to be able to specify my date range of 04/01/12..04/30/12 and have the report run each day within the range one at a time.
I know this is possible but not sure what code would be best and where in the report to put it. I'm thinking I can grab the Posting Date/Date Range filter entered and then manipulate that and tell the report to do one date after the other withing the range.
I don't want my user to have to manually run the report one date at a time.
So how would I get the filter and tell the report to run through the date range one date at a time?
Half-empy or half-full how do you view your database?
Thanks.
Thanks.
0                
            Comments
- 
            So you want 04/01/12..04/30/12 today
04/02/12..05/02/12 tommorrow
04/03/12..05/03/12 the next day
is that what you are saying?
or are just looking for a set nunber of days on the day you run the report? Say 30days for example?0 - 
            User Filter: 04/01/12..04/30/12
Report runs to each day in range:
04/01/12
04/02/12
..
..
04/30/12Half-empy or half-full how do you view your database?
Thanks.0 - 
            Some thoughts:
- At the beginning of each "new day" in the report you want to have a page break and a header output. It will look :shock: like separate reportsIf lastDate <> Rec.Date THEN pagebreak; lastDate := Rec.Date;
- You may be able to use the "Group" functionality in reports... personally I never got the hang of this though other like it.
- You could add an additional dataitem as the first item: Date. From there you can then run the rest of the data items per day (or week, month, etc...)
- Reinhard0 - 
            Personally (and if it fits your needs) I would insert a new element at the top of DATE and indent everything under it. Set date type filter to DAY and then let the user filter the start date, then let that loop day by day.David Singleton0
 - 
            David Singleton wrote:Personally (and if it fits your needs) I would insert a new element at the top of DATE and indent everything under it. Set date type filter to DAY and then let the user filter the start date, then let that loop day by day.
So are you saying to create a new DATA item on the outermost/topmost level of the report and set the data type to DATE?
Okay. I went to my report and created DATE at the top level and indented my existing data items under it. So now I have this:
Date
...Salesperson/Purchaser
......Customer
.........Value Entry
When I run the report:
"Date" tab I enter:
Period Type Date
Period Start 04/01/12
Period End 04/30/12
"Salesperson" tab I enter:
Code SM
"Customer" tab I enter:
Customer C006235
"Value Entry" tab I enter:
Item No. *@SALE|A*
Posting Date (This is where the date range is usually specified but Navision doesn't output correctly for date ranges so needs to be 1 day at a time, do I need to somehow copy the current date from the iteration of the topmost level "Date" to this filter? Does it need to be passed into here somehow while the report is looping through the topmost level "Date"? I'm not understanding.)
"Options" tab I enter:
Salesperson To Use: Assigned To Customer
When I run the report as specified above I get 0 pages generated. Do I need to somehow pass each date from the topmost level "Date" of the report to the Value Entry tab Posting Date filter? If so I'm confused on this. I think this is what you we're trying to tell me but I'm not sure. If it is I'm not sure how to do this.Half-empy or half-full how do you view your database?
Thanks.0 - 
            "Date" tab I enter:
Period Type Date
Period Start 04/01/12..04/30/12
Period End 04/30/12David Singleton0 - 
            David Singleton wrote:"Date" tab I enter:
Period Type Date
Period Start 04/01/12..04/30/12
Period End 04/30/12
Thanks David. That made it work with one problem. The invoice and items listed when the report is run is not obeying/keeping each customer's invoice under their own heading on the report. I know it has to do with the DataItemLinkReference being changed from Customer to Date and DataItemLink being changed from Source No.=FIELD(No.),Global Dimension 1 Code=FIELD(Global Dimension 1 Filter),Global Dimension 2 Code=FIELD(Global Dimension 2 Filter) to Posting Date=FIELD(Period Start)
How can I use the Date table but still keep the report working correctly? Is there a way that I can just set the Posting Date of the Value Entry tab via code somewhere on each iteration through the Date table? Would that be the easiest way to fix this problem?Half-empy or half-full how do you view your database?
Thanks.0 - 
            Sounds like you messed up the indentation.David Singleton0
 - 
            David Singleton wrote:Sounds like you messed up the indentation.
How is the indentation supposed to look and do I need to be messing with DataItemLink.... etc?Half-empy or half-full how do you view your database?
Thanks.0 - 
            emulsified wrote:David Singleton wrote:Sounds like you messed up the indentation.
How is the indentation supposed to look and do I need to be messing with DataItemLink.... etc?
I think I solved it. Can you confirm that this makes sense? My original problem http://www.mibuso.com/forum/viewtopic.php?f=23&t=52804, the reason for this post.Half-empy or half-full how do you view your database?
Thanks.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
 - 323 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
 
