Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 Consuming WCF Service in SSRS report

Author  Topic 

dragselect
Starting Member

2 Posts

Posted - 2008-12-10 : 11:26:06
In my web site, I'm using following C# code using WCF Service to pull student address successfully and display it on web page.
Can you list me steps how to use following StudentManager WCF Service in SQL Server Reporting Services (SSRS) report.
I need to display student address on the SSRS report but not sure how to call or consume this WCF serive from SSRS report.
Thanks very much.

public static string GetStudentAddress()
{
//return DateTime.Now;
Student std = GetStudent("AA432");
Label1.Text = std.Address;
}

private static Student GetStudent(string studentID)
{
// Call the StudentManager WCF to load student data.
// StudentService is service reference name when i added it's refernce to my application.
StudentService.StudentMangerServiceClient wcf = new StudentService.StudentServiceClient();
StudentService.StudentPacket sp = wcf.RetrieveRecord(studentID);
return DeserializeData(sp.StudentBytes);
}

private static Student DeserializeData(byte[] studentBytes)
{
using (MemoryStream ms = new MemoryStream(studentBytes))
{
BinaryFormatter bf = new BinaryFormatter();
ms.Seek(0, SeekOrigin.Begin);
return (Student)bf.Deserialize(ms);
}
}

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-10 : 12:12:58
duplicate

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=116026
Go to Top of Page
   

- Advertisement -