How to correctly use Markup in a ReportRecordItem |
Post Reply |
Author | ||||
AntiChecker
Newbie Joined: 25 May 2010 Status: Offline Points: 6 |
Post Options
Thanks(0)
Posted: 25 May 2010 at 11:38am |
|||
Hi,
I'm trying to use Markup in a ReportRecordItem, but I cannot figure it out how to correctly do it. Running the sample "C:\<ProgramFiles>\Codejock Xtreme SuitePro ActiveX v13.3.1\Samples\ReportControl\VB\ReportSample\ReportSample.vbp" opens the "ReportControl Sample" window containing a subject called "[CodeToolBox] Newsletter (10 May 2004)". What I want to achieve by using Markup is that the subject's word "Newsletter" is displayed in red, resulting in the following: [CodeToolBox] Newsletter (10 May 2004) To get this result I have done the following in the code window of frmMain.frm: Replaced
Directly below this assignment I inserted
After running the sample again the mentioned subject is displayed as "<TextBlock>[CodeToolBox] <Run Foreground='red'> Newsletter</Run> (10 May 2004)</TextBlock>" rather than as "[CodeToolBox] Newsletter (10 May 2004)". Any ideas what I'm doing wrong and how to achieve the word Newsletter beeing displayed in red by using Markup in this ReportRecordItem? Thank you for your help. AntiChecker |
||||
Product: Xtreme SuitePro (ActiveX) v13.4.0
Platform: Windows XP Professional (32bit) - SP 3 Language: Visual Basic 6.0 |
||||
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
|||
Hi,
Markup string is OK but you have to set wndReportControl.EnableMarkup = True before you assign any "Markup values" to ReportItems.
|
||||
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
||||
AntiChecker
Newbie Joined: 25 May 2010 Status: Offline Points: 6 |
Post Options
Thanks(0)
|
|||
Hi Aaron,
thank you for the tip. But in the mentioned assignment
Nevertheless, it seems that it does not matter WHEN wndReportControl.EnableMarkup = True is set, as long as it is BEFORE
Any other ideas what I'm doing wrong? |
||||
Product: Xtreme SuitePro (ActiveX) v13.4.0
Platform: Windows XP Professional (32bit) - SP 3 Language: Visual Basic 6.0 |
||||
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
|||
Hi,
I think you are adding ReportItem and assign (Markup) value directly to it? In that case set wndReportControl.PaintManager.ForceDynamicMarkupForCell = True or you can use .Caption when adding items
This is how it could be done:
With Me.wndReportControl
.EnableMarkup = True .PaintManager.ForceDynamicMarkupForCell = True .Columns.Add 0, "Column 1", 100, True With Me.wndReportControl With .Records.Add() With .AddItem("<TextBlock>[CodeToolBox] <Run Foreground='Red'> Newsletter</Run> (10 May 2004)</TextBlock>") End With
End With End With wndReportControl.Populate End With OR
With Me.wndReportControl
.EnableMarkup = True .Columns.Add 0, "Column 1", 100, True With Me.wndReportControl With .Records.Add() With .AddItem("") .Caption = "<TextBlock>[CodeToolBox] <Run Foreground='Red'> Newsletter</Run> (10 May 2004)</TextBlock>" End With End With End With wndReportControl.Populate End With Hope this helps
|
||||
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
||||
AntiChecker
Newbie Joined: 25 May 2010 Status: Offline Points: 6 |
Post Options
Thanks(0)
|
|||
Hi Aaron,
Yes, it helped a lot. Because now it DOES work. Thank you very much for this code snippet. Something like this should have been mentioned in the help file (SymbolReference.chm), but I have nothing found about correctly setting up Markup usage for a ReportRecordItem, also because there is no Codejock ReportRecordItem sample where you could look at. After some additional investigation I found out the following: The statement
adds the string "<TextBlock>[CodeToolBox] <Run Foreground='Red'> Newsletter</Run> (10 May 2004)</TextBlock>" BOTH to the .Value AND to the .Caption property of the added ReportRecordItem, and THAT IS the problem, when you do NOT use
which - according to SymbolReference.chm - should be used "Only for virtual mode!". In other words, to have Markup correctly set up for a ReportRecordItem it is required that its .Caption property contains the Markup and its .Value property is "", and this can only be achieved by the snippet you mentioned, so that's the solution:
Note, that setting a ReportRecordItem's .Value property always implicitely sets its .Caption property too, so be careful. In other words, trying to assign the Markup to the .Caption property first and then setting .Value = "" does not work, because in this case .Caption would also be "", that is, the Markup has gone away by means of the .Value = "" assignment. Again, thank you very much for your help, Aaron. AntiChecker (is now a Checker) PS: Please set the topic to [SOLVED] |
||||
Product: Xtreme SuitePro (ActiveX) v13.4.0
Platform: Windows XP Professional (32bit) - SP 3 Language: Visual Basic 6.0 |
||||
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 |