Page 1 of 1

Rich Text

Posted: Tue Nov 20, 2007 12:54 pm
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...

Rich Text

Posted: Wed Nov 21, 2007 9:50 am
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.

Rich Text

Posted: Thu Nov 22, 2007 9:59 am
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.

Rich Text

Posted: Fri Nov 23, 2007 12:36 am
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.