Hiding tables / showing specific ones.


Is there any way to hide / show only certain tables in my database from the report designer?

I'm passing and ODBC connection to FR.NET and it's listing tables I shouldn't be allowing people to see.

I thought about making a dataset, but the data can be pretty large.

Thanks,

Anthony

Comments

  • edited 10:00PM
    Sorry, there is no way to hide some tables, if you pass a connection object. You may use a DataSet, there is no need to fill it with data - FastReport will automatically fill only tables that are needed in a report.
  • edited 10:00PM
    Can you explain how I'd do this?

    I can make an empty dataset, and pass it to FR, but then where will it get the data?
  • edited 10:00PM
    If you make a DataSet using Visual Studio, it will generate a DataAdapter for each table. FR will use it to fill a table.
  • edited 10:00PM
    AlexTZ wrote: »
    If you make a DataSet using Visual Studio, it will generate a DataAdapter for each table. FR will use it to fill a table.

    ah, ok, is this possible in code? - Starting with an odbcconnection, then what?
  • edited 10:00PM
    I think it's not suitable in your case. I will add an event that you can use to filter the tables.
  • edited 10:00PM
    AlexTZ wrote: »
    I think it's not suitable in your case. I will add an event that you can use to filter the tables.

    That sounds like a great solution! Thanks!
  • edited 10:00PM
    You will be able to do this in the next daily build (tomorrow):
    Config.DesignerSettings.FilterConnectionTables += DesignerSettings_FilterConnectionTables;
         
         private void DesignerSettings_FilterConnectionTables(object sender, FilterConnectionTablesEventArgs e)
         {
           if (e.TableName == "Table 1")
             e.Skip = true;
         }
    

Leave a Comment