logo
small logo
  • Products
  • Buy
  • Support
  • Articles
  • Customer panel Support
    • en
    • ru
    • pt
    • es
    • de
    • pl
    • JP
    • ZH
  • Home
  • /
  • Articles
  • /
  • How to use the new TextObject.TextRenderType property
  • How to use Online Designer in ASP .Net Core

    January 17, 2018

    One of the novelties by FastReport .Net 2018 was the adaptation of OnlineDesigner to the

    read more
  • How to use WebReport with ASP .Net Web Core application

    January 17, 2018

    Recently FastReport introduced a new library under the .Net - FastReport Core platform. This is

    read more
  • FastCube - High-Speed OLAP Cube Engine and Pivot Grid

    February 29, 2020

    It is difficult to imagine data analysis without OLAP (On-Line Analytical Processing) technology. Although there

    read more
  • Report generators family FastReport brief review

    March 23, 2020

    Without reporting it is impossible to carry on business in any sphere of life. Bureaucracy

    read more
  • How to make the same report pages with different headers

    January 8, 2020

    Sometimes your work needs one and the same report, but with a few changes. For

    read more

How to use the new TextObject.TextRenderType property

May 29, 2018

The new property came to replace the obsolete HtmlTags. Now the TextRenderType property is responsible for processing html tags, and not only. This property has three possible values:

  1. Default – just text, without any tag transformations;
  2. HtmlTags – applying html tags. Their list is rather limited: b, i, u, strike, br, sub, sup, img;
  3. HtmlParagraph - allows you to adjust the line spacing, the first line indent and all the same tags as the HtmlTags;

Previously, the HtmlTags property allowed some HTML tags to be used in the TextObject. One of the available tags was the FONT tag. This tag is obsolete, and not all browsers adequately support it. Therefore, a new visualization handler was added, which allows you to use some CSS styles, in the style attribute of the span tag.

Now let's consider in more details the new modes of processing Html tags:

HtmlTags

As previously mentioned, the Text object supports the following html tags:

  • • b - bold text style.

Example of use:

1
<b> FastReport </ b>

 Result:

 

  • • i - italic text style.

Example of use:

1
<i> FastReport </ i>

 Result:

 

  • • u - text style underlined.

Example of use:

1
<u> FastReport </ u>

 Result:

  • • strike - crossed out text style

Example of use:

1
<strike> FastReport </ strike>

 Result:

 

  • • br - line break

Example of use:

1
Fast<br>Report

 Result:

 

• sub - displays the text in the lower index

Example of use:

1
<sub> Fast </ sub> Report

 Result:

 

  • • sup - displays the text in the upper index

Example of use:

1
<sup> Fast </ sup> Report

 Result:

 

  • • img - insert images into text. The img tag only supports the src (http, https, base64) attribute and the width and height attributes (values in pixels). So you can insert images directly into the text. The http and https image sources are relevant for web reports.

Example of use:

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAAyCAIAAACPlC9VAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGkSURBVGhD7dDRjoMgEAXQ/v9Pd417poEVBBRttul569yRuenjOc+jxd5pEx7SaIQvjzr+vfvneGvQkc8cnMe73cY+cOQabnQYWe1gtcTGLqst3Xu7LHXzWYmNXX1LFeKjvLIhruvYKJHN4MWcrKIVl8jm8W5OVrKblchm83pOtlEPSmTXcCMnyw2UFlzJpYQgV5luCK7nXkKQ6CptehdXg2miNNoQ3MXVhCC0S5vey+1gGja/NwT3cjshWDVKm76DBsF09S09lQYJwZ/SwmD6PnoE02/p+fQIpt/S8+kRTL+l59MjmH5C6YU8mL6DBgnBPyptuvrE0gvBvdxOCFaFTraC6b3cDqahXXohuIurCUEoF7IbTO/iakIQukovBNdzLyFIVNv4IiG4kksJQW6g9EJ2DTdystxeD9/lZLN5PSfbaJTwdU42j3dzspJ2A2/kZDN4MSer6DrvpQ3xUV4psVHRe9hjJTZG+LLExq6Bk17dZbXExi6rLWP/k7ev4UaHsdK/HJnHu92OlP7l4DneGnS89Iv7g3x8yITSL+rU2Tvp+fwB+FeG5yXqCcoAAAAASUVORK5CYII=" alt="" />

Result:

 

 HtmlParagraph

This mode enables a new html renderer. It works with the same set of tags as HtmlTags, plus a new span tag. Despite the fact that the set of tags for this mode is almost the same, they are drawn differently. This is especially noticeable on the <sub> and <sup> tags.

The added span tag allows you to set the display style of the text. You can specify the simplest CSS styles in the style attribute. This is enough not to remember the obsolete tag Font.

Examples of use:

1
2
3
4
<span style="font-size:20pt;">FastReport</span>
<span style="color:red;">Fast</span>Report
<span style="font-family:Consolas;">FastReport</span>
<span style="background-color:yellow;">FastReport</span>

 Result:

 

ParagraphFormat

Separately it is necessary to talk about the new property ParagraphFormat. It works in conjunction with the HtmlParagraph property, and is a setting for displaying paragraphs (line spacing, indent of a red line). Namely:

  • FirstLineIndent - indent of the first line;
  • LineSpacing - distance between lines in centimeters;
  • LineSpacingMultiple - multiplier by previous parameter value. Works with the Multiple type;
  • Type of line spacing:
    • Single;
    • At least;
    • Exact;
    • Multiple.

Example settings:

 

Result:

 

Thus, the Text object turns into a full replacement for the RichText object, which allows you to load formatted Rtf documents.

about product download buy
avatar
Dmitriy Fedyashov
Head of QA
.NET FastReport

Add comment
logo
  • 800-985-8986 (English, US)
  • +4930568373928 (German)
  • +55 19 98147-8148 (Portuguese)
  • info@fast-report.com
  • 901 N Pitt Str #325 Alexandria VA 22314
  • Buy
  • Download
  • Documentation
  • Testimonials
  • How to uninstall
  • Ticket system
  • FAQ
  • Tutorial Video
  • Forum
  • Articles
  • Our News
  • Press about us
  • Resellers
  • Our team
  • Contact us

© 1998-2021 by Fast Reports Inc.

  • Privacy Policy