Database Refresh on Report Control

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 5:26AM
    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

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.