Drill-down is difficult to implement with programmatic rendering. Aside from the image streaming issue, the drill-down links will produce Get requests. I'm afraid I don't have an easy answer but it's best to use URL rendering for reports with graphics, drill-down and drill-through features. You can also use the ReportViewer control in RS2005 and SharePoint in RS2000. If you need to use programmatic rendering, use the webarchive or PDF formats. For HTML rendering, any images (including the plus sign icons) must be managed as separate Stream objects in your code. You can write these out to files in your local file system so they'll be picked-up by IE when the report is viewed. Although there may be easier ways to solve this problem, the following ASP.NET web form code manages both rendering and writing the images to files in a folder called report_images under the current web folder:
Dim rs As New ReportServer_ReportService.ReportingService
Dim cred As New System.Net.NetworkCredential(sReportUserID, sReportPassword)
Dim creds As New System.Net.CredentialCache
creds.Add(New Uri(rpt.SavedReportWebServiceURI), "NTLM", cred)
rs.Credentials = cred
Dim sDevInfo As String = "<DeviceInfo><StreamRoot>/report_images/</StreamRoot></DeviceInfo>"
Dim sStreamIDs() As String
Dim sStreamID As String
Dim ReportBytes As Byte()
Dim ImageBytes As Byte()
ReportBytes = rs.Render(Session.Item("ReportName"), _
Session.Item("RenderFormat"), _
Nothing, sDevInfo, _
Session.Item("ParamValues"), _
Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, sStreamIDs)
For Each sStreamID In sStreamIDs
ImageBytes = rs.RenderStream(Session.Item("ReportName"), Session.Item("RenderFormat"), sStreamID, Nothing, Nothing, Session.Item("ParamValues"), Nothing, Nothing)
Dim stream As System.IO.FileStream = System.IO.File.OpenWrite(Server.MapPath("/report_images/") & sStreamID)
stream.Write(ImageBytes, 0, CInt(ImageBytes.Length))
stream.Close()
Next
With HttpContext.Current.Response
.Clear()
.BinaryWrite(ReportBytes)
.End()
End With
Paul Turley, MCSD, MCDBA, MCT, MSF Practitioner
|