Print Page | Close Window

HOWTO: Merge cells in footer rows?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=18010
Printed Date: 12 May 2024 at 12:07am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: HOWTO: Merge cells in footer rows?
Posted By: mgampi
Subject: HOWTO: Merge cells in footer rows?
Date Posted: 07 March 2011 at 8:18am
Hi;

I need merged cells in footer rows, but can't find out how. The first x cells of the footer row should be merged into one cell, so that a big text can fit into this cell (see Screenshot):



How can I do that?


-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017



Replies:
Posted By: larryp
Date Posted: 07 March 2011 at 9:24am
You can try overriding the Draw method of CXTPReportRecordItem and changing pDrawArgs->rcItem.right before calling  CXTPReportRecordItem::Draw( pDrawArgs )
 
int CMyItem::Draw(XTP_REPORTRECORDITEM_DRAWARGS* pDrawArgs)
{
     // Change the rect to go all the way to the end of the row.
     pDrawArgs->rcItem.right = pDrawArgs->pRow->GetRect().right;
      // Handle condition where the calculated right is less than the left.
      if ( pDrawArgs->rcItem.right <= pDrawArgs->rcItem.left ) {
            pDrawArgs->rcItem.right = pDrawArgs->rcItem.left + 100000;
      }
      return CXTPReportRecordItem::Draw( pDrawArgs );
}
Seems to work for me in version 13.2.1




Posted By: mgampi
Date Posted: 07 March 2011 at 11:44am
Thanks larryp; I'll try it.

-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017


Posted By: ABuenger
Date Posted: 18 March 2011 at 5:33pm
Hi,

the merge item feature has been rewritten for the next release. Merging header/footer items is now supported.

wndReport.GetHeaderRecords()->MergeItems(CXTPReportRecordItemRange(...));
wndReport.GetFooterRecords()->MergeItems(CXTPReportRecordItemRange(...));
wndReport.GetRecords()->MergeItems(CXTPReportRecordItemRange(...));

Andre



-------------
Codejock support


Posted By: mgampi
Date Posted: 18 March 2011 at 7:42pm
Hi;

Any news about the release date?
Otherwise, is it possible to get the feature a little bit earlier?Wink


-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017


Posted By: ABuenger
Date Posted: 18 March 2011 at 9:00pm
Sorry, no release date yet.



-------------
Codejock support


Posted By: ABuenger
Date Posted: 08 April 2011 at 3:41pm
Originally posted by mgampi mgampi wrote:

Otherwise, is it possible to get the feature a little bit earlier?Wink


Open a new ticket to request the new code.

Andre



-------------
Codejock support


Posted By: mgampi
Date Posted: 05 May 2011 at 4:04pm
Hello Andre;

after a few days of testing I get an ACCVIO in new merge code in function

void CXTPReportRow::Draw(CDC *pDC, CRect rcRow, CRect rcClip, int nLeftOffset,
    CXTPReportRecordMergeItems &mergeItems, BOOL bDrawFreeze)

Line 505:


...
                if (!pItem->IsMerged())
                {
                    DrawItemGrid(pDC, pColumn, rcGridItem);
                }
...


pItem is in this case NULL!

This happens if I have more columns than items in the record (e.g. 3 columns but AddItem is called only twice).

Could you fix this please?


-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017


Posted By: ABuenger
Date Posted: 12 May 2011 at 6:22pm
if (pItem && !pItem->IsMerged())
{
      DrawItemGrid(pDC, pColumn, rcGridItem);
}



-------------
Codejock support



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net