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




Reply With Quote