Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Report markup problem!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Report markup problem!

 Post Reply Post Reply
Author
Message
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Topic: Report markup problem!
    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>");
 
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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*
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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);
}
 
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.