Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - How to correctly use Markup in a ReportRecordItem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to correctly use Markup in a ReportRecordItem

 Post Reply Post Reply
Author
Message
AntiChecker View Drop Down
Newbie
Newbie


Joined: 25 May 2010
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote AntiChecker Quote  Post ReplyReply Direct Link To This Post Topic: How to correctly use Markup in a ReportRecordItem
    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
Subject = "[CodeToolBox] Newsletter (10 May 2004)"
with
Subject = "<TextBlock>[CodeToolBox] <Run Foreground='red'> Newsletter</Run> (10 May 2004)</TextBlock>"

Directly below this assignment I inserted
wndReportControl.EnableMarkup = True

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
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 25 May 2010 at 1:38pm
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....
Back to Top
AntiChecker View Drop Down
Newbie
Newbie


Joined: 25 May 2010
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote AntiChecker Quote  Post ReplyReply Direct Link To This Post Posted: 25 May 2010 at 2:53pm
Hi Aaron,

thank you for the tip.

But in the mentioned assignment
Subject = "[CodeToolBox] Newsletter (10 May 2004)"
"Subject" is a variable which will be later (after setting wndReportControl.EnableMarkup = True) used in the Sub "AddRecord" in the statement
Record.AddItem Subject
therefore
wndReportControl.EnableMarkup = True
IS set BEFORE the Markup string is REALLY used in the ReportRecordItem.

Nevertheless, it seems that it does not matter WHEN wndReportControl.EnableMarkup = True is set, as long as it is BEFORE
wndReportControl.Populate


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
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 26 May 2010 at 9:55am
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
        .PaintManager.ForceDynamicMarkupForCell = 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....
Back to Top
AntiChecker View Drop Down
Newbie
Newbie


Joined: 25 May 2010
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote AntiChecker Quote  Post ReplyReply Direct Link To This Post Posted: 26 May 2010 at 11:57am
Hi Aaron,

Originally posted by Aaron Aaron wrote:

Hope this helps

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

.AddItem("<TextBlock>[CodeToolBox] <Run Foreground='Red'> Newsletter</Run> (10 May 2004)</TextBlock>")

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

.PaintManager.ForceDynamicMarkupForCell = True

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:

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
 

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
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.