Calendar
6 minutes to readA Calendar DataPart shows records from a table or view as events on an interactive calendar. App users switch between calendar views, move or resize events by drag and drop, and open AppPages to create or update events. It fits scheduling, bookings, shift planning, and event tracking.
Steps to create Calendar Reports
Creating a Calendar takes one step in the wizard. You select a data source and map three fields. After you save, you configure the Calendar in the right panel.
- In the left navigation, select Designer.
- Select the AppPage where you want the Calendar.
- Select Add elements.
- In the elements panel, select Calendar under Reports section.
- Under Data source, select a table or view. Use the search box to find it, or browse Tables & views in application and Other tables & views.
- In the Select fields step, drag a field from Available fields into each required drop zone:
- Start accepts a Date/Time field.
- End accepts a Date/Time field.
- Title accepts the field that names each event.
- Select Save.
You must map all three fields before you can save.
Configuring additional options for a Calendar
After creating a Calendar, in the right panel, you can configure additional options of the DataPart. The following configurations are available:
DataPart configuration
- Change data source and fields — select this button to change the data source, or to change the fields mapped to Start, End, and Title
- Heading — the heading shown above the Calendar
- Description — the text shown below the heading
- Size — the size of the Calendar on the AppPage
Data filters
Select Data filters to set up criteria for DataPart filtering. Learn more.
Interactive controls
In this section, you can enable additional actions for app users. Depending on the place on your DataPart where you want the controls to appear, you can add the following types of interactive controls:
- Header controls are buttons that app users select to go to an AppPage or a URL. They appear in the title area of the DataPart.
- Event controls let app users work with events directly on the Calendar. App users can open an event to view or edit it, add a new event, or move an event to a different time.
- View/Edit lets app users preview and edit event details on a separate AppPage, either a regular AppPage or an overlay. Select the AppPage that opens when an app user selects an event.
- Add lets app users create an event by selecting an empty area of the calendar. Select the AppPage, regular or overlay, that opens. In views where app users can’t select a duration (Month and Schedule), the start and end default to 8:00 AM to 8:30 AM on the selected day.
- Move with Drag & Drop lets app users drag an event to a new time slot, or drag its edge to change its duration. The new start and end values are saved to the record.
Add a control
- Select Add to configure a new control.
- In the panel that opens, under Type, select one of the following:
- Action adds a button that does one thing when an app user selects it. Enter an Action name, and then choose an action in the Action dropdown:
- Open AppPage navigates to another AppPage. Use it to link to a Submission Form to create a new record or a Details/Update Form for viewing or editing a record.
- Go to URL navigates to an external URL.
- Dropdown adds a dropdown menu button that groups several actions under one button. See Group actions.
- Action adds a button that does one thing when an app user selects it. Enter an Action name, and then choose an action in the Action dropdown:
- Enter a Label for the control, and then select Save.
Notes: Event controls only support the Open AppPage and Go to URL actions. When either redirection option is used, session parameters are automatically passed between the DataPart and the destination page. For Open AppPage, you can configure an alternative option to pass query string parameters instead. To learn more, see Communication Between DataParts.
Group actions in a dropdown menu button
A dropdown menu button groups several actions under one button, which keeps the controls on your report compact. App users select the button to see the list of actions.
- Select Add in Header controls
- Set Type to Dropdown.
- Enter a Dropdown name and a Label
- Select Save.
The dropdown appears in the list of header controls with a Drop controls here area under it. Drag controls from the list into that area to place them in the dropdown.
Calendar options
Under Calendar options, use Event details to show more information on each event in the Week and Day views, alongside the event title, such as a location or a short note.
- In Event details, enter static text or use parameters
- To show a value from the event’s record or another source, select Insert parameter.
- In Type, select Data source field, System Parameter, App parameter, Query string parameter, or Authenticated user field.
- Select the Parameter and its Formatting.
- Select Insert.
- Event details are rendered as HTML, so you can format the text, such as
<b>for bold. - Event details don’t appear in the Month view.
Display
Calendar views
Use the Calendar views toggles to set which views app users can switch between: Day, Week, Month, Year, and Schedule. Use the Default dropdown to set the view the Calendar opens in. App users switch views from a dropdown in the rendered app.
- At least one view must stay on, so you can’t turn off the last enabled view.
- If you turn off the view that is set as the default, another enabled view becomes the default.
- In Day and Week views, the time grid opens at 7:00 AM to 7:00 PM. App users can scroll to hours outside that range.
Event colors
Turn on Event colors, then select Set colors to assign a color to each value of a field, such as a status or category.
- The event color field can be Text(255), Text(64000), Number, Integer, Currency, Yes/No, or a Formula field that returns one of these types.
- The color list holds up to 20 unique values and can’t be empty. Once you reach 20, the Add button is disabled.
- An empty value counts as its own value, and you can assign it a color.
- You can assign each value only once.
- Events whose value matches no color in the list use the theme’s default event color, set by the
--cas-datapart-calendar-event-colorvariable.
Visible hours
Use Visible hours to set the hours the Day and Week views show when they open, such as your business hours. Select a Start and an End time. App users can scroll to see earlier and later hours.
- The default is 07:00 to 19:00.
- Times are in whole hours. The start time can be 00:00 to 22:00, and the end time can be up to 24:00.
- The end time must be at least 2 hours after the start time.