Display Richt Text Format

Hi Alex,

we need to display rtf which is stored in the DB.

We tried "RichObject" but it didn't work properly, because it inserts additional rtf-tags.
Are there other means?

Best Regards
Claus

Comments

  • edited 5:07PM
    Hello,

    Connect RichObject to the data using the "DataColumn" property. It should work.
  • edited 5:07PM
    Hi Alex,

    thanks for quick answer.

    Unfortunatly it doesnt work. Please have a look at the pictures.
    Picture 1 shows the Attributes of "RichObject".
    Picture 2 shows the rtf info from the DB column.
    Picture 3 shows the output from FR.

    Best Regards
    Claus
  • edited 5:07PM
    Claus,

    Could you create a simple test case for me? I've tried to reproduce this error, but with no success.
  • edited 5:07PM
    Hi Alex,

    our sample works !? But the rtf info comes from a in memory DataTable.

    Did you see it in our picture:
    RichObject of the report shows exactly our rtf-info from the DB, but as plain text.
    The surrounding rtf-tags "{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}}
    \viewkind4\uc1\pard\lang1031\f0\fs17" and "\par }" are not shown.

    Do you have any advice how we can obtain diagnostics info from our application?
    Does the DB Datatype matter? We declared the rtf field as VARCHAR(...).

    Best Regards
    Claus
  • edited 5:07PM
    I've tried to make a simple test, it works. I've changed the nwind.xml database which comes with FRNetDemo:
    ...
      <Employees>
        <EmployeeID>1</EmployeeID>
        <LastName>Davolio</LastName>
        <FirstName>Nancy</FirstName>
        <Notes>{\rtf1 \ansi\ansicpg1252\deff0\deflang1031{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}}\viewkind4\uc1\pard\f0\fs17 This is some "rich text". \par }</Notes>
      </Employees>
    

    Then I've added RichObject and connected it to the "Notes" column. It prints the following:
    This is some "rich text".
    

    Important note: rtf string must begin with "{\rtf". If it does not (for example, " {\rtf"), you will see all rtf tags as is.
  • edited 5:07PM
    If you still have problems with rtf, do the following:

    - create a simple report that demonstrates this error;
    - in the "Data" window, select the data source;
    - press "View Data" button on the toolbar. This will load data into the table;
    - close the data view window;
    - go "Properties" window and set the StoreData property to true;
    - save your report and send it to me (tz@fast-report.com). The report will contain data from data source and may be big.
  • edited 5:07PM
    Hi Alex,

    many thanks for your patience!

    We're about to prepare the example.
    In step "- go "Properties" window and set the StoreData property to true;".
    From wich object? We do not find an object which exposes such an attribute.

    Best Regards
    Claus
  • edited 5:07PM
    Hello Claus,

    This property belongs to TableDataSource object. When you select the data source in the "Data" window, you will see its properties in the "Properties" window.
  • edited 5:07PM
    Alex, I'm sorry but I can't see it. Please have a look at the screenshots.
  • edited 5:07PM
    Seems you have old version of FastReport.Net, download new one.
  • edited 5:07PM

    ... now it works, FR.NET version 1.0.117.

    Thanks for your assistence
    Claus

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.