程序中使用變量向fastreport傳值


 新建數據源

 

 

 

 輸入表名,編寫SQL語句。

 

 新建數據源時,使用SQL語句創建。變量使用@。

 

 C#程序中  添加對fastreport 的引用。

窗體添加previewControl 控件。

后台代碼

 Report report = new Report();

report.SetParameterValue("orgno", sfz);
report.SetParameterValue("sex", orgno);

string Path = System.Environment.CurrentDirectory + "/test.frx";
report.Load(Path);

report.Preview = previewControl1;
previewControl1.Report.RegisterData(dsa);//dsa  DataSet      查詢結果加載
report.GetDataSource(dsa.Tables[0].TableName).Enabled = true;
report.Prepare(); //准備
report.ShowPrepared(); //顯示 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM