set timeout for to render report from SSRS

  • Thread starter Thread starter msdnpublic1234
  • Start date Start date
M

msdnpublic1234

Guest
Hi,

I see a recurring issue that the script timed out when trying to run report with parameters in azure server.It takes ~5mins sometimes due to load on the CPU usage on the sever where cube is hosted instead of few seconds.I dont want code to break when it takes time to fetch data from cube and not timeout until report is generated.The report is to be then rendered in mhtml.

I am trying to specify timeout in my code(~6mins) and not sure how to include timeout.I am confused between Loadreport() and Render() as to which of these actually execute the report so i can add timout of 5mins or so in the appropriate place.The definition for load says it "Loads a report from the report server into a new execution." and render() says "Processes a specific report and renders it in the specified format."

Pls help me set up timeout in the right place.

Here is the code:

private static void RenderReport(ParameterValue[] parameters, string format, string filename)
{
var report = new ReportExecutionService();

report.Credentials = System.Net.CredentialCache.DefaultCredentials;
report.Url = @"http://azr/ReportServer/ReportExecution2005.asmx";

var execHeader = new ExecutionHeader();
string encoding;
string mimeType;
string extension;

Warning[] warnings = null;
string[] streamIDs = null;

report.ExecutionHeaderValue = execHeader;
report.LoadReport(@"/Master/MarketingReport", null);

if (parameters != null)
report.SetExecutionParameters(parameters, "en-us");
//report.Timeout = 450000;

var result = report.Render(format, null, out extension, out encoding, out mimeType, out warnings, out streamIDs);

Continue reading...
 
Back
Top