annotate SSRS/SSRS.Services/ReportExecution.cs @ 121:8f94475d3146 tip

final code
author stevenh7776
date Thu, 31 May 2012 15:35:26 +0100
parents e51a6af1c98d
children
rev   line source
112
b9d5f934cb21 Initial upload
adminsh@apollo
parents:
diff changeset
1 using System;
b9d5f934cb21 Initial upload
adminsh@apollo
parents:
diff changeset
2 using System.Security.Principal;
114
e51a6af1c98d working version
adminsh@apollo
parents: 112
diff changeset
3 using SSRS.Services.DTO;
112
b9d5f934cb21 Initial upload
adminsh@apollo
parents:
diff changeset
4 using SSRS.Services.ReportExecutionServiceReference;
b9d5f934cb21 Initial upload
adminsh@apollo
parents:
diff changeset
5 using ServiceStack.ServiceHost;
b9d5f934cb21 Initial upload
adminsh@apollo
parents:
diff changeset
6
b9d5f934cb21 Initial upload
adminsh@apollo
parents:
diff changeset
7 namespace SSRS.Services
b9d5f934cb21 Initial upload
adminsh@apollo
parents:
diff changeset
8 {
b9d5f934cb21 Initial upload
adminsh@apollo
parents:
diff changeset
9 public class ReportExecutionService : IService<ReportExecutionRequest>
b9d5f934cb21 Initial upload
adminsh@apollo
parents:
diff changeset
10 {
b9d5f934cb21 Initial upload
adminsh@apollo
parents:
diff changeset
11 public object Execute(ReportExecutionRequest request)
b9d5f934cb21 Initial upload
adminsh@apollo
parents:
diff changeset
12 {
b9d5f934cb21 Initial upload
adminsh@apollo
parents:
diff changeset
13 string encoding = String.Empty, mimeType = String.Empty, extension = String.Empty;
b9d5f934cb21 Initial upload
adminsh@apollo
parents:
diff changeset
14 Warning[] warnings = null;
b9d5f934cb21 Initial upload
adminsh@apollo
parents:
diff changeset
15 string[] streamIDs = null;
b9d5f934cb21 Initial upload
adminsh@apollo
parents:
diff changeset
16 ServerInfoHeader serverInfoHeader;
b9d5f934cb21 Initial upload
adminsh@apollo
parents:
diff changeset
17 ExecutionInfo executionInfo1, executionInfo2;
b9d5f934cb21 Initial upload
adminsh@apollo
parents:
diff changeset
18
b9d5f934cb21 Initial upload
adminsh@apollo
parents:
diff changeset
19 var reportExecutionClient = new ReportExecutionServiceSoapClient();
b9d5f934cb21 Initial upload
adminsh@apollo
parents:
diff changeset
20 reportExecutionClient.ClientCredentials.Windows.AllowedImpersonationLevel = TokenImpersonationLevel.None;
b9d5f934cb21 Initial upload
adminsh@apollo
parents:
diff changeset
21
b9d5f934cb21 Initial upload
adminsh@apollo
parents:
diff changeset
22 var executionHeader = reportExecutionClient.LoadReport(null, request.Name, null, out serverInfoHeader, out executionInfo1);
b9d5f934cb21 Initial upload
adminsh@apollo
parents:
diff changeset
23
b9d5f934cb21 Initial upload
adminsh@apollo
parents:
diff changeset
24 reportExecutionClient.SetExecutionParameters(executionHeader, null, Converter.Convert(request.Parameters), "en-us", out executionInfo2);
b9d5f934cb21 Initial upload
adminsh@apollo
parents:
diff changeset
25 byte[] result;
b9d5f934cb21 Initial upload
adminsh@apollo
parents:
diff changeset
26 reportExecutionClient.Render(executionHeader, null, request.Format, null, out result,
b9d5f934cb21 Initial upload
adminsh@apollo
parents:
diff changeset
27 out extension, out encoding, out mimeType, out warnings, out streamIDs);
b9d5f934cb21 Initial upload
adminsh@apollo
parents:
diff changeset
28
b9d5f934cb21 Initial upload
adminsh@apollo
parents:
diff changeset
29 return new ReportExecutionResponse { Result = result };
b9d5f934cb21 Initial upload
adminsh@apollo
parents:
diff changeset
30 }
b9d5f934cb21 Initial upload
adminsh@apollo
parents:
diff changeset
31 }
b9d5f934cb21 Initial upload
adminsh@apollo
parents:
diff changeset
32 }