jennyek2000
Programmer
I am developing an ASP.NET web interface for the reporting services so that our reports can be used on our website for our clients.
I have a data-driven subscription set up to preload the cache for all of my reports. This works fine, and when I run any report via Report Manager or Report Server, it pulls the data from the cache as opposed to direct from the datasource.
However, when I call the Render method in ASP.NET with exactly the same parameters (I know this because I checked the executionLog in the database), the report data is regenerated. I am unable to see why this is happening. What is the difference between running the report from ReportServer or running Render from the ASP.NET page? Has anybody else had this problem? Thanks in advance
My code is as follows:
Dim rsReport As New wsReportServer.ReportingService
rsReport.Timeout = System.Threading.Timeout.Infinite
'Authenticate the web service client witht he report server by using the following
rsReport.Credentials = New System.Net.NetworkCredential(sUSERNAME, sPASSWORD, sDOMAIN)
Dim sEncoding As String = Nothing
Dim sMimeType As String = Nothing
Dim pParametersUsed As ParameterValue()Dim parameters() As ParameterValue
parameters = GetReportParameterValues()
Dim wWarnings As Warning()
Dim sStreamID As String
Dim sStreamIDS As String()
Try
btResult = rsReport.Render(m_sReportPath, sRenderFormat, Nothing, sDEVINFO, parameters, _
Nothing, Nothing, Nothing, Nothing, Nothing, wWarnings, sStreamIDS)
bReportRendered = True
Catch ex As Exception
If ex.Message.IndexOf("Object") >= 0 Then
Throw New Exception("This report is currently being modified - and requires activation")
Else
Throw ex
End If
bReportRendered = False
End Try
'All of the images
For Each sStreamID In sStreamIDS
Dim instance As HttpRequest
Try
btImage = rsReport.RenderStream(m_sReportPath, sHTML, sStreamID, Nothing, sDEVINFO, parameters, sEncoding, sMimeType)Dim stream As System.IO.FileStream = _
System.IO.File.OpenWrite(HttpContext.Current.Server.MapPath(".\Image\" & sStreamID))
stream.Write(btImage, 0, CInt(btImage.Length))
stream.Close()
Catch ex As Exception
Throw ex
End Try
Next
Else
'Throw an exception here
Throw New Exception("The report path has not been set")
End If
Catch ex As Exception
bReportRendered = False
Throw ex
End Try
I have a data-driven subscription set up to preload the cache for all of my reports. This works fine, and when I run any report via Report Manager or Report Server, it pulls the data from the cache as opposed to direct from the datasource.
However, when I call the Render method in ASP.NET with exactly the same parameters (I know this because I checked the executionLog in the database), the report data is regenerated. I am unable to see why this is happening. What is the difference between running the report from ReportServer or running Render from the ASP.NET page? Has anybody else had this problem? Thanks in advance
My code is as follows:
Dim rsReport As New wsReportServer.ReportingService
rsReport.Timeout = System.Threading.Timeout.Infinite
'Authenticate the web service client witht he report server by using the following
rsReport.Credentials = New System.Net.NetworkCredential(sUSERNAME, sPASSWORD, sDOMAIN)
Dim sEncoding As String = Nothing
Dim sMimeType As String = Nothing
Dim pParametersUsed As ParameterValue()Dim parameters() As ParameterValue
parameters = GetReportParameterValues()
Dim wWarnings As Warning()
Dim sStreamID As String
Dim sStreamIDS As String()
Try
btResult = rsReport.Render(m_sReportPath, sRenderFormat, Nothing, sDEVINFO, parameters, _
Nothing, Nothing, Nothing, Nothing, Nothing, wWarnings, sStreamIDS)
bReportRendered = True
Catch ex As Exception
If ex.Message.IndexOf("Object") >= 0 Then
Throw New Exception("This report is currently being modified - and requires activation")
Else
Throw ex
End If
bReportRendered = False
End Try
'All of the images
For Each sStreamID In sStreamIDS
Dim instance As HttpRequest
Try
btImage = rsReport.RenderStream(m_sReportPath, sHTML, sStreamID, Nothing, sDEVINFO, parameters, sEncoding, sMimeType)Dim stream As System.IO.FileStream = _
System.IO.File.OpenWrite(HttpContext.Current.Server.MapPath(".\Image\" & sStreamID))
stream.Write(btImage, 0, CInt(btImage.Length))
stream.Close()
Catch ex As Exception
Throw ex
End Try
Next
Else
'Throw an exception here
Throw New Exception("The report path has not been set")
End If
Catch ex As Exception
bReportRendered = False
Throw ex
End Try