文檔首頁>>FastReport中文文檔>>傳遞自定義 SQL
傳遞自定義 SQL
報告可能包含使用數(shù)據(jù)向?qū)Вㄍㄟ^ "數(shù)據(jù)|添加數(shù)據(jù)源... "菜單)添加的數(shù)據(jù)源。有時需要從應(yīng)用程序中向該數(shù)據(jù)源傳遞自定義 SQL。為此,請使用以下代碼:
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();
點擊復(fù)制
如需下載fastreport最新試用版,請點產(chǎn)品名跳轉(zhuǎn)產(chǎn)品下載頁>>