Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Session("Report") IsNot Nothing Then
If IsPostBack Then
CrystalReportViewer1.ReportSource = Session("Report")
End If
End If
End Sub
Code (VB.NET)
If dts_Taxreport.Rows.Count > 0 Then
For a As Integer = 0 To dts_Taxreport.Rows.Count - 1
dataset_.DataTable1.Rows.Add(dts_Taxreport.Rows(a).Item("DocuNo"), dts_Taxreport.Rows(a).Item("InvNo"), dts_Taxreport.Rows(a).Item("jourcode"))
Next
End If
report.SetDataSource(dataset_)
' Response.Redirect("Report_Intranet_Taxbuy1.rpt")
CrystalReportViewer1.ReportSource = report
Session("Report") = report
Tag : .NET, Ms SQL Server 2008, VB.NET, VS 2010 (.NET 4.x)