Grid Articles and Tutorials

Report Control to Grid Migration Guide

Author: Alexander Stoyan
Platform: Visual C++

Beginning with version 22.0.0 the Report control is shipped under a new name Grid Control. It was a necessary and long planned name change for this control, which eliminates some common confusion about the true purpose of the control, and unlock all future related development. The logic of working with the control, related objects, interfaces and API's has remained unchanged except where the name Report was used. In all such cases the name Grid has been used instead. All users who upgrade Toolkit Pro or Suite Pro from a previous version will have to perform this migration by following the instructions outlined in this guide.

Because the control was only renamed to Grid from Report, this guide assumes the same changes should be made in your project as well. In most cases this can be achieved by using a simple plain text replacement of all Report and REPORT occurrences with Grid and GRID respectively.

Automating "Report" to "Grid" replacement.

We recommend using the Grep utility that is available with ToolkitPro installation packages for this task. This will help eliminate any errors and make the process less tedious. The utility can be found in the following installation folder depending on your version:

  • C:\Program Files (x86)\Codejock Software\MFC\Xtreme ToolkitPro v22.1.0\Utils\Grep.exe

Report to Grid renaming in Grep

Using the Grep utility is quite simple in this case:

  1. Find what: and Replace with: search terms must be specified as mentioned above.
  2. The Look in: string must be a full path to the code base location and the Include sub-folders checkmark must be checked.
  3. Match case Find Options must be also be checked, however Match whole words must be unchecked in order to perform replacement inside identifier names.

After pressing the Find All button, a confirmation is displayed for each occurrence (shown in blue) that will be replaced with a preview shown (shown in red). You can use this list to review all found occurrences. Any false positives can be ignored by removing the check mark in the rightmost column of each found occurrence. A group of random occurrences can be selected with the Ctrl key held pressed, and the Space bar key can be used for disabling/enabling the selected occurrences.

After you have reviewed all of the items in the list, press the Apply button to apply all changes in one batch. All affected files will be updated with the specified changes from your list.

In order to simplify migration for C++ users a list of backward compatible aliases has been added in the file GridControl\XTPGridDeprecated.h. Including this file in your project will make it possible to keep using class names that start with CXTPReport*, constant names like xtpReport* and XTP_REPORT*. However each use of the legacy names will result in a deprecated API warning.