Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - [solved] empty ReportRecordItemPreview
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[solved] empty ReportRecordItemPreview

 Post Reply Post Reply
Author
Message Reverse Sort Order
docontrol View Drop Down
Groupie
Groupie


Joined: 07 December 2009
Location: Denmark
Status: Offline
Points: 35
Post Options Post Options   Thanks (0) Thanks(0)   Quote docontrol Quote  Post ReplyReply Direct Link To This Post Topic: [solved] empty ReportRecordItemPreview
    Posted: 25 July 2018 at 4:32pm
I had the same problem today and struggled to find out why. It wasn't until I found this post that I realized that there is a bug in v18.4.0 of the toolkit.

However I managed to workaround the problem by inheriting from CXTPReportRecordItemPreview and overriding the OnDrawCaption method.
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Posted: 23 July 2018 at 4:44pm
Hello Muckl,

This can be solved only by changing c++ core. Codejock has SuitePro with source code bundle, ask in sales.

Also you can use previos version of ReportControl.

Regards,
Oleksandr Lebed
Back to Top
Muckl View Drop Down
Newbie
Newbie
Avatar

Joined: 23 July 2018
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote Muckl Quote  Post ReplyReply Direct Link To This Post Posted: 23 July 2018 at 11:54am
I have the same problem with ActiveX. Is there also any solution?
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Posted: 10 June 2018 at 6:19am
Hello,

Sorry I have confused ReportRecordItemPreview with PrintPreview where we have made some improvements.

So I found reason of empty ReportRecordItemPreview. Bug in method CXTPReportRecordItemPreview::OnDrawCaption() and the same copy-past bug in GetCaptionRect() method 
void CXTPReportRecordItemPreview::GetCaptionRect(XTP_REPORTRECORDITEM_ARGS* pDrawArgs, CRect& rcItem)
{
    ASSERT(NULL != pDrawArgs);
    ASSERT(NULL != pDrawArgs->pControl);

    if (NULL == pDrawArgs->pControl)
        return;

    CRect& rcIndent = pDrawArgs->pControl->GetPaintManager()->m_rcPreviewIndent;
    rcItem.DeflateRect(rcIndent.left - XTP_DPI_X(2), -XTP_DPI_Y(1), rcIndent.right, -rcIndent.bottom);
}

void CXTPReportRecordItemPreview::OnDrawCaption(
    XTP_REPORTRECORDITEM_DRAWARGS *pDrawArgs,
    XTP_REPORTRECORDITEM_METRICS  *pMetrics)
{
    ASSERT(NULL != pDrawArgs);
    ASSERT(NULL != pDrawArgs->pControl);

    if (NULL == pDrawArgs->pControl)
        return;
......
Regards,
 Oleksandr Lebed
Back to Top
sbinder View Drop Down
Groupie
Groupie
Avatar

Joined: 22 November 2004
Location: Austria
Status: Offline
Points: 76
Post Options Post Options   Thanks (0) Thanks(0)   Quote sbinder Quote  Post ReplyReply Direct Link To This Post Posted: 08 June 2018 at 7:10am
Dynamic x86
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Posted: 07 June 2018 at 10:13am
Hello,

Please describe your environment,  library configuration (Unicode, Static, Dynamic, x86, x64, ...)

Regards,
 Oleksandr Lebed
Back to Top
sbinder View Drop Down
Groupie
Groupie
Avatar

Joined: 22 November 2004
Location: Austria
Status: Offline
Points: 76
Post Options Post Options   Thanks (1) Thanks(1)   Quote sbinder Quote  Post ReplyReply Direct Link To This Post Posted: 07 June 2018 at 7:08am
The Preview-Modus in ReportControl does not work since 18.4.0!
See ReportSample


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.156 seconds.