chan_sivaram


Hello Techies

i have SSRS 2005 report the source data from oracle views i simply select * from the view and display data for a particular entity say empID using filter in the reports which is passed as parameter

the question is whether SSRS will cahe the data and for subsquent request it will take from Cache instead of going back to database even if i change the parameter say empID 1,2,3,

please help me on this

thanks in advance





Re: Reporting Service Cache

Teo Lachev


SSRS always performs user session caching for each parameter combination. If a subsequent request is sent before the session expires and includes the session identifier, the report will be displayed from the cached instance. The end user can click the Refresh Report toolbar button (not the browser Refresh button) to generate the report anew.







Re: Reporting Service Cache

chan_sivaram

i call the depolyed rdl and then renders in to excel in my Windows Application

and i pass param to RDL not to datasource i use the param for filters in RDL list

i enable cache for that rdl say 60 min

when render the rdl in loop by changin the param it gives same output excel data for different param

please help







Re: Reporting Service Cache

Teo Lachev

I enable cache for that rdl say 60 min

What does this mean You enabled shapshot caching You don't have to do anything to specifically enable user session caching. However, I haven't tried filtering only though. If it still doesn't work for you I will take a look.






Re: Reporting Service Cache

chan_sivaram

I enable cache for that rdl say 60 min means execution cache for that report

i haven't enabled session cache coz i not displaying my rdl in browser

i use Reporting Service webservice methods to accesses and render report

code

------------------------------------------------

Private Sub RptRender2(ByVal paramName As String, ByVal paraVal As String)
Dim rs As New ReportExecutionService()
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
rs.Url = "http://localhost/reportserver/ReportExecution2005.asmx"

' Render arguments
Dim result As Byte() = Nothing
Dim reportPath As String = "/PanelPayments/EvalRpt2"
Dim format As String = "EXCEL"
Dim historyID As String = Nothing
Dim devInfo As String = "<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>"

' Prepare report parameter.
Dim parameters(0) As WindowsApplication2.ReportExecution2005.ParameterValue



Dim credentials As WindowsApplication2.ReportExecution2005.DataSourceCredentials() = Nothing
Dim showHideToggle As String = Nothing
Dim encoding As String = ""
Dim mimeType As String = ""
Dim warnings As WindowsApplication2.ReportExecution2005.Warning() = Nothing
Dim reportHistoryParameters As WindowsApplication2.ReportExecution2005.ParameterValue() = Nothing
Dim streamIDs As String() = Nothing

Dim execInfo As New ExecutionInfo
Dim execHeader As New ExecutionHeader()
Dim SessionId As String
Dim extension As String = ""

Dim arrList As New ArrayList
arrList.Add("1")
arrList.Add("2")
arrList.Add("3")
arrList.Add("4")

rs.ExecutionHeaderValue = execHeader
execInfo = rs.LoadReport(reportPath, historyID)


Dim i As Integer

Try

For i = 0 To arrList.Count - 1

'set parameter
paraVal = arrList(i).ToString()
parameters(0) = New WindowsApplication2.ReportExecution2005.ParameterValue()
parameters(0).Name = paramName
parameters(0).Value = paraVal
rs.SetExecutionParameters(parameters, "en-us")

'get sessiion id
SessionId = rs.ExecutionHeaderValue.ExecutionID
Console.WriteLine("SessionID: {0}", rs.ExecutionHeaderValue.ExecutionID)

'render the result
result = rs.Render(format, devInfo, extension, _
encoding, mimeType, warnings, streamIDs)

execInfo = rs.GetExecutionInfo()

Console.WriteLine("Execution date and time: {0}", execInfo.ExecutionDateTime)


' Write the contents of the report to an MHTML file.
Try
Dim sFilePath As String = "C:\Paypal\out\Summary" & paraVal & ".xls"
Dim stream As FileStream = File.Create(sFilePath, result.Length)
Console.WriteLine("File created.")
stream.Write(result, 0, result.Length)
Console.WriteLine("Result written to the file.")
stream.Close()
Catch e As Exception
Console.WriteLine(e.Message)
End Try

Next

Catch e As SoapException
Console.WriteLine(e.Detail.OuterXml)
End Try


End Sub

----------------------------------------------------------------------------------------------

when verifed the report Execution log table it shows same parameter value except first 2

thanks






Re: Reporting Service Cache

Teo Lachev

Once you create a snapshot report, all subsequent requests will be served using the cached instance irrespective of the parameters passed. That's because a snapshot report is cached only for the default parameter values specified when the snapshot is generated. In contrast, session caching is performed for each parameter combination.

i haven't enabled session cache coz i not displaying my rdl in browser

Session caching is always enabled. You can control only the session timeout (the minimum is 60 seconds). If you pass the session identifier back to the report server you can take advantage of the session caching when you call the RS web service.




Re: Reporting Service Cache

chan_sivaram

Hi

Enabling snapshot eliminates the problem of getting same data for different parameters - Thanks a ton

but

i am using

SetExecutionOptions method to set snapshot but how can check the time taken for snapshot to complete

coz i am getting exception if the sanpshot is not created

ie the generation of the report runs montly so a exe will set the snapshot and renders to excel for diff parameter

if you can suggest something to solve i think i will solve the problem

again thanks a lot

your knowledge on SSRS is commentable






Re: Reporting Service Cache

Teo Lachev

ReportExecutionService.GetExecutionInfo method will tell you when the snapshot was processed and if there is a snapshot associated with the report.
You can use ReportingService2005.ListJobs to determine what jobs are currently running.






Re: Reporting Service Cache

RVeee

hello

I have a created a report in 2005 and am calling the report from .Net console.

I have enabled caching for 30 minutes. I have added parameters as filters to the report assuming that I'll be able to retrieve the output from cache rather than hitting db for each of the parameters. My report runs fine with 2 parameters but when I trigger the same with the third parameter, the outputs is erndered with the second parameter value.From then onwards all my outputs will have the same parameter filter value 2 applied.Haven't enabled snapshots as it is difficult to maintain (clean one)

Any help

Thanks for all your help




Re: Reporting Service Cache

Teo Lachev

Execution caching is based on query parameters not report parameters. You need to link report parameters to the query instead of using filters.






Re: Reporting Service Cache

chan_sivaram

Thank you

i used

SetExecutionOptions

and

UpdateReportExecutionSnapshot (this method waits till the snapshot is created)

and i would call the render method

it worked !!!!

other work around suggested by our team cordinator is using

web url request

Create the URL (including render option and parameter)

and use webRequest method to download the file this work much faster than the snapshot

loop the url for different parameters

thanks a ton for sharing your knowledge






Re: Reporting Service Cache

RVeee

Hi

ok..I understand... How do i pass query parameters from my application

Thanks





Re: Reporting Service Cache

Teo Lachev

Once you configure the report for execution cache, setExecutionParameters() followed by Render() should work. See the code example in this thread.






Re: Reporting Service Cache

Y T

Hi all,

I am a newbie here. Just wondering, How to set the timeout for .rdlc file

I am using reporting services and my report always timeout after around 30sec. I already tried to set timeout in the connection string but it's not working. I am just using the report viewer to display this report.

Any help will be appreciated. Thank you.






Re: Reporting Service Cache

Teo Lachev

30 sec or 30 min There is a global report timeout setting which you can overwrite for all reports. Go to Report Manager -> Site Settings ->Limit report execution to the following number of seconds. The default is 1800 seconds. You can overwrite the timeout on report basis by setting the same property in the report Execution property tab.

There is also a proxy timeout setting on the ReportViewer control (ServerReport section -> Timeout) to time out the web service call. The default is 600000 ms (600 seconds).