Wrox Programmer Forums
|
BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7
This is the forum to discuss the Wrox book Professional SQL ServerReporting Services by Paul Turley, Todd Bryant, James Counihan, George McKee, Dave DuVarney; ISBN: 9780764568787
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 1st, 2006, 03:33 PM
Registered User
 
Join Date: Mar 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem in displaying image in report

I have a webservice which creates an image returns that image in the form of Byte array. I want to consume this webservice and display that image on my report. When I see my report in the Preview tab of the report designer, it displays that image but when I deploy my report on the report server, image doesn't show up. I have copied app_code.dll (dll for the webservice) to the following locations:

C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PublicAssemblies
C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\bin

Here is the code for the webservice:

************************************************** **
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Drawing
Imports System.Diagnostics
Imports System.IO

<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicPr ofile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.Des ignerGenerated()> _

Public Class Service
Inherits System.Web.Services.WebService

<WebMethod()> _

Public Function HelloWorld() As Byte()

Dim marker As New Bitmap("C:\Inetpub\wwwroot\help.gif")
Dim imageStream As New System.IO.MemoryStream
marker.Save(imageStream, System.Drawing.Imaging.ImageFormat.Jpeg)
Trace.Write("Before Write")
Return imageStream.ToArray()



End Function

End Class

**************************************************

I have referenced this dll saved in public assemblies folder from my report project and wrote a function to call the above mentioned webservice function HelloWorld() and called the function from value property of an image control on the report.

btw, I am using SQL Server 2005 reporting services.

Does anybody has any idea what am I missing?

Thanks


 
Old March 1st, 2006, 10:15 PM
Wrox Author
 
Join Date: May 2004
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The problem you are experiencing is a common issue. It has to do with the different authentication context on the stream requests used to provide the image content to the browser. You are providing credentials for the report rendering content but authentication fails for the internal Get request(s) that the report makes for the image(s). Take a look at the HTML source behind your rendered report and will see an individual URL request for each image, using a StreamID. There isn't a simple solution when you use this rendering technique. You have a few options:

1. provide the stream content using a technique similar to my gauge example at the end of chapter seven in the 2005 book.
2. Use URL rendering which requires Windows authentication.
3. Use the ReportViewer web forms control.
4. Use forms authentication to replace the default Windows authentication built-in to SSRS (see: http://msdn.microsoft.com/library/de...tml/ufairs.asp)
5. Write a custom security extension (this is a lot of work.)


Paul Turley, MCSD, MCDBA, MCT, MSF Practitioner
 
Old March 1st, 2006, 10:26 PM
Wrox Author
 
Join Date: May 2004
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Actually, I think this technique could work but the web service should be deployed to a web folder rather than to te SSRS bin folders. How are you consuming the web service & rendering the report?

Paul Turley, MCSD, MCDBA, MCT, MSF Practitioner





Similar Threads
Thread Thread Starter Forum Replies Last Post
Image not displaying shoakat ASP.NET 2.0 Professional 2 June 22nd, 2007 10:02 AM
displaying image as logo dynamically in report asad_uet Crystal Reports 0 June 26th, 2006 03:57 AM
Image displaying problem creative_eye VB Databases Basics 0 April 7th, 2006 07:44 AM
Problem with displaying image on the report hthakkar Reporting Services 0 March 1st, 2006 09:48 AM
displaying an image from file stream into an image sanjeet ADO.NET 0 September 23rd, 2005 10:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.