Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - HOWTO: Merge cells in footer rows?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

HOWTO: Merge cells in footer rows?

 Post Reply Post Reply
Author
Message
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: HOWTO: Merge cells in footer rows?
    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
Back to Top
larryp View Drop Down
Groupie
Groupie


Joined: 15 January 2005
Location: United States
Status: Offline
Points: 61
Post Options Post Options   Thanks (0) Thanks(0)   Quote larryp Quote  Post ReplyReply Direct Link To This Post 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


Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 18 March 2011 at 9:00pm
Sorry, no release date yet.

Codejock support
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 12 May 2011 at 6:22pm
if (pItem && !pItem->IsMerged())
{
      DrawItemGrid(pDC, pColumn, rcGridItem);
}

Codejock support
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.