RTF Question

Stimulsoft Reports.NET discussion
Post Reply
EDV Gradl
Posts: 228
Joined: Sat Jun 17, 2006 9:50 am
Location: Germany

RTF Question

Post by EDV Gradl »

Hi Team from Stimulsoft,

I want to use the GetValue Event of a RTF to calcuate some lines. Is it possible to format the lines in the event (e.g. set alignment, set bold etc)?

Thanks a lot
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

RTF Question

Post by Vital »

You can use following code in GetValue event of RichText

Code: Select all

StiRichTextBox rich = new StiRichTextBox();

//Unpack rtf text
rich.Rtf = StiRichText.UnpackRtf(System.Xml.XmlConvert.DecodeName(e.Value));

//Select rtf range
rich.SelectionStart = 0;
rich.SelectionLength = 3;

rich.SelectionAlignment = StiRtfSelectionAlign.Center;
rich.SelectionColor = Color.Red;
rich.SelectionFont = new Font("Arial", 30);

//Pack rtf text
e.Value = System.Xml.XmlConvert.EncodeName(StiRichText.PackRtf(rich.Rtf));

rich.Dispose();
Post Reply