Method Community

 

Reporting Activity Comments without HTML

Last post 11-04-2014 1:24 PM by robert.cowart. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 10-29-2014 1:14 PM

    Reporting Activity Comments without HTML

    Is there a way to do an HTML Sanitize function on Activity.Comments so in a report I just get the text without the HTML?  We really need a way to report on text columns that have embedded html -- without the html in the pdf.  PDF viewers handle the html as plain text and it looks awful.  Help!!

    wrote a recursive HTML Sanitize VB.Net function for SQL Server SSIS jobs for our website but I don't see anything like it in Method.  

    In the meantime, I have disabled "Show in HTML editor" in my screens.  Going forward the HTML will not be there.  Comments previously entered may be chalk full of html.   Ugh...  Thanks.

  • 11-04-2014 8:43 AM In reply to

    Re: Reporting Activity Comments without HTML

    Hi Robert,

    Sorry about the late reply. In our CRM_Activities_WithComments report template we have code that removes the HTML for the activity comments. It can be found below:

    Depending on where you are creating your report, you should be able to use a similar script to remove the HTML.

    Hope this helps,

    - Adam

    Adam Lyons
    Manager of Support
    Method Integration
    a.lyons@method.me
  • 11-04-2014 1:24 PM In reply to

    Re: Reporting Activity Comments without HTML

    The typed out code is:

    Imports System.Text.RegularExpressions

    Private Sub OnBeforePrint(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintEventArgs)

    CType(sender, XRLabel).text = Regex.Replace(Regex.Replace(Regex.Replace(CType(sender, XRLabel).text, "<[^>]+?>", ""), "&nbsp;", " "), "&middot;", "")

    End Sub


    Thanks!

Page 1 of 1 (3 items)