logo
small logo
  • Products
  • Comprar
  • Suporte
  • Articles
  • Customer panel Suporte
    • en
    • pt
    • es
    • de
    • pl
    • JP
    • ZH
  • Home
  • /
  • Articles
  • /
  • How to use the new TextObject.TextRenderType property
  • Create a new report with code VB.NET

    17 de setembro de 2020

    Speaking of the .Net framework, we usually imagine the #C programming language. Simply because the

    read more
  • The Event of ExportParameters in WebReport.Report

    5 de outubro de 2020

    In FastReport 2020.1 we have added the ability to change export parameters. To do this,

    read more
  • PreviewControl.OnPrint and PreviewControl.OnExport Events

    1 de outubro de 2020

    In FastReport 2019.4 added the ability to subscribe to PreviewControl.OnPrint and PreviewControl.OnExport events, which are

    read more
  • MS Word format vs. Open Document Text. Which is better?

    19 de outubro de 2020

    Speaking of text editors, we immediately present coryphaeus as Microsoft Word, which for many years

    read more
  • Want to generate tables for a user - Excel or OpenOffice Calc?

    8 de outubro de 2020

    Tables. For centuries, they have been used to present similar data for record-keeping, counting amounts,

    read more

How to use the new TextObject.TextRenderType property

29 de maio de 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 comprar
avatar
Dmitriy Fedyashov
Technical Writer
Fast Reports Team: Dmitriy Fedyashov - Technical Writer at Fast Reports
.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
  • Comprar
  • Download
  • Documentação
  • Depoimentos
  • Como desinstalar nossos produtos
  • Ticket system
  • FAQ
  • Tutorial Video
  • Forum
  • Articles
  • Our News
  • Informação sobre nós
  • Parceiros
  • Extended licensing
  • Contatos

© 1998-2022 by Fast Reports Inc.

  • Privacidade