- Creating a Gantt Chart report
- Creating the report
- Testing a Gantt Chart report
- Gantt Chart control in a report
- Printing a Gantt Chart report
The report editor gives you the ability to create "Gantt Chart" reports. This type of report is based on a Table or TreeView Table control that displays a Gantt Chart column.
Creating a Gantt Chart report
Creating the report
To create a "Gantt Chart" report:
- Click in the quick access buttons.
- The creation window appears: click "Report" then "Report".
- The report creation wizard starts.
- Select a "Gantt Chart " report. Go to the next step.
- Select the Table or TreeView Table control that will be used to create the Gantt Chart report. Specify whether only the rows selected in the controls must be printed. Go to the next step.
- Specify the items to print (which means the columns of the Table or Treeview Table control). For each item, you have the ability to specify the caption of the item and the block where the item must be positioned. Go to the next step.
- If necessary, indicate the calculations to be made on the different numeric items of your report. Select "No calculation" to continue without integrating calculations in the report. Go to the next step.
- Specify the format of sheet on which the report will be printed. The report is printed in A4 format by default. Go to the next step.
- If necessary, select the skin template of the report. Go to the next step.
- Type the name and title of the report (name of ".WDE" file corresponding to the report). This name will be used to identify the report in your programs. You can also specify whether the report can be modified by the end user in "Reports & Queries".
- Validate the report creation.
- Specify (if necessary) the mode for reducing the report size:
- Print the report on several pages. In this case, the end user will have to group the pages. This type of print is recommended for a Gantt Chart report. For more details, see Multi-page print.
- Use the landscape mode.
- Reduce the report size. Caution: according to the reduction percentage, the printed report may become unreadable.
- The report currently created is displayed in the report editor.
- The parameters regarding the style of the tasks found in the Gantt Chart of the report are automatically retrieved from the control (background color, progress color, ...).
- A Table report is automatically created from the Table or TreeView Table control. The Gantt Chart column found in the window is changed in the report editor into a Gantt Chart column.
Testing a Gantt Chart report
The test of a Gantt Chart report cannot be run from the report editor because the window containing the Table or TreeView Table control must be opened. To run the test of a Gantt Chart report, you must:
- create (if necessary) a button in the window containing the Gantt Chart control. This button is used to print the Gantt Chart report (iPrintReport).
Case of internal windows: If the Gantt Chart control is found in an internal window, the button should be created in the internal window (and not in the host window).
- run the test of the window containing the Gantt Chart control then run the report test (via the button).
Case of internal windows: the test must be run from the window that is hosting the internal window.
|Reports & Queries cannot be used to create Gantt Chart reports. However, you have the ability to customize the Gantt Chart reports created in the standard report editor (color, fonts, size, ...).|
Gantt Chart control in a report
A table is automatically created in a Gantt Chart report. This table contains a Gantt Chart control.
The Gantt Chart control description window allows you to configure the following characteristics:
- Task display options ("General" tab): you can select:
- the range for task selection (from the first one to the last one or on a specific number of days).
- the number of days displayed.
- the granularity of gridlines.
- the visible time period.
- The custom report to display the tasks.
- If the selected option is "None", the default display is used.
- If "Preset report" is selected, a preset report is automatically added to the project. This report is named "RPT_WinDevViewGanttTask" by default and it is automatically used to display tasks. This report can be customized, renamed, etc.
- If the selected option corresponds to a report of the project, this report will be used to display the tasks.
We advise you to customize the report proposed by default.
- Date display options ("General" tab): The available options are:
New in version 27Show week number
: If this option is checked, the week number is displayed in the Gantt chart. You can define the display mask of the week number. By default, only the week number is displayed. You can define a custom mask, using %1 for the week number (for example: Week %1).
- Mask for dates ("General" tab).
The mask is "Automatic" by default. You can use:
- one of the preset masks.
- a custom mask. For example, the "MMMM YYYY||" mask allows you not to display the days.
- Mask for schedules ("General tab").
The mask is "Automatic" by default. You can use:
- one of the preset masks.
- a custom mask. For example, you can use the "HH" mask to hide minutes.
- Chart split mode ("UI" tab): This option allows you to configure how the chart will be presented when printed. You can select one of the following options:
- Continuous Gantt chart (default): The Gantt chart will be printed continuously on multiple pages. This option allows for linear printouts, without breaks.
- Columns on each page: The "description" columns of the Gantt chart (Title, duration, etc.) will appear on each page.
- Anchor on control ("UI" tab): via this option, a report control and the Gantt Chart control can be stretched accordingly. Indeed, the Gantt Chart control is stretched according to the printed data. The "Anchor on control" option is useful when columns or controls must be printed on the right of the Gantt Chart control: they will be stretched like the Gantt Chart control.
- Style of the different elements in the Gantt chart ("Style" tab).
Printing a Gantt Chart report
A Gantt Chart report (on a Table or TreeVeiw Table control) can only be printed from the window that displays the control. To do so:
- Create a button in the window containing the control.
- Set the report print destination with iDestination (report viewer, print in an HTML file, etc.).
- Specify the name of the report to print with iPrintReport.
- If additional parameters must be passed to the report, these parameters must be specified in iPrintReport, after the name of the report to print. For more details, see Report with parameters.
- If the window that contains the source control is opened multiple times (non-modal opening by OpenChild), the full name of the control to print must be passed as parameter to the report.
// The FullName property will contain the name of the window
// that must be opened with an alias to distinguish between each window
// Opening code of the report:
MyReport.SourceName = NameSourceTVTable
- The SelectionOnly property is used to get and change the records that will be printed in the report: print all records or the selected records only.
- If the report is based on a TreeView Table control, the KeepVisibleHierarchy property can be used to get and change the tree structure print mode: printing the entire hierarchy or printing the hierarchy that is visible in the control.
The information to print is in the TreeView Table control named "TVT_Schedule" found in the "WIN_Gantt" window.
The report to print is named "RPT_Gantt" and it is printed when "BTN_Print" is clicked on.
In this example, the click code of "BTN_Print" is as follows:
// Open report viewer
// Print the report based on the "TVT_Schedule" TreeView Table control
Complete examples (WINDEV): WD Gantt
This page is also available for…
Click [Add] to post a comment