Search Results for

    Show / Hide Table of Contents

    TVirtualDataTable Class

    Base class for a table used on FlexCelReport. Inherit from this class and TVirtualDataTableState to create your custom sources of data. Make sure you read 'Appendix virtual datasets' in the Reports Developer Guide for more information.

    Syntax

    Unit: FlexCel.Report

    TVirtualDataTable = class(TFlexCelObject);

    Constructors

    Name Description
    Create Creates a new virtual datatable instance and assigns a name to it.

    Methods

    Name Description
    CreateState Creates a VirtualDataSetState to be used in a report. Make sure you override this method on your derived classes and point it to the correct VirtualDataSet descendant.
    FullDataSetColumn​Count Returns the columns in the table for a full dataset. Normally this is the same as ColumnCount but your implementation might choose to hide some of the fields available in the full ColumnCount when dumping all fields.
    If you change this method, you need also to review GetFullDataSetColumn so it returns the correct column for the dataset.
    GetFullDataSetColumn Maps a normal column to a Full Dataset column, in case you aren't outputting the same fields for full datasets as the fields available for a report. If you are outputting all the fields, then this returns Column.
    GetFullDataSetMapId Returns an id you can use to map a column name + * to something you can use in GetFullDataSetColumn
    GetColumn Returns a column identifier that you can later use on TVirtualData​Table​State.​Get​Value(​​Integer).
    Return -1 if the column does not exist, and make sure this search is case insensitive.
    GetColumnName Returns the column name for a column identifier. This method is the reverse of GetColumn
    GetColumnCaption Returns the column caption for a column identifier. This method is used on generic dataset to write the header column.
    For most uses, GetColumnName will be used.
    FilterData This method should return a new VirtualDataTable instance with the data filtered. If RowFilter is null, this method should return a copy of the dataset with a different name.
    Note that you might have the same data with different states, so this method might be called more than once.
    GetDistinct Override this method to return a new VirtualDataSet with unique values.
    Note that the returned dataset will not have all the columns this one has, only the ones defined on "filterFields"
    GetDetail Override this method if the table has linked tables that you can use for master detail relationships instead of normal relationships. This is the case for example in Entity Framework.
    GetRelationWith Override this method if the datatable has intrinsic relationships that you want to use.
    For example DataSets have DataRelationships, or Entity Framework tables are related as properties from the master to the detail. All those relationships that are not explicitly defined in the report should be returned here.
    Lookup Looks for a key on this dataset and returns the corresponding value.
    Note: Remember that VirtualDataSet is stateless, so if you use any caching here, make sure you appropiately lock() this method so there is no possibility of one thread reading the cache when the other is updating it.
    SupportingTable This method should return the underlying table used to access the data if there is one.
    This will normally return the same instance, but in TOPN and ATLEAST datasets it returns the table used to calculate them.

    Properties

    Name Description
    TableName Name for the virtual data table. Note that this name is *not* used anywhere in FlexCel code, except to report errors.
    The Table names that are used on reports are the ones in TVirtualData​Table​State
    Locale Locale for this dataset. This might be needed to create datatables with data and the same locale.
    ColumnCount Returns the number of columns of the table.
    CreatedBy Returns the table that created this one (by a filter, distinct, etc), or null if this table was not created from another VirtualDataTable.
    TempTable If true, this table must be destroyed by the framework.
    In This Article
    Back to top FlexCel Studio for VCL and FireMonkey v7.24
    © 2002 - 2025 tmssoftware.com