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 » Problem with ReportItemSetCell Collapse All
Subject Author Date
David Skok Nov 12, 2007 - 8:38 AM

Throws an ASSERT and does not clear cell as expected. I have sent a modified version of ReportGrid demo showing the problem. Please recommend a fix.

Thanks, Dave

Technical Support Nov 13, 2007 - 2:04 PM

Thank you for reporting this issue. Please update the source code for the following method

bool CExtReportGridDataProvider::ReportItemSetCell(
      const CExtReportGridColumn * pRGC,
      const CExtReportGridItem * pRGI,
      const CExtGridCell * pCellNewValue, // = NULL // if NULL - empty existing cell values
      bool bReplace, // = false // false - assign to existing cell instances or column/row type created cells, true - create new cloned copies of pCellNewValue
      CRuntimeClass * pInitRTC // = NULL // runtime class for new cell instance (used if bReplace=false)
      )
{
      ASSERT_VALID( this );
      if( pRGC == NULL || pRGI == NULL )
            return NULL;
      ASSERT_VALID( pRGC );
      ASSERT_VALID( pRGI );
CExtGridDataProvider & _DP = _Tree_GetCacheDP();
ULONG nReservedColumnCount = 0, nReservedRowCount = 0;
      _DP.CacheReservedCountsGet( &nReservedColumnCount, &nReservedRowCount );
bool bActive = pRGC->ColumnIsActive();
ULONG nColNo = 0;
      if( bActive )
      {
            nColNo = ActiveIndexGet( pRGC );
            if( nColNo == ULONG(-1L) )
                  return NULL;
            nColNo += nReservedColumnCount;
      } // if( bActive )
      else
      {
            nColNo = InactiveIndexGet( pRGC );
            if( nColNo == ULONG(-1L) )
                  return NULL;
            nColNo += 1;
      } // else from if( bActive )
      ASSERT( pRGI->TreeNodeGetParent() != NULL );
ULONG nRowNo = pRGI->TreeNodeCalcOffset( false );
      nRowNo += nReservedRowCount;
      return
            _DP.CellRangeSet(
                  nColNo,
                  nRowNo,
                  1L,
                  1L,
                  pCellNewValue,
                  bReplace,
                  pInitRTC,
                  false, // bAutoFindValue
                  false  // bUseColumnDefaultValue
                  );
}