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 » Grouped ReportGrid - painting problem Collapse All
Subject Author Date
Suhai Gyorgy Jul 26, 2007 - 8:05 AM

Dear Support,

When a reportgrid is grouped by more than one column, the painting of the grid is not right. Your ReportGrid sample has the very same problem. Screenshot

It is not really painting problem, more like the columns should be shifted to the right. Outlook 2003 works that way.

Technical Support Jul 30, 2007 - 9:26 AM

We are sorry for the delay with this reply. We agree the columns with a small width should extend to cover the width of expanded indent area. You can fix this by updating the CExtReportGridWnd::OnGbwAdjustRects() method’s source code (Please not this is not the final solution):

void CExtReportGridWnd::OnGbwAdjustRects(
      LONG nColNo,
      LONG nRowNo,
      INT nColType,
      INT nRowType,
      RECT & rcCellExtraA,
      RECT & rcCellA
      ) const
{
      ASSERT_VALID( this );
      if( nRowType == 0 && nColType == NULL )
      {
            HTREEITEM hTreeItem = ItemGetByVisibleRowIndex( nRowNo );
            if( hTreeItem != NULL )
            {
                  LONG nChildCount = ItemGetChildCount( hTreeItem );
                  if( nChildCount == 0 )
                        return;
            }
      }
      CExtTreeGridWnd::OnGbwAdjustRects(
            nColNo,
            nRowNo,
            nColType,
            nRowType,
            rcCellExtraA,
            rcCellA
            );
      if( nColType != 0 || nRowType != 0 )
            return;
LONG nColFirst = 0, nColLast = 0, nColFirstOffset = 0;
      OnGbwQueryVisibleColumnRange(
            nColFirst,
            nColLast,
            nColFirstOffset
            );
      ASSERT( nColFirst <= nColLast );
      if( nColNo != nColFirst )
      {
            ::SetRectEmpty( &rcCellA );
            ::SetRectEmpty( &rcCellExtraA );
            return;
      }
CRect rcClient = OnSwGetClientRect(); 
CSize _sizeTotal = OnSwGetTotalSize();
CPoint _pos = OnSwGetScrollPos();
DWORD dwBseStyleEx = BseGetStyleEx();
DWORD dwScrollTypeH = SiwScrollTypeHGet();
      if(         dwScrollTypeH == __ESIW_ST_NONE
            &&    (dwBseStyleEx&__EGBS_BSE_EX_PROPORTIONAL_COLUMN_WIDTHS) != 0
            )
      {
            _sizeTotal.cx = OnSwGetClientRect().Width();
            _pos.x = 0;
      }
      if( _sizeTotal.cx < 0 )
            _sizeTotal.cx = 0;
      if( _sizeTotal.cy < 0 )
            _sizeTotal.cy = 0;
LONG nRight = rcClient.left + _sizeTotal.cx - _pos.x;
      rcCellA.right = rcCellExtraA.right = nRight;
      if( rcCellA.right < rcCellA.left )
            rcCellA.right = rcCellA.left;
      if( rcCellExtraA.right < rcCellExtraA.left )
            rcCellExtraA.right = rcCellExtraA.left;
}

Suhai Gyorgy Jul 30, 2007 - 9:35 AM

Thank you! Please, indicate this bug fix in version history if final solution comes only with a new version. If it comes with an intermediate version (downloadable from your FTP server), please, when it’s ready, let me know with a post here and I’ll drop you an e-mail for details needed for download.

Technical Support Jul 30, 2007 - 11:21 AM

The provided solution can be assumed as the final one but it simply makes data rows full-row. We guess we need one more mode for data rows: they have an indent, but the first columns become wider and shifted to the current data row indent (this mode was implemented in old MS Outlook versions).