Wednesday, March 28, 2012
Images will not show in report
I have tried to add it all three ways, but still no luck. Is there something
that I am missing?
I can see the image when I preview the report locally, but when I deploy the
report to the sever, I cannot view the image either from the Report Server or
through my .NET application that is utilizing the report.
Any help would be greatly appreciated.You can try making it an embedded image.
Add the image as a new embedded image to the report. (Reports\Images)
Then, design your report by adding an image to it from the toolbox.
Set the properties for that image to point to the embedded image you added.
You can make it an linked image by setting the properties to point to a
path. http://myserver/myimageshare/myimage.jpg
--
| Thread-Topic: Images will not show in report
| thread-index: AcWC+zNf2GzxbBXnQVO+cfwpRtcPTg==| X-WBNR-Posting-Host: 69.213.32.34
| From: "=?Utf-8?B?RXJpYyBHbmFnZXk=?=" <Eric
Gnagey@.discussions.microsoft.com>
| Subject: Images will not show in report
| Date: Thu, 7 Jul 2005 06:53:06 -0700
| Lines: 9
| Message-ID: <3EBB5FE6-34BE-4211-BA22-5003727008B2@.microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.sqlserver.reportingsvcs
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.reportingsvcs:47590
| X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
|
| I am trying to add a Company Logo image to my report and it will not
render.
| I have tried to add it all three ways, but still no luck. Is there
something
| that I am missing?
|
| I can see the image when I preview the report locally, but when I deploy
the
| report to the sever, I cannot view the image either from the Report
Server or
| through my .NET application that is utilizing the report.
|
| Any help would be greatly appreciated.
|sql
Images from a Database in Header
I'm trying to embed an image in a report header and so far I have had no
luck, the image comes from a DB field based on the report parameters. I have
read the info at the link http://msdn2.microsoft.com/ms159677.aspx, tried it
and still did not work.
If I create an image as specified in the aforementioned link - nothing is
displayed, if I copy that image object and paste it in the body of the report
- the image is shown.
Am I missing something? Has somebody got this to work?
Thanks for your help,
ChrisHi Chris,
Are you using SQL Server 2005 Reporting Services?
Are you adding a fixed image in the Report Header or adding data bounded
images in the Header?
If you are adding a fixed image, make sure you select Embeded Image in the
Wizard
Would you please let me know the detailed steps you are using to reproduce
this error message?
Thank you for your patience and cooperation. If you have any questions or
concerns, don't hesitate to let me know. We are always here to be of
assistance!
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||Hi Michael,
Yes I'm using SQL Server 2005 Reporting Services.
I'm adding a data bound image in the Header. I'm following the steps
mentioned in the link I added to my original post. Basically the recommended
workaround is to add a hidden textbox in the body of the report and reference
that textbox in the image in the header. The image in the header doesn't give
me any errors but it doesn't display either. If using the report designer I
copy the image from the header and paste it as part of the body of the
report, the image displays.
Thanks for your help,
Chris
"Michael Cheng [MSFT]" wrote:
> Hi Chris,
> Are you using SQL Server 2005 Reporting Services?
> Are you adding a fixed image in the Report Header or adding data bounded
> images in the Header?
> If you are adding a fixed image, make sure you select Embeded Image in the
> Wizard
> Would you please let me know the detailed steps you are using to reproduce
> this error message?
> Thank you for your patience and cooperation. If you have any questions or
> concerns, don't hesitate to let me know. We are always here to be of
> assistance!
>
> Sincerely yours,
> Michael Cheng
> Microsoft Online Partner Support
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> =====================================================> This posting is provided "AS IS" with no warranties, and confers no rights.
>|||Hi Chris,
How did your image stored in database as base64 encoded? If not, I am
afraid you cannot display the image in this way. It would be appreciated if
you could provide me a sample database file (that I could use to attach
directly on my side) to reproduce it on my side.
I understand the information may be sensitive to you, my direct email
address is v-mingqc@.ONLINEmicrosoft.com (please make sure you have removed
ONLINE before you click SEND), you may send the file to me directly and I
will keep secure.
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||Hi Chris,
Thanks so much for your email and sample solution in zipped file.
I have reproduced it on my side and I am looking into this, which might
take a day or two. I will keep you updated as soon as I find there is
anything useful and thanks for your understanding and patience in advance.
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||I am having the same exact problem. Just one more piece of information: when
the image does not display in the header, if I go to print the report and
look at a print preview, the image IS displaying. The image also displays if
I export the report to PDF format. It just won't display in the Report
Manager web page. I've tried it with BMP and JPG images; both behave the same.
Also, if I try to set the background image for a text box control in the
header, using the same mechanism, the image does not show up at all.
--
Brian G.
"Christians Izquierdo" wrote:
> Hi Michael,
> Yes I'm using SQL Server 2005 Reporting Services.
> I'm adding a data bound image in the Header. I'm following the steps
> mentioned in the link I added to my original post. Basically the recommended
> workaround is to add a hidden textbox in the body of the report and reference
> that textbox in the image in the header. The image in the header doesn't give
> me any errors but it doesn't display either. If using the report designer I
> copy the image from the header and paste it as part of the body of the
> report, the image displays.
> Thanks for your help,
> Chris
> "Michael Cheng [MSFT]" wrote:
> > Hi Chris,
> >
> > Are you using SQL Server 2005 Reporting Services?
> > Are you adding a fixed image in the Report Header or adding data bounded
> > images in the Header?
> >
> > If you are adding a fixed image, make sure you select Embeded Image in the
> > Wizard
> >
> > Would you please let me know the detailed steps you are using to reproduce
> > this error message?
> >
> > Thank you for your patience and cooperation. If you have any questions or
> > concerns, don't hesitate to let me know. We are always here to be of
> > assistance!
> >
> >
> > Sincerely yours,
> >
> > Michael Cheng
> > Microsoft Online Partner Support
> >
> > When responding to posts, please "Reply to Group" via your newsreader so
> > that others may learn and benefit from your issue.
> > =====================================================> > This posting is provided "AS IS" with no warranties, and confers no rights.
> >
> >|||Hi Brian and Christians,
Thanks Brian for the inputs.
Yes, we have noticed it will be displayed correctly in Print Preview mode
and it will also be displayed when rendered. I believe this should be a
problem in our product and I have notify the devlopment team about this,
they will look into this.
However, if this will impact your business much, I would recommend you open
an incident with Microsoft Customer Service and Support so that a dedicated
Support Professional can assist with this case. If you need any help in
this regard, please let me know.
For a complete list of Microsoft Customer Service and Support phone
numbers, please go to the following address on the World Wide Web:
http://support.microsoft.com/directory/overview.asp
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================This posting is provided "AS IS" with no warranties, and confers no rights.
Monday, March 26, 2012
Image upload problem into database
Hi guys,
I'm currently trying to insert image into my SQL db. I have tried a number of methods that were posted online, and so far with no luck.
My current code reads:
Dim conn As New Data.SqlClient.SqlConnection()
conn.ConnectionString = ConfigurationManager.ConnectionStrings("MainDBConnection").ToString
conn.Open()
Dim cmd As New Data.SqlClient.SqlCommand("SP_SAVEImage", conn)
cmd.CommandType = Data.CommandType.StoredProcedure
Dim nUserID As New Data.SqlClient.SqlParameter("@.nUserID", Data.SqlDbType.Int)
nUserID.Value = "1"
Dim nAlbumID As New Data.SqlClient.SqlParameter("@.nAlbumID", Data.SqlDbType.Int)
nAlbumID.Value = "1"
Dim sDescription As New Data.SqlClient.SqlParameter("@.sDescription", Data.SqlDbType.VarChar, 50)
sDescription.Value = "image1"
Dim sImageName As New Data.SqlClient.SqlParameter("@.sImageName", Data.SqlDbType.VarChar, 50)
sImageName.Value = sImageName
Dim sImageType As New Data.SqlClient.SqlParameter("@.sImageType", Data.SqlDbType.VarChar, 50)
sImageType.Value = fileType
Dim sImageData As New Data.SqlClient.SqlParameter("@.sImageData", Data.SqlDbType.Image, uploadedFile.Length)
sImageData.Value = uploadedFile
cmd.Parameters.Add(nUserID)
cmd.Parameters.Add(nAlbumID)
cmd.Parameters.Add(sDescription)
cmd.Parameters.Add(sImageName)
cmd.Parameters.Add(sImageType)
cmd.Parameters.Add(sImageData)
Dim reader1 As Data.SqlClient.SqlDataReader
reader1 = cmd.ExecuteReader
Running through debug, everything runs up until the last line, where an error is caught saying : Failed to convert parameter value from a SqlParameter to a String
I reckon it's to do with the input sImageData being input as a byte array - but I can't seem to find a way around it.
Any help greatly appreciated!!
Dim sImageName As New Data.SqlClient.SqlParameter("@.sImageName", Data.SqlDbType.VarChar, 50)
sImageName.Value = sImageName
You are setting an SqlParameter equal to a string value. Must be a typeo. Fix and retry.
THANK YOU!!!!!!
I feel such an idiot now!! I've been looking at this code for so long I couldn't see the obvious.
I had honestly just given up on the idea of saving my data this way; but decided to check the post before going to bed - I can sleep well now knowing at least some of my code works! lol.
Cheers mate
Friday, March 23, 2012
image resource returned in code
I'm trying to display an image that has been returned from an external assembly, but am having no luck at all.
Essentially, I have a utility class that goes to a resource file and pulls out a JPG and returns it. I have set the value property of the image control on the report to hit this assembly, like so :
= Code.getLogo()
where the function Code.getLogo() actually interfaces with the utility class.
I have tried several variations of this code. I have returned the image as an Image object, a JPG, a TIFF and a BMP. I've also been adventurous and tried converting it to a base64 string before it gets to the report and then having the report convert it back to bytes before shoving it into the image value. Consistently I get this error :
The value expression used in image ‘logo’ returned a data type that is not valid.
A reply to a similar post on the www.sqlreportingservices.net site suggested that it's a Code Access Security issue, but I'm sure it's not, because when I dump my base64 string into a text field, it fills half the page.
What is this control expecting? Any thoughts?
Have you tried setting Image.Source to Database? If you specify Embedded, the value of Value is the resource's name embedded in the report, not the image's binary data. If you specify External, it is expecting a URL path to the image. Specifying Database indicates that the image contents is coming from a database field and Value is then the image's binary data. It's not actually coming from the database in your case, but Image should interpret the Value properly all the same.|||Yes, I did indeed have it set to Embedded.
When I set to Database, I have a whole new set of errors, but they seem more straightforward. I'll fiddle with it for a while and see what I can come up with.
Got me over a big hurdle. Thanks.
|||Next you'll want to make sure your MIMEType is set correctly. If you're returning JPEG data, you want to set your MIMEType to image/jpeg. If you have a mismatch, it will try to interpret your JPEG as a BMP (i.e. MIMEType = image/bmp) rather than the JPEG that it actually is.|||Your function has to return the image as byte array (i.e. byte[]). In addition, the image type has to be set to "Database", otherwise the Value property is not interpreted as the actual image data.
--Robert
|||Awesome, it worked. When I changed my Source property to Database, I also took out my conversion statements so that it would return just an image file. Once I put the conversion-to-byte-array logic back in, it worked.Thank ye very much for your help.