calendar

shamo
edited February 11, 2022 in Analytics #1
<p>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.</p>

Comments

  • <p>It's hard to tell without a report design to see what data is available, and the report layout and report items.</p>
    <p> </p>
    <p>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.</p>
    <p> </p>
    <p>Are you able to attach the report design (remove any credentials or hostnames, as needed), or create a sample using Classic Models?</p>
    Warning No formatter is installed for the format ipb
  • shamo
    edited September 18, 2017 #3
    <p>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.</p>
    <p> </p>
    <p>Thank you in advance</p>
  • <p>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.</p>
    <p> </p>
    <p>Are you able to attach the report design (remove any credentials or hostnames, as needed), or create a sample using Classic Models?</p>
    <p> </p>
    <p>Did you use this DevShare (<a data-ipb='nomediaparse' href='http://developer.actuate.com/community/forum/index.php?/files/file/443-birt-calendar-view-report/'>http://developer.actuate.com/community/forum/index.php?/files/file/443-birt-calendar-view-report/</a>) as a base? </p>
    Warning No formatter is installed for the format ipb
  • shamo
    edited September 18, 2017 #5
    <p>This is the report file</p>
  • Clement Wong
    Clement Wong E mod
    edited September 19, 2017 #6
    <p>Attached is an example.  I modified your report so that we have sample data using a Static Data Source.<br><br>
    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.<br><br><br>
    A. In the <em>beforeOpen </em>event of the Joined Data Set (in the example, it's called "Data Set"), initialize a variable:</p>
    <pre class="_prettyXprint">
        isReserved = false;</pre>
    <p> <br>
    B. Create a boolean computed column in the Data Set, and name it "Reserved".<br><br>
    Use the following expression:</p>
    <pre class="_prettyXprint">
    if (row["STARTDATE"]) isReserved = true;
    else if (row["FINISHDATE"]) isReserved = false;

    isReserved;</pre>
    <p>C.  Select the outer most Table.  Go to the Binding tab.  Click on Refresh.<br><br>
    This will add the "Reserved" column.   You have two extraneous columns ("Long Month" and "Monthyr" that you can "Remove").<br><br><br>
    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.<br><br>
    E. Go to the label's property and modify the Visbility properties.<br><br>
        1.  Check the "Hide Element" option<br>
        2.  Change the Expression to:</p>
    <pre class="_prettyXprint">
    if ((BirtDateTime.day(row["Start::Date"]) == null) && row["Reserved"]) false;
    else true;</pre>
    <p>F. Click on the newly created label from Step D (to select it).<br><br>
    G. Hold down CTRL (to copy) and drag it to the next column.<br><br>
    H. Repeat until all days are filled.<br><br><br>
     </p>
    Warning No formatter is installed for the format ipb
  • shamo
    edited September 19, 2017 #7
    <p>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</p>
  • <p>Good catch.</p>
    <p> </p>
    <p>Just update the Computed Column expression in Step E-2 to:</p>
    <pre class="_prettyXprint _lang-">
    if (row["STARTDATE"] && row["FINISHDATE"]) isReserved = false;
    else if (row["STARTDATE"]) isReserved = true;
    else if (row["FINISHDATE"]) isReserved = false;

    isReserved;
    </pre>
    <p>Attached is the updated example with the change.</p>
    Warning No formatter is installed for the format ipb
  • <p>Thank you very much. i struggled with the first logic line this afternoon.</p>
  • i have been searching the forum for 

    Creating a BIRT Report as a Calendar View solution, does anyone have the design file that comes with this solution