locked
How to call a SSRS Report which has SbuReport (what need to be done if it has Sub Report) RRS feed

  • Question

  • User-1778011532 posted

    Dear All,

    My Web Application consume SSRS Report deployed in report server and it uses ReportExecutionService Class. It works fine.

    If I have subreport, I am calling Main Report and set parameter to main only but it doesnot return the output in byte.

    The following code is consuming a sigle report.

    ReportExecutionService.ParameterValue[] parameters = new ReportExecutionService.ParameterValue[tparams.Count];
    int i = 0;
    foreach (DictionaryEntry entry in tparams)
    {
    	parameters[i] = new ReportExecutionService.ParameterValue();
    	parameters[i].Name = entry.Key.ToString();
    	parameters[i].Value = entry.Value.ToString();
    	i = i + 1;
    }
    ReportExecutionService.ReportExecutionService rs = new ReportExecutionService.ReportExecutionService();
    rs.Credentials = new System.Net.NetworkCredential(strUserName, strpwd, strDomainName);
    //Prepare Render arguments
    rs.LoadReport(tstrRDLReportNameWithPath, historyID);
    rs.SetExecutionParameters(tparameters, "en-us");
    results = rs.Render(tstrFormat, deviceInfo, out extension, 	

    Thanks and Regards

    Palanivelrajan

    Friday, April 4, 2014 2:22 AM

Answers

  • User1140095199 posted

    Hi,

    My Web Application consume SSRS Report deployed in report server and it uses ReportExecutionService Class. It works fine.

    If I have subreport, I am calling Main Report and set parameter to main only but it doesnot return the output in byte.

    The following code is consuming a sigle report.

    If credential and parameter requirements are not met, this method will return an error.

    Subsequent calls to Render can be used to fetch additional pages of the report if the rendering extension supports specifying multiple pages.

    A limitation of the Render method is that the output cannot be streamed, so the entire file must be in-memory.

    Refer to the following code and check if you are missing something:

            ExecutionInfo execInfo = new ExecutionInfo();
            ExecutionHeader execHeader = new ExecutionHeader();
            rs.ExecutionHeaderValue = execHeader;
            execInfo = rs.LoadReport(reportPath, historyID);
            rs.SetExecutionParameters(parameters, "en-us"); 
    String SessionId = rs.ExecutionHeaderValue.ExecutionID; Console.WriteLine("SessionID: {0}", rs.ExecutionHeaderValue.ExecutionID); try {
    result = rs.Render(format, devInfo, out extension, out encoding, out mimeType, out warnings, out streamIDs); execInfo = rs.GetExecutionInfo(); Console.WriteLine("Execution date and time: {0}", execInfo.ExecutionDateTime) } catch (SoapException e)

    For complete code refer to the article -http://technet.microsoft.com/en-us/library/reportexecution2005.reportexecutionservice.render.aspx

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, April 8, 2014 12:27 AM