Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Refresh of Table List in Report Designer - RB10.04 D6.2

edited October 2006 in General
Hi

All is working well with my ODAC plugin and the reports in general.

The one thing that eludes me however is how to refresh the list of
tables/views used in the Data tab. During report development you may decide
to create a view in the database which you then need in the report. Once
created you go to the data tab and click new and select the Wizard etc. but
you still get the list from when you first used the wizard on the data tab
for that session of report builder.

The only way around this is to save the report away and close the report
builder. When you restart it and go to the data tab you will then see the
new view you created.

Is there anyway I can influence that list so it refreshes the contents each
time.

regards
Andrew

Comments

  • edited October 2006
    Hi Andrew,

    The data tree can be refreshed by right clicking over it and selecting the
    "refresh" option. This can also be done in code by accessing the
    layoutmanager of the TppDesignerWindow. The following example shows how
    this can be done.

    http://www.digital-metaphors.com/tips/RefreshDataTreeInCode.zip

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2006
    Nico

    Interesting code.

    What I meant was the Query Wizard list of available tables. It appears to
    only get the list once for your report designer session. If I need to add a
    table or view in the database then I cannot see that table or view unless I
    exit the builder and go back in.

    regards





  • edited October 2006
    Hi Andrew,

    I apoligize, I misread your initial post.

    In order to refresh the data shown in DADE, you will need to clear the
    meta-data cache.

    ----------------------------------------
    Tech Tip: Clearing the Meta Data Cache
    ----------------------------------------

    There is a global meta data cache that the ReportBuilder uses to cache
    information about the available database tables and fields. You can clear
    the meta data cache using the following code.

    uses
    daMetaDataManager;

    begin
    gMetaDataManager.Clear;

    end;

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2006
    Nico

    Sorry to be a pain but how do I plug this in. Is there an event I can use to
    fire this.

    For instance is there an event for clicking on the Data Tab in the report
    designer?

    Almost there. Thanks for your patience.

    regards
    Andrew
  • edited October 2006
    > Sorry to be a pain but how do I plug this in. Is there an event I can use

    You could try calling it when the designer opens--would that work for you?
    --
    Ed Dressel
    Team DM
  • edited October 2006
    Hi Andrew,

    You could possibly use the TppDesigner.TabChange event. This fires when a
    user changes the tab (Data, Code, Design, Preview) in the designer.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2006
    Hi

    That did the trick. I placed it in TabChange


    // Reset the cache so new views/tables are visible
    If NewTab = 'Data' then gMetaDataManager.Clear;


This discussion has been closed.