Page 1 of 1

Loading varbinary(max)/byte[] into RTF Component

Posted: Tue Nov 26, 2013 11:47 am
by samueldearaujo
Hello!
I'm trying to loading a varbinary(max) field in RTF Component, but it's not working.
I changed the DataColumn of the RTF component, like describe in manual, but nothing appears in report. http://www.stimulsoft.com/en/documentat ... _field.htm
The type of field in Dictionary is byte[].
There is a way to convert this field (varbinary(max))/byte[] to RTF directly? Because i not found anything that explains this, and in C# i use :

" ASCIIEncoding encoding = new ASCIIEncoding();
rich.Rtf = encoding.GetString(byte[]);
"

Thanks!!

These are some pictures:
1.jpg
1.jpg (47.01 KiB) Viewed 1923 times
2.jpg
2.jpg (61.28 KiB) Viewed 1923 times
3.jpg
3.jpg (67.05 KiB) Viewed 1923 times

Re: Loading varbinary(max)/byte[] into RTF Component

Posted: Fri Nov 29, 2013 7:29 am
by HighAley
Hello.

Please add next code in the GetData event of the RichText component:

Code: Select all

e.Value = StiRichText.PackRtf(System.Text.Encoding.UTF8.GetString(your_dataSource.your_field));
Thank you.

Re: Loading varbinary(max)/byte[] into RTF Component

Posted: Tue Dec 03, 2013 11:04 am
by samueldearaujo
That's it!
Thanks, now the rtf field is working properly.

Re: Loading varbinary(max)/byte[] into RTF Component

Posted: Wed Dec 04, 2013 2:32 am
by Andrew
Hello,

Great!

Thank you for letting us know about this.