Report Control - An Outlook 2000-Style SuperGrid Control

Click here for larger image

Environment: VC6, Windows 98, NT4 (IE4), Windows 2000.

This ReportCtrl control is an Outlook 98/2000 style SuperGrid control. I've seen many implementations, most of them based on the standard CListCtrl. All implementations have their specific weaknesses. This implementation tries to overcome some of the weaknesses, although for some purposes it may introduce others.

The documentation is sparse, because I do not have much time to write documentation. However, the included demo is a great help in understanding how to use the features of the control and many features are demonstrated in a practical manner. The interfaces of the controls highly resemble the interfaces of similiar MFC controls, like the list control and header control. So, for the more experienced MFC coder, it should not be a big problem to understand how to use the control in their own projects...

Version history excerpt (refer to source file for complete history):


  • Fixed bug in DeleteItem for tree control mode.
  • Fixed item expansion for single subitem hierarchy items.
  • Added GetExpandedItemText to allow expanded items to show different text from the subitem text.
  • Added support for radio button and disabled check marks and radio buttons.
  • Added RVP_ENABLEFLATCHECKMARK property, to control the visual style of check marks or radio buttons.
  • Added support for check mark and radio button image list.
  • Changed CurrentFocus() to GetCurrentFocus().
  • Changed OnKillFocus to recognize all child windows.
  • Extended MeasureItem function.
  • Fixed GetNextItem() for RVTI_ROOT.
  • Added support for SetRedraw suggested by Phil J Pearson.
  • Optimized InsertItem performance by skipping GetRowFromItem when the focus is not on an reorderable row, as suggested by Phil J Pearson.
  • Added disabled background function to CReportSubItemListCtrl.
  • Added pre-create style passing to CReportView.
  • Adjusted edit box position.
  • Fixed a bug related to keydown messages in unfocused state.
  • Fixed tip redraw problem and tip background color mismatch.
  • Fixed kill tip on WM_KILLFOCUS, finally fixing click and double click on expanded subitems.
  • Added GetSelectedItems method.
  • Fixed a selection bug in ClearSelection.
  • Made GetReportCtrlPtr virtual and changed CReportView to use overriden function to get a pointer to the embedded CReportCtrl. This allows control derived from CReportCtrl to be embedded in CReportView.
  • Added UpdateWindow to SetRedraw when re-enabling redrawing.
  • Removed legacy definitions from header file.
  • Added blended image support through state bits, focus and selection through the RVP_ENABLEIMAGEBLENDING and RVP_BLENDCOLOR properties.
  • Added support for overlay images.
  • Added Win2K tip fading to CReportTipCtrl.
  • Fixed nFormat subitem member update in OnHdnItemChanged, as suggested by Sven Ritter.
  • Added selective item cache flush to SetItemCount.
  • Added GetItemString() function to retrieve an item as a string.
  • Added clipboard Copy support and clipboard separator and indent properties.
  • Fixed OnRvnEndItemEdit to not loose lParam, as suggested by Paul Hurley.
  • Added GetSortSettings() to retrieve sorting settings.
  • Made SelectRows virtual to allow owner data multiple selection management.
  • Fixed a bug in DeleteItem for trees.
  • Fixed various mouse button, keyboard selection/focus issues.

The control uses Keith Rules MemDC class for flicker free drawing.


Download demo project - 183 KB

Download source - 68 KB



  • how to deal with the OnRvnItemDrawPreview part ?

    Posted by zyfzzzz on 06/07/2012 06:30pm

    when the items are large , I mean when it scrolls,the preview seems wrong,guess it needs some kind of control with the scrollbar,can you help ?

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Enterprises are increasingly looking to platform as a service (PaaS) to lower their costs and speed their time to market for new applications. Developing, deploying, and managing applications in the cloud eliminates the time and expense of managing a physical infrastructure to support them. PaaS offerings must deliver additional long-term benefits, such as a lower total cost of ownership (TCO), rapid scalability, and ease of integration, all while providing robust security and availability. This report …

  • Moving from an on-premises environment to Office 365 does not remove the need to plan for disruptions or reduce the business risk requirements for protecting email services. If anything, some risks increase with a move to the cloud. Read how to ease the transition every business faces if considering or already migrating to cloud email. This white paper discusses: Setting expectations when migrating to Office 365 Understanding the implications of relying solely on Exchange Online security Necessary archiving …

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date