Calling custom C# code from SSRS 2008 report?

Up vote 0 down vote favorite share g+ share fb share tw.

I want to call a function written in C# from within ssrs 2008 report. Following is a close representation of the actual C# function to be called public void GetAttachment(string serverName) { TeamFoundationServer tfsServer = new TeamFoundationServer(serverName); tfsServer.Authenticate(); WorkItemStore workItemStore = new WorkItemStore(tfsServer); WorkItem workItem = workItemStore. GetWorkItem(16); if (workItem!

= null) { System.Net. WebClient request = new System.Net.WebClient(); request. Credentials = System.Net.CredentialCache.

DefaultCredentials; foreach (Attachment attachment in workItem. Attachments) { //Console. WriteLine("Attachment: '" + attachment.

Name + "' (" + attachment.Length.ToString() + " bytes)"); request. DownloadFile(attachment. Uri, Path.

Combine(@"C:\Attachments", attachment. Name)); } } } The intended purpose of the above function is to download file attachments and display them in the SSRS 2008 report. So how can I add references to the TFS assemblies and be able to call the above function to fetch attachments and display them in the SSRS 2008 report?

Pls. Suggest. Update: The article mentioned in the comments helped me figure out how to call C# code from ssrs 2008 report.

Now the question is if I am able to write the files to a temporary folder on the server, how can I display the files in ssrs report in a similar way as show in the below snapshot: Thanks tfs reporting-services tfs2008 ssrs-2008 ssrs-reports link|improve this question edited Jan 4 '10 at 20:03 asked Jan 4 '10 at 19:06stackoverflowuser1,611834 80% accept rate.

I found this article sqlservercentral.com/articles/Developmen... which describes how to add custom code in ssrs 2005. But I am unable to get the "Report properties" dialog box in ssrs 2008. Any idea?

– stackoverflowuser Jan 4 '10 at 19:18 Got it! It seems we need to click outside of the report in the report designer to get the "Report Properties" option. This will give "Code" and "References" tabs.

– stackoverflowuser Jan 4 '10 at 19:25 This link is useful as well bryantlikes.com/articles/824.aspx – stackoverflowuser Jan 4 '10 at 20:48 Another awesome article : devx.com/codemag/Article/33656/1954 – stackoverflowuser Jan 4 '10 at 21:01.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions