我保存報告模板加載:Stimul報告:的BusinessObjects不被顯示報告
report.Save("C:\\kk.mrt");
然後我打開保存的報告,並指定其爲BusinessObjects
Dictionaries
StiReport rptLoad = new StiReport();
rptLoad.RegBusinessObject("Company", repository.GetAll<Company>());
rptLoad.Load("C:\\kk.mrt");
rptLoad.BusinessObjectsStore
包含註冊BusinessObjects
剛剛註冊(Watched
在RunTime
),但:
rptLoad.Show();
如果有
Bindings
(像:Components.Add(new StiText{Text="{Company.Name}"}
)包含在保存的報告:THEN打動了我:
error CS0103: The name 'Company' does not exist in the current context
否則,如果我沒有
Bindings
在保存的報告:THENrptLoad.Show();
將顯示報告,但沒有註冊Dictionaries
(當我在顯示報告後進入設計模式時,我看不到BusinessObjects
字典)。,如果我叫
rptLoad.Design();
前rptLoad.Show();
:THEN
報告顯示和Bindings
都OK,我可以在所示報告(在設計和預覽模式)看到BusinessObjects
。