편집 : 명확성을 위해 업데이트 된 질문 : SSRS 바이트 스트림을 메모리에있는 동안 데이터 세트에 역 직렬화해야합니다.SSRS 바이트 스트림을 VB.net 데이터 셋에 삽입
VB.Net에서 SSRS 보고서를 가져와 결과를 데이터 집합으로 가져와야합니다. XML 파일을 읽고 쓸 수는 있지만, 어떤 이유로 XML 보고서를 데이터 세트에 직접 입력하여 조작 할 수 있습니다.
내가 보고서를 얻고 XML 파일을 스트리밍 할 수 있습니다:
공공 하위 FileToDataset()
' Serialize the contents as a Dataset
Dim myXMLfile As String = "C:\MyFile.xml"
Dim ds As New DataSet()
' Create new FileStream with which to read the schema.
Dim fsReadXml As New System.IO.FileStream(myXMLfile, FileMode.Open)
ds.ReadXml(fsReadXml)
: 나는 VB.net 데이터 세트에 XML 파일을 읽을 수
Public Sub GetReportNames(serverName As String)
Dim rs As New ReportingService2010()
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim items As CatalogItem() = Nothing
' Retrieve a list of all items from the report server database.
Try
items = rs.ListChildren("/", True)
Catch e As SoapException
MessageBox.Show(e.ToString())
End Try
' Serialize the contents as an XML document and write the contents to a file.
Try
Dim fs As New FileStream("ReportNames.xml", FileMode.Create)
Dim writer As New XmlTextWriter(fs, Encoding.Unicode)
Dim serializer As New XmlSerializer(GetType(CatalogItem())) ''
serializer.Serialize(writer, items)
'MessageBox.Show("Report names successfully written to a file.")
writer.Close()
Catch e As Exception
MessageBox.Show(e.ToString())
End Try
End Sub
End Sub
내 프로젝트의 경우 보고서 이름을 얻는 것으로 시작한 다음 t 단계로 이동합니다. o 각 보고서의 매개 변수를 가져온 다음 보고서를 호출합니다. 각 단계에 대한 간단한 예제 코드가 있지만 현재 디스크의 XML 파일에 모두 쓰는 작업이 포함되어 있습니다 ...
편집 : CatalogItem에서 수행해야 할 작업을 수행 할 수 있어야합니다. 기본적으로 TreeView에 보고서 이름을로드하려고하므로 CatalogItem이 정상적으로 작동해야합니다.