Report markup problem! |
Post Reply |
Author | |
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
Posted: 03 May 2008 at 10:45am |
AddRecord(new CMyRecord(...));
Inside CMyRecord I format some markup text in the added items, but it will never be parsed due to this:
void CXTPReportRecordItem::SetCaption(LPCTSTR strCaption)
{ m_strCaption = strCaption; XTPMarkupReleaseElement(m_pMarkupUIElement);
if (m_pRecord && m_pRecord->m_pRecords && m_pRecord->m_pRecords->GetMarkupContext())
{ m_pMarkupUIElement = XTPMarkupParseText(m_pRecord->m_pRecords->GetMarkupContext(), strCaption); } } m_pRecord->m_pRecords will always be NULL! So the question is; do I have to explicitly call SetCaption on all my items after I have added the record? That seems odd!
This works (also seen in Report Sample):
GetRecords()->GetAt(0)->GetItem(0)->SetCaption("<TextBlock><Run Foreground='Red'>Test</Run></TextBlock>");
|
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
Possible solution would be to call an update-function somewhere below XTPReportRecord.cpp(118):
pItem->OnItemAdded(); ... then I could call SetCaption in this function. Perhaps you can think of a better design. *back to coding*
|
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
Can you please change this in v12.0.2?
All other controls have simple SetMarkupText-functions. Report records cannot be "marked" before the record has been added. This is painful!
Perhaps CXTPReportRecordItem should be able to use its own markup context-pointer (default to NULL)!
new CXTPReportRecordItem("<TextBlock>...</TextBlock>", m_wndReport.GetRecords().GetMarkupContext()); Then in CXTPReportRecordItem::SetCaption...
if (m_pMarkupContext)
m_pMarkupUIElement = XTPMarkupParseText(m_pMarkupContext, strCaption); else if (m_pRecord && m_pRecord->m_pRecords && m_pRecord->m_pRecords->GetMarkupContext()) { m_pMarkupUIElement = XTPMarkupParseText(m_pRecord->m_pRecords->GetMarkupContext(), strCaption);
}
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |