Try Something like : Create Property called:
Public Property ds() As DataSet
Get
Return ViewState("ds")
End Get
Set(ByVal value As DataSet)
ViewState("ds") = value
End Set
End Property
Then set report datasource to be the dataset
Public Sub BindReport(ByVal Id As String)
ds.WriteXml("C:\new\bin\work_order.xml", XmlWriteMode.WriteSchema)
cryRpt.SetDataSource(ds)
rpt_view.ReportSource = cryRpt
If rblFormat.SelectedValue = 1 Then
cryRpt.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, True, "ExportedReport")
Else
cryRpt.ExportToHttpResponse(ExportFormatType.WordForWindows, Response, True, "ExportedReport")
End If
Call This method at the button event