Bookmarks multi .frx report

From my software I build a report. This report contains different *.frx files which I combine to 1 report.

After adding a .frx file to the report, i call .prepare(true), what means appending, and then adding next one. So far so good.

In every .frx file I have a title. This title has als a unique bookmark set.

Now I want to 'find' the pagenumber and add a hyperlink to the TOC, on the second page of my combined report. I use the expression [Engine.GetBookmarkPage("uniqueBookmarkTitle")]. The result in the combined report are pagenrs 0.

When I change the order of the .frx files, the bookmark on the page before the TOC page is seen, and is working fine. All other bookmarks aren't. It seems that the bookmarks are "forgotten/gone" after the command .prepare(true).

The bookmark is also working and succesfull found when I try to find the pagenumber of the bookmark on the same page in designermode. So I think the bookmarks are working, the expression to find the bookmarks also, but I think I forgot something to grab/remember the bookmarks from earlyer .frx pages.

Comments

  • edited March 2016
    [..]

    Still nobody knows what's going wrong here?

    For example:

    2 reports (.frx files), merged with the code below.
    Only the bookmark in the last prepared report works, other bookmarks are '0'

    Please help, this is customer 2 who want's a table of contents, and until now, it isn't working...

    Code in VB.NET:
            Dim myReport As New FastReport.Report
            myReport.Preview = Me.PreviewControl1
            myReport.Prepare()
    
            Try
                myReport.Load(IO.Path.Combine(myAppPath, "Tools.Rapportage\Inhoudsopgave.frx"))
                myReport.Prepare(True)
            Catch ex As Exception
                MsgBox("Voorblad: " & ex.Message)
            End Try
    
            Try
                myReport.Load(IO.Path.Combine(myAppPath, "Tools.Rapportage\Voorblad.frx"))
                myReport.Dictionary.Connections(0).ConnectionString = "data source='" & myTools.CurrentDatabase & "'"
                'Prepare
                myReport.Prepare(True)
            Catch ex As Exception
                MsgBox("Voorblad: " & ex.Message)
            End Try
    
            Try
                myReport.ShowPrepared()
            Catch ex As Exception
                MsgBox("Rapportage: " & ex.Message)
            End Try
    

    Textlabel for table-of-contents textobject:
    [Engine.GetBookmarkPage("hoofdstuk_voorblad")]
    
    [Engine.GetBookmarkPage("hoofdstuk_inhoudsopgave")]
    

    Bookmark names:
    "hoofdstuk_voorblad"
    
    "hoofdstuk_inhoudsopgave"
    

    Textobjects with [Page#] expression works fine in merged reports. I only want to build a table of contents.

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.