Category / Section
Create a Timeline Chart Using Tablix in Bold Reports
Published:
Updated:
Creating a visual timeline chart is a common requirement in project management and reporting scenarios such as tracking tasks and schedules. In Bold Reports, you can represent task durations using a Tablix report item by plotting start and end dates and applying color coding for clear visual distinction.
This guide walks you through building a dynamic timeline chart in Bold Reports using a Tablix to visualize project tasks across a date range.
Prerequisites
Before you begin, ensure you have:
- Bold Reports Designer (Web or Desktop) version 7.x or later.
- Access to a SQL Server database to host the task data.
- Basic knowledge of RDL (Report Definition Language) expressions.
Step-by-Step Instructions
1. Create the dataset to plot the timeline
Create a dataset that expands task date ranges into individual days. This enables the Tablix report item to group data by specific dates.
- Create a table named
HousingWorkand populate it with sample data using the following SQL script:CREATE TABLE dbo.HousingWork ( TaskName NVARCHAR(100), StartDate DATE, EndDate DATE ); INSERT INTO dbo.HousingWork (TaskName, StartDate, EndDate) VALUES ('Electrical & Plumbing', '2024-04-01', '2024-04-05'), ('Flooring', '2024-04-06', '2024-04-08'), ('Painting', '2024-04-09', '2024-04-12'), ('Landscaping', '2024-04-13', '2024-04-15'), ('Interior Setup', '2024-04-16', '2024-04-18'), ('Final Inspection', '2024-04-19', '2024-04-21'), ('Cleanup & Handover', '2024-04-22', '2024-04-24'); - Create a new dataset in Bold Reports using the following query to generate the expanded timeline:
WITH DateRange AS ( SELECT MIN(StartDate) AS MinDate, MAX(EndDate) AS MaxDate FROM HousingWork ), Calendar AS ( SELECT CAST((SELECT MinDate FROM DateRange) AS DATE) AS TimelineDate UNION ALL SELECT DATEADD(DAY, 1, TimelineDate) FROM Calendar WHERE TimelineDate < (SELECT MaxDate FROM DateRange) ), Expanded AS ( SELECT c.TimelineDate, t.TaskName FROM Calendar c JOIN HousingWork t ON c.TimelineDate BETWEEN t.StartDate AND t.EndDate ) SELECT * FROM Expanded ORDER BY TimelineDate, TaskName OPTION (MAXRECURSION 0);
2. Add the tablix report item to the design canvas
- Drag a Tablix report item onto the design canvas.
- Remove the default row and column group headers, leaving only two rows.
- Bind the Tablix to the dataset created in Step 1.
- Designate the top cell for the timeline date and the bottom cell for the task visualization.
3. Configure grouping
- Right-click the Tablix cell, select Column Group, and then select Parent Group.
- Set the group expression to
=Fields!TimelineDate.Valueand enable the Add header option.
- In the Grouping Panel, click the dropdown for the Details row group and select Delete Group.
- In the confirmation dialog, choose Delete group only to keep the row in the Tablix.
4. Configure the background color
- Select the detail cell in the Tablix.
- In the Properties Panel, under Appearance, locate Background Color.
- Select the expression icon to open the expression editor.
- Enter the following expression to apply color coding:
=Switch( Fields!TaskName.Value = "Electrical & Plumbing", "Blue", Fields!TaskName.Value = "Flooring", "Green", Fields!TaskName.Value = "Painting", "Yellow", Fields!TaskName.Value = "Landscaping", "Orange", Fields!TaskName.Value = "Interior Setup", "Red", Fields!TaskName.Value = "Final Inspection", "Purple", Fields!TaskName.Value = "Cleanup & Handover", "Gray", True, "Transparent" )
5. Add interactivity using tooltips
- Select the detail cell.
- In the Properties panel, find the Tooltip property under the Miscellaneous section.
- Set the value to
=Fields!TaskName.Value.
6. Format the timeline dates
- Select the header cell that is grouped by date.
- In the Properties panel, locate the Format property.
- Click the expression icon and enter:
=Format(Fields!TimelineDate.Value, "MMM d")
7. Preview the report
- Click Preview in the toolbar.
- Verify that the report displays a horizontal timeline where each day appears as a column and tasks appear as color-coded blocks.