Tuesday, March 27, 2012

Ability to load a TextBox with RichText ?

Is it possible (using SQL Server Reporting Services) to load a 'TextBox'
component with the contents of a RichText file (i.e. from a saved file
'testRpt.rtf') ?
Any suggestions would be appreciated.
Thanks in advance ...
SteveNo but yes I can solve your problem!
You can't get RTF text neatly formatted into a Reporting Services Textbox
control. - you could create a .NET function to strip the RTF content and
just display the raw text - but that's not what you really want is it?
So what you can do is create a .NET function in a custom assembly that you
pass the RTF into and have it return an image stream and what you then do is
bind that image data to a Reporting Services Image control.
(in the function you'll need to use the CreateGraphics() method.)
Hope that helps. If you need help on creating custom assemblies Chapter 9 of
our book does a great job showing how to progress and how to get Code Access
Security properly configured. We had intended to include the RTF example
but time and space meant that we didn't. I'll probably be doing an article
on this RTF example in the coming months in the Premium area of our web
site.
Peter Blackburn
www.sqlreportingservices.net
"Steve_S3T" <SteveS3T@.discussions.microsoft.com> wrote in message
news:BC061D8B-5FCC-4465-BE99-233BF1CFB292@.microsoft.com...
> Is it possible (using SQL Server Reporting Services) to load a 'TextBox'
> component with the contents of a RichText file (i.e. from a saved file
> 'testRpt.rtf') ?
> Any suggestions would be appreciated.
> Thanks in advance ...
> Steve|||Due to the fact that there's no direct route with this - I'm going to leave
it well alone. :(
Much least of all because I hate doing excessive coding if there's a more
direct approach - in this case I've found an alternate route via DataDynamics
ActiveReports - cue many groans ...
I'm still waiting on a copy of your book - it's been on order a while now.
I'll give that chapter a look through when the book finally gets to me ...
Steve
"Peter Blackburn (www.sqlreportingservice" wrote:
> No but yes I can solve your problem!
> You can't get RTF text neatly formatted into a Reporting Services Textbox
> control. - you could create a .NET function to strip the RTF content and
> just display the raw text - but that's not what you really want is it?
> So what you can do is create a .NET function in a custom assembly that you
> pass the RTF into and have it return an image stream and what you then do is
> bind that image data to a Reporting Services Image control.
> (in the function you'll need to use the CreateGraphics() method.)
> Hope that helps. If you need help on creating custom assemblies Chapter 9 of
> our book does a great job showing how to progress and how to get Code Access
> Security properly configured. We had intended to include the RTF example
> but time and space meant that we didn't. I'll probably be doing an article
> on this RTF example in the coming months in the Premium area of our web
> site.
> Peter Blackburn
> www.sqlreportingservices.net
>
>
> "Steve_S3T" <SteveS3T@.discussions.microsoft.com> wrote in message
> news:BC061D8B-5FCC-4465-BE99-233BF1CFB292@.microsoft.com...
> > Is it possible (using SQL Server Reporting Services) to load a 'TextBox'
> > component with the contents of a RichText file (i.e. from a saved file
> > 'testRpt.rtf') ?
> > Any suggestions would be appreciated.
> > Thanks in advance ...
> > Steve
>
>

No comments:

Post a Comment