Click here to Skip to main content
15,887,083 members
Articles / Desktop Programming / MFC
Article

Report control - an Outlook 2000 style SuperGrid Report Control

Rate me:
Please Sign up or sign in to vote.
4.90/5 (44 votes)
14 Jun 2001 1.5M   8.7K   152   165
An Outlook 98/2000 Style SuperGrid Report Control that tries to overcome some of the weaknesses of other implementations.

Sample Image

Introduction

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)

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):

2.0.1	- 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.
2.0.0	- Made scrolling with left or right cursor key dependent on
	  focus subitems style.
	- Fixed resource leak in empty list, as suggested by Florent
	  Odelain.
	- Fixed ResortItems and DeactivateSubItem bugs as suggested by
	  Rafael Lombardi Santos.
	- Fixed HitTest on reordered columns, reported by Trevor Ash.
	- Fixed item rect returned in hitinfo structure for scrolled
	  controls. This fixes incorrect positioning of tip windows.
	- Added CReportHeaderCtrl to access CFlatHeaderCtrl's protected
	  members.
	- Added first column indent functions, to support hierarchy
	  GUI elements.
	- Fixed HitTest to retrieve correct item data.
	- Added parameter to sort callback.
	- Removed SortAllSubItems, because implementation was not
	  maintained and buggy.
	- Fixed IsItemVisible and added GetTopIndex(), PageUp() and
	  PageDown() as suggested by Alina Kozlovsky.
	- Added tree control features, both in preparation of group
	  view mode as well as a standalone feature.
	- Fixed subitem text drawing following uninitialized subitems.
	- Changed CompareItems callback and functions to support
	  separate subitems to enable tree view and group view sorting.
	- Extended CompareItems to sort on checkboxes as suggested by
	  Peter Lagerhem.
	- Fixed offset of subitem tip for items with images or checks
	  and text and related hittesting issues.
	- Fixed NOHEADER style.
	- Changed selected items and tree boxes in tree view mode visuals
	  to match common control look and feel.
	- Fixed default height setting for font size updates with images.
	- Fixed cosmetic bug with RVS_SHOWHGRID style, as suggested by Matrix.
	- Fixed SelectAll() for empty control as suggested by Dmitry Sazonov.
	- Added GetStyle().
	- Added RVN_HEADERRCLICK to support popup menus on header.
	- Fixed tooltip double click and ALT key relay events by removing
	  mouse capture.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Netherlands Netherlands
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionScrollBar problem with resizing dialogs. Pin
dchris_med23-Apr-13 21:26
dchris_med23-Apr-13 21:26 
AnswerRe: ScrollBar problem with resizing dialogs. Pin
dchris_med8-Jun-13 5:07
dchris_med8-Jun-13 5:07 
QuestionPer sub item colours Pin
dchris_med27-Mar-12 15:49
dchris_med27-Mar-12 15:49 
QuestionProblems with VS2010 Pin
icaro28-Jul-10 2:09
icaro28-Jul-10 2:09 
AnswerRe: Problems with VS2010 Pin
Phil J Pearson31-Jul-10 1:20
Phil J Pearson31-Jul-10 1:20 
GeneralWorkaround Pin
icaro3-Aug-10 6:04
icaro3-Aug-10 6:04 
GeneralRe: Workaround Pin
Phil J Pearson4-Aug-10 23:07
Phil J Pearson4-Aug-10 23:07 
GeneralRe: Workaround Pin
Member 17562327-Oct-10 8:51
Member 17562327-Oct-10 8:51 
AnswerRe: Problems with VS2010 Pin
SteveKing5-Dec-12 0:10
SteveKing5-Dec-12 0:10 
Generalsmall bugfix Pin
diamond28-May-09 7:09
diamond28-May-09 7:09 
QuestionTree Sub Items Pin
C_BRUMLEY5-Nov-08 7:01
C_BRUMLEY5-Nov-08 7:01 
QuestionSupport virtual list? Pin
xnetec13-Oct-08 23:54
xnetec13-Oct-08 23:54 
GeneralATGrid Report Control Pin
etcell30-Jul-07 18:45
etcell30-Jul-07 18:45 
ATGrid报表控件简介
下载地址:
http://www.etcell.com/
http://www.etcell.com/download.aspx?id=51

ATGrid报表控件是在ETCell报表控件基础上推出的第二代报表控件,是一款完全对象化的报表组件。
ATGrid在功能上相对ETCell做出了重大改善:
支持多个ETSet数据集
支持7个子对象,最小对象到单元格
支持33种单元格数据类型
支持任意复杂格式报表数据展现
支持23种图表展示
扩展xml支持,操作数据更加灵活方便
改进打印功能,更好的支持套打、连续打印、分页打印
提供了ASP、ASP.NET、JSP、HP专用类库组件,提高开发效率

立即试用ATGrid报表控件




示例演示&源码下载




ATGrid报表控件功能
1、设计报表式样,生成模板文件
专用报表模板设计器,可视化设计报表式样

ATGrid报表控件有专门的设计器——wintable报表设计器,用来设计报表模板。wintable采用所见即所得的设计模式,类Excel操作界面风格,易学易用。可以直接导入Excel电子表格文件,也可以把ATGrid报表导出成Excel文件、html文件、xml文件。


支持分组、交叉、分栏等复杂报表

ATGrid报表控件采用表格方式构建报表,方便灵活,数据模型先进,可支持多个变长数据集,支持横纵向扩展,支持分组、交叉、分栏等复杂报表。


支持23种图表展现方式

ATGrid报表控件支持饼图、折线图、柱状图等23种图表展现方式,在一张报表中既可以有报表又可以有图表,大大丰富了报表数据的展现方式,增加了报表的可读性。


支持按钮、下拉列表、日期、多行文本等多种控件效果,支持会计表头、表览等多种特殊效果

ATGrid报表控件提供了33种单元格数据类型,包括数字、文本、密码、按钮、日期、列表等等,还包括会计表头、表览等多种特殊类型。使用ATGrid可以展现复杂的报表式样。


2、数据操作
拥有规范的xml数据格式

ATGrid报表控件提供xml数据接口,支持符合ATGrid数据格式规范的xml数据。ATGrid报表控件数据xml格式兼容ETcell报表控件数据格式。


内置通讯接口,强力支持HTTP协议,可以和后台程序轻松交互

ATGrid报表控件提供内置通讯接口,可以以post或get方式发送表单内数据或xml数据,可以接收返回的数据。为报表数据与其他程序交互操作提供了良好的支持,实现了数据与式样的分离。


采用Alias别名技术,可单独对单元格数据进行操作

ATGrid报表控件可以通过别名对单元格数据进行操作,大大增加了程序的灵活性和可扩展性。


数据模型先进,支持两种数据集——AliasSet和ETSet

ATGrid报表控件支持两种数据集模型,一种是AliasSet,相当于一条记录;一种是ETSet,相当于多条记录集。在ATGrid报表控件中可以直接对数据集进行操作,提高了编程的方便性。


ATGrid报表控件支持公式

ATGrid报表控件支持和Excel兼容的公式,单元格间可以自动进行计算。


3、编程接口控制
支持多种开发语言

支持多种常见开发语言,如JSP、ASP、ASP.NET、C#、HP、VB、VC++、Delphi、C++Builder、owerBuilder、Java等。


支持VBScript、JavaScript脚本

使用JavaScript或VBScript进行web编程,可以轻松实现浏览器端人机交互效果。


对象化编程

ATGrid是一款完全面向对象的报表控件,符合面向对象编程思想,支持7个子对象,最小对象到单元格,大大方便了面向对象编程。


提供数百个开发接口

ATGrid提供数百个开发接口,可以灵活的对式样、数据、事件进行控制。


4、打印输出
打印设置

可以按照打印效果的需要进行灵活的设置,包括页边距、纸张大小、打印方向、打印预览界面自定义、打印比例大小、表格线是否打印、是否自适应纸张、是否打印报表背景颜色、是否打印单元格背景,是否分页打印。


报表套打

可以按照预定格式,设置报表表格线是否打印、单元格是否打印,满足套打需要。


分页打印

可以设置固定表头等多种特殊效果,当数据过多超出一页纸时,可以进行分页打印。


自适应纸张打印

可以让报表自动缩放到符合纸张大小,充满整张纸,自动适应纸张进行打印。


导出其它格式文件

ATGrid报表可以导出Excel、html、xml等多种文件格式。导出为Excel文件时,报表内的公式、数据、式样会自动随着导出。

下载地址:
http://www.etcell.com/
http://www.etcell.com/download.aspx?id=51

GeneralI can not expand the tree root Pin
sms918-Jul-07 23:38
sms918-Jul-07 23:38 
QuestionSet the last double clicked item's backcolor with RVS_TREEVIEW style? Pin
sms915-Jul-07 22:52
sms915-Jul-07 22:52 
GeneralIssues with using the control on a non-primary display Pin
tbaynon3-May-07 9:15
tbaynon3-May-07 9:15 
GeneralError in CReportCtrl::DrawCheck() member Pin
pedroo23-Jan-07 11:18
pedroo23-Jan-07 11:18 
GeneralProblem to integrate into MDI application Pin
pedroo20-Jan-07 3:11
pedroo20-Jan-07 3:11 
GeneralRe: Problem to integrate into MDI application Pin
pedroo21-Jan-07 7:12
pedroo21-Jan-07 7:12 
QuestionProblems with OnToolTipNotify when in Unicode Pin
_Stilgar_1-Apr-06 10:43
_Stilgar_1-Apr-06 10:43 
GeneralRe: Problems with OnToolTipNotify when in Unicode Pin
Tim Wessman1-Jun-06 1:34
Tim Wessman1-Jun-06 1:34 
AnswerRe: Problems with OnToolTipNotify when in Unicode Pin
Tim Wessman1-Jun-06 2:25
Tim Wessman1-Jun-06 2:25 
QuestionIs there control that supports groupping? Pin
kostia11-Aug-04 4:15
kostia11-Aug-04 4:15 
AnswerRe: Is there control that supports groupping? Pin
_Stilgar_15-Apr-06 21:26
_Stilgar_15-Apr-06 21:26 
GeneralCompilier VC7 Pin
lurchibaer22-Jun-04 22:38
lurchibaer22-Jun-04 22:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.