Results 1 to 2 of 2

Thread: Reloading of Report

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Posts
    129

    Reloading of Report

    I have a problem with loading of report. Everytime i load the form, it reloads the previous data on it. What i want is for the report to load only upon click.

    There is no problem on the first click. But when i will preview again a report, the previous is reloaded upon loading. I tried to use dispose, but it still loaded. am i missing something? please help, i am using crystal report on visual studio 2005.

    i will appreciate any help, thanks.

    This is my code.


    Code:
        Private Sub btnPreview_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPreview.Click
            LoadReport()
        End Sub
    
        Private Sub LoadReport()
            rptsummary.Load(Application.StartupPath & "\Accounting Reports\journal_voucher.rpt")
            Logon(rptsummary, con.Server, con.Database, con.Username, "sa")
            rptsummary.Refresh()
            rptsummary.SetParameterValue("@fxKeyCompany", gCompanyID())
            rptsummary.SetParameterValue("@fiEntryNo", gfiEntryNo)
            rptsummary.SetParameterValue("@preparedby", get_preparedby())
            rptsummary.SetParameterValue("@reviewedby", TextBox1.Text)
            rptsummary.SetParameterValue("@approvedby", TextBox2.Text)
            Me.crvRpt.Visible = True
            Me.crvRpt.ReportSource = rptsummary
        End Sub
    
        Private Sub frmJournalRpt_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    
        End Sub
    
        Private Sub frmJournalRpt_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
            gfiEntryNo = ""
        End Sub

  2. #2
    Hyperactive Member
    Join Date
    Jul 2007
    Posts
    479

    Re: Reloading of Report

    Have you tried

    rptsummary.discardsavedata

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width