Run a report day by day by with a specified date range

emulsifiedemulsified 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?
Half-empy or half-full how do you view your database?

Thanks.

Comments

  • SavatageSavatage Member Posts: 7,142
    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?
  • emulsifiedemulsified Member Posts: 139
    User Filter: 04/01/12..04/30/12

    Report runs to each day in range:
    04/01/12
    04/02/12
    ..
    ..
    04/30/12
    Half-empy or half-full how do you view your database?

    Thanks.
  • ReinhardReinhard Member Posts: 249
    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 reports
    If 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...)

    - Reinhard
  • David_SingletonDavid_Singleton Member Posts: 5,479
    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 Singleton
  • emulsifiedemulsified Member Posts: 139
    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.
  • David_SingletonDavid_Singleton Member Posts: 5,479
    "Date" tab I enter:
    Period Type Date
    Period Start 04/01/12..04/30/12
    Period End 04/30/12
    David Singleton
  • emulsifiedemulsified Member Posts: 139
    "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.
  • David_SingletonDavid_Singleton Member Posts: 5,479
    Sounds like you messed up the indentation.
    David Singleton
  • emulsifiedemulsified Member Posts: 139
    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.
  • emulsifiedemulsified Member Posts: 139
    emulsified 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.
Sign In or Register to comment.