Click here to monitor SSC

Reading RTF (rich text format) from a SQL database table.

Last post 02-28-2010, 12:47 AM by Hashim Amla. 2 replies.
Sort Posts: Previous Next
  •  11-03-2009, 10:34 AM Post number 75993

    • Bbuhc is not online. Last active: 09-14-2011, 3:41 PM Bbuhc
    • Top 500 Contributor
    • Joined on 10-31-2009
    • Level 1: Deep thought

    Reading RTF (rich text format) from a SQL database table.

    I am working on a report and I need to select the 'text' part of a column value that has RTF characters embeded in the data.. Below is an example of a value:

    {\rtf1\ansi\ansicpg1252\uc1\deff0{\fonttbl  {\f0\fswiss\fcharset0\fprq2 Arial;}  {\f1\froman\fcharset0\fprq2 Times New Roman;}  {\f2\froman\fcharset2\fprq2 Symbol;}}  {\colortbl;\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue0;}  {\stylesheet{\s0\itap0\f0\fs24 [Normal];}{\*\cs10\additive Default Paragraph Font;}}  {\*\generator TX_RTF32 11.0.401.504;}  \deftab1134\paperw12240\paperh15840\margl0\margt0\margr4\margb0\pgbrdrhead\pgbrdrfoot\sectd\headery567\footery567  {\header\pard\itap0\plain\f0\fs24\par}  {\footer\pard\itap0\plain\f0\fs24\par}\pard\itap0\plain\f1\fs20\cf3 DO NOT ALLOW EXTENDED CREDIT FOR THIS CUSTOMER.\par CUSTOMER IS IN RECEIVERSHIP.\par\par OUTSTANDING BALANCE IS WITH COLLECTIONS.\par\par\par\pard\itap0}

     In the example above the actual text reads as follows:

    DO NOT ALLOW EXTENDED CREDIT FOR THIS CUSTOMER.

    CUSTOMER IS IN RECEIVERSHIP.

    OUTSTANDING BALANCE IS WITH COLLECTIONS.

    Idealy I would like a function that returns only the text part of the content with end of line indicators so I know when a new line starts, ie:

    select rtf_to_text(instructions)

    from credit_notes

    --the instructions column being the column with the RTF characters embeded with the text that I need and rtf_to_text being the function i hope some good soul will help me with.

    Any help would be greatly appriciated.

     

  •  11-10-2009, 1:17 AM Post number 76177 in reply to post number 75993

    Re: Reading RTF (rich text format) from a SQL database table.


    Hi Bbuhc,

    I hope this link fulfill of your requirement.
     
    http://www.codeguru.com/csharp/csharp/cs_controls/richtext/article.php/c7529/

    Thanks,
    Selvaraj
  •  02-28-2010, 12:47 AM Post number 90063 in reply to post number 75993

    Re: Reading RTF (rich text format) from a SQL database table.

    If you are in EM, go to design table and when you click on a column you can add description at the bottom.

    If you like to view all the descriptions execute the following command.
    select object_name(id), name from sysproperties .

    There are many issues of pakistan like water war
View as RSS news feed in XML