0
votes

I created a .net web application for printing in some document.

  1. Created stored procedure for dataset
  2. created dataset and loades the procedure
  3. created the crystal report
  4. loads the dataset into crystal report and arranged in crystal report
  5. created crystalreportviewer1

Now I want to call this crystal report while pressing the 'Button 1' i am facing some difficulty to do this

Protected Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button1.Click

Dim cryRpt As New CR_Agreement
    cryRpt.Load("@C:\Users\emarketing\Documents\Visual Studio 2010\Projects\ARC\ARC\CRReports\CR_Agreement.rpt")
    CrystalReportViewer1.ReportSource = cryRpt
End Sub
1

1 Answers

0
votes

Try refreshing the viewer after you set the report source.

Protected Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button1.Click

    Dim cryRpt As New CR_Agreement
        cryRpt.Load("@C:\Users\emarketing\Documents\Visual Studio 2010\Projects\ARC\ARC\CRReports\CR_Agreement.rpt")
        CrystalReportViewer1.ReportSource = cryRpt
        CrystalReportViewer1.Refresh()
    End Sub