Print Page | Close Window

Multiline rows in Virtual mode

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=4429
Printed Date: 31 October 2024 at 9:12pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Multiline rows in Virtual mode
Posted By: stiff upper lip
Subject: Multiline rows in Virtual mode
Date Posted: 17 June 2006 at 10:02am
hi
 
How I can use different height for different rows in virtual mode , I use extreme report control in virtual mode to read data from access data base , I tried to do the same as report control sample , means , to create a new class  CReportMultilinePaintManager  , and override the

CReportMultilinePaintManager::GetRowHeight( ....) function , but it wont work:( , Cry , can you help me to get over this problem

 



Replies:
Posted By: sserge
Date Posted: 17 June 2006 at 3:36pm
hi,

please look into http://forum.codejock.com/forum_posts.asp?TID=4086 - http://forum.codejock.com/forum_posts.asp?TID=4086

--
WBR,
Serge


Posted By: stiff upper lip
Date Posted: 20 June 2006 at 4:50am
I wanted to use the same CReportMultilinePaintManager class used in the reportcontrol sample , here is the code :
 

int CReportMultilinePaintManager::GetRowHeight(CDC* pDC, CXTPReportRow* pRow)

{

if (pRow->IsGroupRow() || !pRow->IsItemsVisible())

return CXTPReportPaintManager::GetRowHeight(pDC, pRow);

CXTPReportColumns* pColumns = pRow->GetControl()->GetColumns();

int nColumnCount = pColumns->GetCount();

XTP_REPORTRECORDITEM_DRAWARGS drawArgs;

drawArgs.pControl = pRow->GetControl();

drawArgs.pDC = pDC;

drawArgs.pRow = pRow;

int nHeight = 0;

for (int nColumn = 0; nColumn < nColumnCount; nColumn++)

{

CXTPReportColumn* pColumn = pColumns->GetAt(nColumn);

if (pColumn && pColumn->IsVisible())

{

CXTPReportRecordItem* pItem = pRow->GetRecord()->GetItem(pColumn);

drawArgs.pItem = pItem;

XTP_REPORTRECORDITEM_METRICS itemMetrics;

pRow->GetItemMetrics(&drawArgs, &itemMetrics);

CXTPFontDC fnt(pDC, itemMetrics.pFont);

CRect rcItem(0, 0, pColumn->GetWidth() - 4, 0);

pRow->ShiftTreeIndent(rcItem, pColumn);

pItem->GetCaptionRect(&drawArgs, rcItem);

pDC->DrawText(pItem->GetCaption(pColumn), rcItem, DT_WORDBREAK|DT_CALCRECT);

nHeight = max(nHeight, rcItem.Height());

}

}

return max(nHeight + 5, m_nRowHeight) + (IsGridVisible(FALSE)? 1: 0);

}

but when I added this class to my program , it seems that pItem->GetCaption(pColumn)  always return an emptry string , and consequently GetRowHeight return 0 ,

is there another way to access my CXTPReportRecordItem and retreive the item text ?


Posted By: sserge
Date Posted: 25 June 2006 at 5:14pm
When you do use Virtual records, do not forget that actual text for an item is set after calling GetItemMetrics(...) method . So far, changing pItem->GetCaption(pColumn) in this code to itemMetrics.strText should help.

--
WBR,
Serge


Posted By: stiff upper lip
Date Posted: 26 June 2006 at 6:25am
hello sserge
 
thank you for the tip Smile ,  i have replaced pItem->GetCaption(pColumn)
with itemMetrics.strText , then you have to add the following code to make it working ,
you have to add :
 
drawArgs.pColumn = pColumn;
before you call :
pRow->GetItemMetrics(&drawArgs, &itemMetrics);
 
now it working fine , thanks again
 



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net