Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Printing preview Collapse All
Subject Author Date
Massimo Germi Sep 20, 2007 - 4:33 AM

Hi to all support staff,
do you have any some news about printing support in CExtTreeGridWnd?


Tx a lot

Technical Support Sep 20, 2007 - 8:54 AM

We have added some new features with regard to printing and print preview. Now it is possible to hide selectively columns and rows in the generated printing/preview output. This is supported for outer header columns and rows and for inner data columns and rows including the tree rows of report grid and tree grid. Here the details of implementation:

- Added the __EGCS_EX_PPVW_HIDDEN extended style that can be used with CExtGridCell*** classes. This style, when applied to header cells, allows you to hide columns and rows in the print/preview output. The following new handy methods in the CExtGridCell class gets/sets this style flag:

     virtual bool HiddenInPrintPreviewGet() const;
     virtual void HiddenInPrintPreviewSet( bool bHiddenInPrintPreview );
- Added the following virtual methods to the CExtGridWnd class:
     virtual bool OnGridQueryPpvwVisibilityForColumn(
           LONG nColNo,
          INT nColType
           ) const;
     virtual bool OnGridQueryPpvwVisibilityForRow(
           LONG nRowNo,
           INT nRowType
           ) const;
- Added the following new virtual method to the CExtTreeGridWnd class (so, it can also be used in CExtReportGridWnd) because the OnGridQueryPpvwVisibilityForRow() virtual method is not used in the tree grid and report grid:
     virtual bool OnTreeGridQueryPpvwVisibilityForItem(
           const CExtTreeGridCellNode * pNode
           ) const;
To hide a tree row in the print/preview output, you should invoke the following code:
HTREEITEM hti = . . .
CExtGridCell * pTreeNodeCell = (CExtGridCell*)hti;
     pTreeNodeCell->HiddenInPrintPreviewSet( true );
To hide a tree row of the report grid in the print/preview output you should invoke the following code:
CExtReportGridItem * pRGI = . . .
     pRGI->HiddenInPrintPreviewSet( true );
To hide any data column/row you should get its header cell at the top/on the left and use:
pHeaderCell->HiddenInPrintPreviewSet( true );
To hide an outer header column/row in the print/preview output in any of our grids, you should override the OnGridQueryPpvwVisibilityForColumn() and/or OnGridQueryPpvwVisibilityForRow() virtual methods and return false for appropriate columns/rows which you would like to make hidden.

We have several other requests for improvement of this subsystem but they are not implemented yet. You can download the updated code via ftp. If you do not know the password, please request it at support@prof-uis.com.