calendar

I need help with a reservation report. What I need to happen is,  I have a calendar data set which I got from this forum which gives me the calendar days. I have two datasets. 1 for start time and the second for Finish time. I first joined start to finish to for a dataset and then joined that resulted dataset to the calendar to achieve the attached result. What I need to happen is, I want to be able to indicate with "X" on the 15th that it is also booked. Any help will be much appreciated.


Comments

  • It's hard to tell without a report design to see what data is available, and the report layout and report items.


     


    I can only speculate that since you have a start and finish, the day(s) that you would like to mark an X, you can check that day if it falls between the start and end date.  If using a Data report item, via the Map (tab) under Property Editor - Data.


     


    Are you able to attach the report design (remove any credentials or hostnames, as needed), or create a sample using Classic Models?


    Clement Wong
    Principal Analytics Architect

    OpenText Corporation
    http://www.actuate.com | http://www.opentext.com

  • edited September 18, 2017

    The problem is, the day that falls between the start date and finish date like the 15th is neither in any of the dates. I need a logic that will give me the option to detect that date and mark as not available.


     


    Thank you in advance


  • How are you building the calendar?  Specifically, I would like to see the data fields and report items that make up a "day" in your grid.


     


    Are you able to attach the report design (remove any credentials or hostnames, as needed), or create a sample using Classic Models?


     


    Did you use this DevShare (http://developer.actuate.com/community/forum/index.php?/files/file/443-birt-calendar-view-report/) as a base?


    Clement Wong
    Principal Analytics Architect

    OpenText Corporation
    http://www.actuate.com | http://www.opentext.com

  • edited September 18, 2017

    This is the report file


  • Clement WongClement Wong EM, Member mod
    edited September 19, 2017

    Attached is an example.  I modified your report so that we have sample data using a Static Data Source.


    The method I used was a computed column in the Joined Data Set to indicate whether a day is reserved or not.  Then, we will use this column in the visibility of the "X" label for each day.



    A. In the beforeOpen event of the Joined Data Set (in the example, it's called "Data Set"), initialize a variable:



        isReserved = false;

     

    B. Create a boolean computed column in the Data Set, and name it "Reserved".


    Use the following expression:



    if (row["STARTDATE"]) isReserved = true;
    else if (row["FINISHDATE"]) isReserved = false;

    isReserved;

    C.  Select the outer most Table.  Go to the Binding tab.  Click on Refresh.


    This will add the "Reserved" column.   You have two extraneous columns ("Long Month" and "Monthyr" that you can "Remove").



    D. Create a label in the first day of the grid -- above the "STARTDATE" report item.   Type in "X".  Change the horizontal align to Center.


    E. Go to the label's property and modify the Visbility properties.


        1.  Check the "Hide Element" option

        2.  Change the Expression to:



    if ((BirtDateTime.day(row["Start::Date"]) == null) && row["Reserved"]) false;
    else true;

    F. Click on the newly created label from Step D (to select it).


    G. Hold down CTRL (to copy) and drag it to the next column.


    H. Repeat until all days are filled.



     


    Clement Wong
    Principal Analytics Architect

    OpenText Corporation
    http://www.actuate.com | http://www.opentext.com

  • edited September 19, 2017

    Thank you for the response and report. It is close but not there yet. from the 2 screen shots, there are X which are not to be there. Like the one on day 30 and those from 16 to the 30th. the reservation end on 15. What I have realized is that, when both start and finish are on the same day, the X repeats on the subsequent days.Hope I made it clear this time


  • Good catch.


     


    Just update the Computed Column expression in Step E-2 to:



    if (row["STARTDATE"] && row["FINISHDATE"]) isReserved = false;
    else if (row["STARTDATE"]) isReserved = true;
    else if (row["FINISHDATE"]) isReserved = false;

    isReserved;

    Attached is the updated example with the change.


    Clement Wong
    Principal Analytics Architect

    OpenText Corporation
    http://www.actuate.com | http://www.opentext.com

  • Thank you very much. i struggled with the first logic line this afternoon.


Sign In or Register to comment.