Search Results for

    Show / Hide Table of Contents

    FlexCelReport.LoadTable Event

    Fires whenever an undefined table is called, allowing to load your own datasets in demand to the report. For more control, you might use User Tables. Look at the example for more information.

    Syntax

    Namespace: FlexCel.Report

    public LoadTableEventHandler LoadTable

    Examples

    If you are running a report and don't know beforehand which tables it uses, you can use the following event:

        using (FlexCelReport flexcelReport = new FlexCelReport(true))
        {
            flexcelReport.LoadTable += (sender, e) =>
            {
                //Here GetTable is a method that returns the table to insert with our data.
                flexcelReport.AddTable(e.TableName, GetTable(e.TableName), TDisposeMode.DisposeAfterRun);
            };
    
            flexcelReport.Run("Template.xlsx", "Result.xlsx");
        }
    

    Instead of using fr.AddTable for all used tables before running the report. If you need tables on demand, you might also look at User Tables or Direct SQL.

    See also

    • FlexCelReport
    In This Article
    Back to top FlexCel Studio for the .NET Framework v7.24.0.0
    © 2002 - 2025 tmssoftware.com