protected override void SetReportConfig(FaibClass.Common.Windows.Config.ReportConfig config)
{
base.SetReportConfig(config);
// 公司名稱
var lbl = config.Header.FindObject("Company");
if (lbl != null)
((FaibClass.Common.Windows.Report.ReportLabel)lbl).Text = ContextArgs.Instance.CompanyName;
// 操作員
lbl = config.Header.FindObject("Employee");
if (lbl != null)
{
var text = ((FaibClass.Common.Windows.Report.ReportLabel)lbl).Text;
((FaibClass.Common.Windows.Report.ReportLabel)lbl).Text = string.Format(text, ContextArgs.Instance.UserName);
}
}
透過 FindObject 依 Key 取得標籤物件,動態填入公司名、使用者名等執行期資訊。若報表需查詢,亦需建立對應 .pcs 配置檔。