[SOLVED] Markup and refreshing |
Post Reply |
Author | ||||||||
Aaron Koolen
Groupie Joined: 22 July 2009 Status: Offline Points: 32 |
Post Options
Thanks(0)
Posted: 29 March 2015 at 10:44pm |
|||||||
Hi all. I have a report control with markup enabled. There seems to be a few things I must be missing to get the control to update and display properly so I hope someone can help.
I enable markup on the control with EnableMarkup() but I also found I needed to set m_bForceDynamicMarkupForCell in the paint manager otherwise I found that after calling Populate() I had to go through each record in the control and refresh it's contents with calls to SetCaption(). I have found that if I create an item for a record and give it initial text, then the size of the cell is not calculated due to the markup, but to the contents, unparsed. So the cells end up larger than they should be. If I refresh the items manually (As above) then it recalculates. If I dynamically update an item of a record, then the scroll bars to not adjust. If the item made the cell larger then the bottom of the report control is cut off. I have to call AdjustScrollBars() to get it to work. All in all it seems that markup in report controls are not particularly dynamic and in some cases quite bugged. I would have expected to have just had to set the EnableMarkup(TRUE) on the control, set the markup when either creating the items with AddItem or changing them with SetCaption and have everything adjust correctly. It certainly doesn't seem to work that way. Is there some documented set of steps to create and update markup items? Thanks Aaron
|
||||||||
Product: Xtreme ToolkitPro v13.3.0 (MFC)
Platform: Windows XP (32bit) - SP 3 Language: Visual C++ 6 |
||||||||
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
|||||||
Hello Aaron,
Thank you. Regards, Oleksandr Lebed |
||||||||
Aaron Koolen
Groupie Joined: 22 July 2009 Status: Offline Points: 32 |
Post Options
Thanks(0)
|
|||||||
Thanks for the reply Oleksandr.
Sorry if I wasn't clear. I don't want to show unparsed markup, but that's what I was getting until I called SetCaption() after a Populate(). So I can't even go AddRecord(record), record->SetCaption(xml). I have to add all the records, call Populate() and then iterate over all the records calling SetCaption().
Here's some pseudocode. Inside my MyDerivedRuleRecord constructor I go
and in my derived report control I have
Maybe it would be good to have this work within a BeginUpdate()/EndUpdate() system. That way you could transactionalise it or if you didn' bother, the updating would happen automatically. We're using 16.3.1. I think overall, if there was actual documentation on using CodeJock and not just a reference manual, many many hours of developer time could have been saved as we tend to have to go looking around source code and scouring interfaces and example code to find out the way CodeJock wants us to do things. Thanks Aaron
|
||||||||
Product: Xtreme ToolkitPro v13.3.0 (MFC)
Platform: Windows XP (32bit) - SP 3 Language: Visual C++ 6 |
||||||||
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
|||||||
Hello Aaron,
Thank you for bringing this to our attention. I have discovered that implementation of markup in ReportControl really wasn't finished. I have fixed issues with refreshing of markup. The fix will be available in the next beta or final release. Therefore, from next release: 1) CXTPReportControl::EnableMarkup() works at any moment correctly and refresh markup elements of recordItems, column's headers, groupRows, scrollBars. But developer must update content of ReportRecordItems to appropriate text with ReportRecordItems::SetCaption() anyway. Oterwise users will see unparsed xml. 2) diverse initialization order supported. For example: create recordItems [markuped/plain captions can be setted there], create record and add items [or there], add record to reportControl [or there]. 3) fixed: If ReportRecordItem has already markuped caption CXTPReportRecordItem::m_strCaption then there is no way to set markuped content through GetItemMetrics() and metrics->strText when pPaintManager->m_bForceDynamicMarkupForCell is TRUE or VirtualMode turned on. So markup content can be setted also through GetItemMetrics() and metrics->strText when pPaintManager->m_bForceDynamicMarkupForCell is TRUE or VirtualMode turned on. Note that CXTPReportPaintManager::m_bForceDynamicMarkupForCell saves memory BUT this is expensive for processor because it forces creating and destroying temporary markup objects every time when ReportRecordItems::OnDrawCaption() method. m_bForceDynamicMarkupForCell used as analog to virtual mode behaviour. Usual behaviour is creating markup objects only on SetCaption() or EnableMarkup(TRUE). Regards, Oleksandr Lebed |
||||||||
markr
Senior Member Joined: 01 August 2004 Status: Offline Points: 443 |
Post Options
Thanks(0)
|
|||||||
In some instances, we need to inject markup through GetItemMetrics() because we don't know the dimensions of the rendered cell rectangle prior to that point. This may happen whether the control is using virtual mode or not.
In such cases, I find that the BestFit() method (or double clicking on a column divider to auto-size) no longer works correctly for such columns. It appears to be resizing according to the unparsed markup (rather than the rendered markup). Is this a bug, or am I perhaps missing something? Any thoughts on a workaround? - Mark R.
|
||||||||
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 |