Print Page | Close Window

Report markup problem!

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=10473
Printed Date: 23 November 2024 at 2:18am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Report markup problem!
Posted By: znakeeye
Subject: Report markup problem!
Date 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>");
 



Replies:
Posted By: znakeeye
Date Posted: 03 May 2008 at 9:52pm
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*


Posted By: znakeeye
Date Posted: 28 June 2008 at 7:58pm
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);
}
 



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