Print Page | Close Window

How do I display HTML content correctly in RC

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=17948
Printed Date: 15 November 2024 at 6:34pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How do I display HTML content correctly in RC
Posted By: mstuart
Subject: How do I display HTML content correctly in RC
Date Posted: 23 February 2011 at 4:32pm
Hi all,
I need to display HTML content from an email HTMLBody (and RTFBody) in a cell in a Report Control.
Currently it shows all the tags and content, which is not what I want. I would like to show in the cell the content as HTML format.
I've played around with the ReportControl.EnableMarkup = true, but still doesn't work.
Actually, here's my VB6 code to set the properties:
    With ReportControl
        .AllowEdit = False
        .BorderStyle = xtpBorderThemedFrame
        .EnableMarkup = True
        .SetCustomDraw xtpCustomBeforeDrawRow
        .PaintManager.ColumnStyle = xtpColumnOffice2003
        .PaintManager.ForceDynamicMarkupForCell = True
    End With

And here's the code to add the record item:
    Set Item = Record.AddItem(RDOMail.HTMLBody)
    Item.Caption = "<TextBlock>" & RDOMail.HTMLBody & "</TextBlock>"

Nothing is working for me.

Any advice is welcome.




-------------
Regards,
Mark Stuart

Product: Xtreme SuitePro (ActiveX) v13.2.1
Platform: WinXP (32bit)/Win7 (64bit)
Language: VB6 (SP6), Magic eDeveloper v9.4, uniPaaS v1.9



Replies:
Posted By: jpbro
Date Posted: 23 February 2011 at 8:35pm
EnableMarkup is for Codejock's subset of XAML, not HTML.

There is no easy way to display HTML in a report that I can think of. You could create an HTML to XAML parser, but this would be no small feat (depending on what HTML tags you need to convert).

If you could render your HTML and RTF to a picture, you could store the pictures in the ReportControl icons collection and then show those pictures using the reportcontrol, but I'm not sure how efficient this would be (if you have a lot of records, it might not be feasible).




-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: mstuart
Date Posted: 24 February 2011 at 11:42am
Hi jpbro,
Thanx for your reply. I deferred to the email's Body property to show "only" plain text to the user in the RC.
When the user dbl-clicks the row to view the details, that's when I can show them the HTML/RTF in an ActiveX object I have called rmpHTML.




-------------
Regards,
Mark Stuart

Product: Xtreme SuitePro (ActiveX) v13.2.1
Platform: WinXP (32bit)/Win7 (64bit)
Language: VB6 (SP6), Magic eDeveloper v9.4, uniPaaS v1.9



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