Database Refresh on Report Control

edited 10:24PM in FastReport .NET
Hi,

I have application where I print from MS-Access database report using Fast Report and VB.net

When I print first time, the data is OK, if I close the report, then change something in the data and click again to print, the report always shows the old data (first time), if I close everything and run it again, the data is OK.

I checked if the data was saved in the database or not, it is, I think it's something related to cashing or refreshing of data.
my code is like this:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Report1.Dictionary.Connections(0).ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\data1.mdb;User ID=Admin;" & _
                  "Jet OLEDB:Database Password=-"
        Report1.Prepare()
        Report1.Preview = PreviewControl1
        Report1.Show()
End Sub

Is there is any way I force Fast Report to reconnect again to the database and get the newest data?

Thanks,

Comments

  • edited 10:24PM
    try to recreate fastreport class instance :
    FastReport.Report Report1 = new FastReport.Report();
            '**************
            Dim Report1 as new FastReport.Report()
             '**************
    
            Report1.Dictionary.Connections(0).ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\data1.mdb;User ID=Admin;" & _
                      "Jet OLEDB:Database Password=-"
            Report1.Prepare()
            Report1.Preview = PreviewControl1
            Report1.Show()
    

Leave a Comment