Page 1 of 1

TRVReportHelper::PagesCount Problem

Posted: Mon May 12, 2014 1:57 am
by hacqing
hi, i use follow code to get page counts:

Code: Select all

    int imageWidth = 0, imageHeight = 0;
    imageWidth = editContext->param.pageWidth;
    imageHeight = editContext->param.pageHeight;
    if ((imageWidth == 0)) {
        return ;
    }

    rvh->RichView->LeftMargin   = 0;
    rvh->RichView->TopMargin    = 0;
    rvh->RichView->RightMargin  = 0;
    rvh->RichView->BottomMargin = 0;

    rvh->RichView->WordWrap = true;
    rvh->Init(this->Canvas, imageWidth);
    while (rvh->FormatNextPage(imageHeight));

    *pages = rvh->PagesCount;
    if (rve != NULL) {
        *curPageNo = rvh->GetPageNo(rvh->RichView->RVData, rve->CurItemNo, rve->OffsetInCurItem);
    }
i puts text to RichViewEdit, *pages and *curPageNo is right. but i put any size picture to RichViewEdit, *pages and *curPageNo always is 1.
is RichViewEdit bug? can you help me? thanks. :)

Posted: Mon May 12, 2014 8:18 am
by Sergey Tkachenko
Can you send me a simple project to reproduce the problem?
To richviewgmailcom.

Posted: Mon May 12, 2014 10:43 am
by hacqing
I sent an email with the details.

Thank you very much!