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: 18 June 2018 at 10:54pm


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



Print Page | Close Window