logo
small logo
  • Produkty
  • Zamów
  • Wsparcie techniczne
  • Articles
  • Customer panel Wsparcie techniczne
    • en
    • de
    • JP
    • ZH
  • Glówna strona
  • /
  • Articles
  • /
  • How to use the new TextObject.TextRenderType property
  • Rodzina generatorów raportów FastReport krótka recenzja

    23 marca 2020

    Bez raportowania nie da się prowadzić działalności w żadnej dziedzinie. Biurokracja jest nieodłączną częścią ludzkiego

    read more
  • Jak zaktualizować raport sieci Web FastReport.Core

    21 września 2020

    Czasami trzeba zaktualizować raport, na przykład, jeśli dodana została nowa wartość zmiennej lub jeśli w

    read more
  • Raporty i dokumenty PDF w Blazorze

    5 kwietnia 2021

    Microsoft udostępnił niedawno platformę webową o nazwie Blazor. Framework ten umożliwia tworzenie interaktywnych interfejsów internetowych

    read more
  • Jak zainstalować FastReport Business Graphics .NET

    18 sierpnia 2021

    Ten artykuł wyjaśnia, jak zainstalować FastReport Business Graphics .NET na Twoim komputerze i jak dodać

    read more
  • Nadruk na papierze toaletowym

    30 marca 2020

    Panowie, żarty na bok! Dziś porozmawiamy o papierze toaletowym. Ten niezbędny artykuł higieniczny pojawił się

    read more

How to use the new TextObject.TextRenderType property

29 maja 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 pobierz zamów
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
  • Zamów
  • Pobierz
  • Dokumentacja
  • Opinie użytkowników
  • Jak odinstalować nasze produkty
  • Ticket system
  • FAQ
  • Tutorial Video
  • Forum
  • Articles
  • Our News
  • Prasa o nas
  • Partnerzy
  • Extended licensing
  • Kontakty

© 1998-2022 by Fast Reports Inc.

  • Poufność