Print Page | Close Window

[solved] empty ReportRecordItemPreview

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=23651
Printed Date: 22 October 2018 at 6:36am


Topic: [solved] empty ReportRecordItemPreview
Posted By: sbinder
Subject: [solved] empty ReportRecordItemPreview
Date Posted: 07 June 2018 at 7:08am
The Preview-Modus in ReportControl does not work since 18.4.0!
See ReportSample





Replies:
Posted By: olebed
Date Posted: 07 June 2018 at 10:13am
Hello,

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

Regards,
 Oleksandr Lebed


Posted By: sbinder
Date Posted: 08 June 2018 at 7:10am
Dynamic x86


Posted By: olebed
Date 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


Posted By: Muckl
Date Posted: 23 July 2018 at 11:54am
I have the same problem with ActiveX. Is there also any solution?


Posted By: olebed
Date 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


Posted By: docontrol
Date 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.



Print Page | Close Window