Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not IsPostBack Then Dim dt As New DataTable adp = New SqlDataAdapter("SELECT * FROM Employee", con) Dim ds As New DataSet adp.Fill(dt) Dim crystalRepo As New ReportDocument() crystalRepo.Load(Server.MapPath("~/Test.rpt")) crystalRepo.SetDataSource(dt) CrystalReportViewer1.ReportSource = crystalRepo End If End Sub
Protected Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSearch.Click Dim dt As New DataTable adp = New SqlDataAdapter("SELECT * FROM Employee", con) Dim ds As New DataSet adp.Fill(dt) Dim crystalRepo As New ReportDocument() crystalRepo.Load(Server.MapPath("~/Test.rpt")) crystalRepo.SetDataSource(dt) CrystalReportViewer1.ReportSource = crystalRepo End If End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)