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

Stimulsoft Reports.NET discussion
Post Reply
samueldearaujo
Posts: 10
Joined: Tue Oct 15, 2013 7:49 pm
Location: Itaúna, Minas Gerais, Brasil

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

Post 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 1921 times
2.jpg
2.jpg (61.28 KiB) Viewed 1921 times
3.jpg
3.jpg (67.05 KiB) Viewed 1921 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

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

Post 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.
samueldearaujo
Posts: 10
Joined: Tue Oct 15, 2013 7:49 pm
Location: Itaúna, Minas Gerais, Brasil

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

Post by samueldearaujo »

That's it!
Thanks, now the rtf field is working properly.
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

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

Post by Andrew »

Hello,

Great!

Thank you for letting us know about this.
Post Reply