Change table of report from Ms Access

Fastreport Studio for Microsoft Access come with a demo as below:

Private Sub Form_Load()
Set fr = CreateObject("FastReport.TfrxReport")
If Not Left(Application.CodeProject.Path, 1) = Left(CurDir, 1) Then ChDrive Left(Application.CodeProject.Path, 1)
ChDir (Application.CodeProject.Path)
fr.LoadReportFromFile (Application.CodeProject.Path + "\fr_and_access.fr3")
End Sub

There is ADOTable1 in the demo report (fr_and_access.fr3) where the TableName is bind to table1. How can I change the underlying table from table1 to another table under Microsoft Acess 2003?

Comments

  • edited 10:21AM
    smching wrote: »
    Fastreport Studio for Microsoft Access come with a demo as below:

    Private Sub Form_Load()
    Set fr = CreateObject("FastReport.TfrxReport")
    If Not Left(Application.CodeProject.Path, 1) = Left(CurDir, 1) Then ChDrive Left(Application.CodeProject.Path, 1)
    ChDir (Application.CodeProject.Path)
    fr.LoadReportFromFile (Application.CodeProject.Path + "\fr_and_access.fr3")
    End Sub

    There is ADOTable1 in the demo report (fr_and_access.fr3) where the TableName is bind to table1. How can I change the underlying table from table1 to another table under Microsoft Acess 2003?

    It is pretty easy. For example, you may modify demo in following way:

    Public ado_tbl As TfrxADOTable

    Private Sub Command3_Click()

    REM Here can be a new name of the table
    Set ado_tbl = fr.FindObject("ADOTable1")
    ado_tbl.TableName = "table1"
    Set ado_tbl = Nothing

    fr.DesignReport
    End Sub

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.