Wednesday, March 21, 2012

Image From DB - There but not there

Tribe,
I'm struggling with the poorly implemented image handling in SSRS
(which is represented through ASP.NET via
Microsoft.Reporting.WebForms)
First off, SSRS/Reporting team - External Images should mean exactly
that. The report should express EXACTLY what I enter into the Value
field for an External type image in a report. The fact that the engine
interprets and munges this field is an utter travesty. If I enter "/
myDBImageDumper.aspx" this text is what should be expressed out
through the Web report viewer. Period. The use of this property
"UnattendedExecutionAccount" in order to allow the report engine to
render local images is a complete and total hack
Now, in dealing with a simple database supplied image in the reporting
body of a report, I've got an Image type field in a SQLExpress table.
I've loaded this field through a web FileUpload and stored the bytes
in the field. I can render these bytes out through a web page by using
the Response.WriteBinary(reader[IMAGEFIELDPOS]);
I mention this as I know that the image now in the database in the
correct mime format (jpeg).
So, back to the report. I've added an image field to the body of the
report (I want it in the header by alas that is also an
impossibility). To this field I've assigned the mime type "image/
jpeg", the Source of Database, and a Value of:
=System.Convert.ToBase64String(Fields!UserCompanyImage.Value,
"InvoiceHeader_InvoiceHeader")
And of course the image does not render.
Adding that same value to a text field however allows the Base64 to
get dumped out in to that field. Which proves the data is there.
However, I'm baffled as to how to get this image to show up.
Clues anyone
DCTribe,
I lied. I can get the image to show up in the body of the report by
using just the straight byte dump:
=First(Fields!UserCompanyImage.Value, "InvoiceHeader_InvoiceHeader")
But what I'm really trying to do is to get the image up in the header.
So I've got another identical image up in the header and I've got its
Value set to :
=Reportitems!imageLogo.Value
Where imageLogo is the name of the first, body of the report, image.
The header image does not render.
Clues 2?
DC
On Oct 8, 2:44 pm, bangeye <davecl...@.gmail.com> wrote:
> Tribe,
> I'm struggling with the poorly implemented image handling in SSRS
> (which is represented through ASP.NET via
> Microsoft.Reporting.WebForms)
> First off, SSRS/Reporting team - External Images should mean exactly
> that. The report should express EXACTLY what I enter into the Value
> field for an External type image in a report. The fact that the engine
> interprets and munges this field is an utter travesty. If I enter "/
> myDBImageDumper.aspx" this text is what should be expressed out
> through the Web report viewer. Period. The use of this property
> "UnattendedExecutionAccount" in order to allow the report engine to
> render local images is a complete and total hack
> Now, in dealing with a simple database supplied image in the reporting
> body of a report, I've got an Image type field in a SQLExpress table.
> I've loaded this field through a web FileUpload and stored the bytes
> in the field. I can render these bytes out through a web page by using
> the Response.WriteBinary(reader[IMAGEFIELDPOS]);
> I mention this as I know that the image now in the database in the
> correct mime format (jpeg).
> So, back to the report. I've added an image field to the body of the
> report (I want it in the header by alas that is also an
> impossibility). To this field I've assigned the mime type "image/
> jpeg", the Source of Database, and a Value of:
> =System.Convert.ToBase64String(Fields!UserCompanyImage.Value,
> "InvoiceHeader_InvoiceHeader")
> And of course the image does not render.
> Adding that same value to a text field however allows the Base64 to
> get dumped out in to that field. Which proves the data is there.
> However, I'm baffled as to how to get this image to show up.
> Clues anyone
> DC|||Tribe,
Here's the trick (what a mess)
In order to get a dynamic JPEG image out of your database and into the
header of your report you must:
Add a textfield to the body of your report.
Assign the value of that textfield (call this text field
txtImageData):
= Convert.ToBase64String(Fields!MyImageStreamField)
Add an image type to your report header.
Assign the Mime type to image/jpeg and the Source to Database
Assign the value to :
= Convert.FromBase64String(ReportItems!txtImageData.Value)
Your image will then have the byte data that was originally in your
image column in your database table.
DC
On Oct 8, 3:04 pm, bangeye <davecl...@.gmail.com> wrote:
> Tribe,
> I lied. I can get the image to show up in the body of the report by
> using just the straight byte dump:
> =First(Fields!UserCompanyImage.Value, "InvoiceHeader_InvoiceHeader")
> But what I'm really trying to do is to get the image up in the header.
> So I've got another identical image up in the header and I've got its
> Value set to :
> =Reportitems!imageLogo.Value
> Where imageLogo is the name of the first, body of the report, image.
> The header image does not render.
> Clues 2?
> DC
> On Oct 8, 2:44 pm, bangeye <davecl...@.gmail.com> wrote:
> > Tribe,
> > I'm struggling with the poorly implemented image handling in SSRS
> > (which is represented through ASP.NET via
> > Microsoft.Reporting.WebForms)
> > First off, SSRS/Reporting team - External Images should mean exactly
> > that. The report should express EXACTLY what I enter into the Value
> > field for an External type image in a report. The fact that the engine
> > interprets and munges this field is an utter travesty. If I enter "/
> > myDBImageDumper.aspx" this text is what should be expressed out
> > through the Web report viewer. Period. The use of this property
> > "UnattendedExecutionAccount" in order to allow the report engine to
> > render local images is a complete and total hack
> > Now, in dealing with a simple database supplied image in the reporting
> > body of a report, I've got an Image type field in a SQLExpress table.
> > I've loaded this field through a web FileUpload and stored the bytes
> > in the field. I can render these bytes out through a web page by using
> > the Response.WriteBinary(reader[IMAGEFIELDPOS]);
> > I mention this as I know that the image now in the database in the
> > correct mime format (jpeg).
> > So, back to the report. I've added an image field to the body of the
> > report (I want it in the header by alas that is also an
> > impossibility). To this field I've assigned the mime type "image/
> > jpeg", the Source of Database, and a Value of:
> > =System.Convert.ToBase64String(Fields!UserCompanyImage.Value,
> > "InvoiceHeader_InvoiceHeader")
> > And of course the image does not render.
> > Adding that same value to a text field however allows the Base64 to
> > get dumped out in to that field. Which proves the data is there.
> > However, I'm baffled as to how to get this image to show up.
> > Clues anyone
> > DC

No comments:

Post a Comment