Search Results for

    Show / Hide Table of Contents

    Passing custom SQL

    The report may contain data sources that are added using the Data Wizard (via "Data|Add Data Source..." menu). Sometimes it is needed to pass custom SQL to that data source from your application. To do this, use the following code:

    using FastReport.Data;
    report1.Load(...); 
    // do it after loading the report, before running it
    // find the table by its alias
    TableDataSource table = report1.GetDataSource("MyTable") as TableDataSource;
    table.SelectCommand = "new SQL text";
    report1.Show();
    
    Back to top © 1998-2025 Copyright Fast Reports Inc.