views:

5

answers:

0

Hi: I have a Report Service running as a web service. I call the web service to get the RDL back as a byte(), then I call XmlSerializer to cast it to a "Report" type autogenerated by the report service

The following code works just fine for SQL2005, but it would throw and exception for SQL2008, when tries to deserialize so if the report is 2008 format, what should I do? should i cast it to something else then? what exactly? please let me know and help.

thanks`Private Shared Function GetReportDefinition(ByVal rdl As Byte()) As Report

Dim serializer As XmlSerializer = New XmlSerializer(GetType(Report))

   ' Load the report bytes into a memory stream

    Using stream As MemoryStream = New MemoryStream(rdl)

        Return CType(serializer.Deserialize(stream), Report)

    End Using


End Function`