Rich Text

Stimulsoft Reports.NET discussion
Post Reply
Chan Kuan Leang
Posts: 74
Joined: Sun May 20, 2007 9:14 pm
Location: Singapore

Rich Text

Post by Chan Kuan Leang »

Hi, is there any tutorial teaching us how to use the Rich text?

I am unable to link my database (MsSql 2005 with asp.net) to the textbox.

Even if I can link, all the words turned out to be so funny & strange.

Code: Select all

This is a test productTo ensure it can works                            1 unitOn the same line                                         1 unitSuper trying                                                  1 unit
In my software, I have use freetextbox to created the rich text. But, I am unable to make the reports come out as the way I had design in freetextbox.

Please advice. Desperately need to solve this problem.
Thanks...
Smile
Chan Kuan Leang
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Rich Text

Post by Edward »

To transfer Rtf text from the file stream or memory stream please in the GetValue event of the RichText component, write the following code:

Code: Select all

C#

System.IO.StreamReader reader = new System.IO.StreamReader("d:\\script.rtf");
string str = reader.ReadToEnd();
reader.Close();
e.Value = System.Xml.XmlConvert.EncodeName(StiRichText.PackRtf(str));


VB

Dim Reader As System.IO.StreamReader = New System.IO.StreamReader("d:\\script.rtf")
Dim Str As String = Reader.ReadToEnd()
Reader.Close()
e.Value = System.Xml.XmlConvert.EncodeName(StiRichText.PackRtf(Str))

In your sample HTML tags were used. These tags are not supported in Stimulsoft Reports.Net .

Thank you.
Chan Kuan Leang
Posts: 74
Joined: Sun May 20, 2007 9:14 pm
Location: Singapore

Rich Text

Post by Chan Kuan Leang »

Edward wrote:To transfer Rtf text from the file stream or memory stream please in the GetValue event of the RichText component, write the following code:

Code: Select all

C#

System.IO.StreamReader reader = new System.IO.StreamReader("d:\\script.rtf");
string str = reader.ReadToEnd();
reader.Close();
e.Value = System.Xml.XmlConvert.EncodeName(StiRichText.PackRtf(str));


VB

Dim Reader As System.IO.StreamReader = New System.IO.StreamReader("d:\\script.rtf")
Dim Str As String = Reader.ReadToEnd()
Reader.Close()
e.Value = System.Xml.XmlConvert.EncodeName(StiRichText.PackRtf(Str))

In your sample HTML tags were used. These tags are not supported in Stimulsoft Reports.Net .

Thank you.
Is there a way to have ("d:\\script.rtf") to be a variable & link it to my database field "ProductID"?
Or can we link it to one of the column fields in the datasources of StimulReport. Sorry for my poor english & expression.
what I meant is something like d:\\ProductID.rtf where ProductID is from the datasource of stimulreport.

Thanks for your wonderful help.
Smile
Chan Kuan Leang
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Rich Text

Post by Vital »

If i right understand, you can use proeprty DataColumn of RichText. This property allow fill richtext with rtf which stored in database.

Thank you.
Post Reply