stimulsoft Report報表使用筆記


1.使用設計器設計mrt報表模板,或者從其他文件復制修改

2.刪除business object 數據源

3.使用代碼添加數據源

ParcelChangeItem change = new ParcelChangeItem();
string filename = @"D:\worki\xxx信息.mrt";
Stimulsoft.Report.StiReport report = new StiReport();
report.Load(filename);
report.Dictionary.Clear();
report.RegBusinessObject("parcel", parcel);
report.Dictionary.SynchronizeBusinessObjects(1);
report.Dictionary.Synchronize();
report.Save(filename);

4.再綁定報表各字段,字段上右鍵,選設計。

5.使用

RegcardEx aa = new RegcardEx()
{
  ExIndex = "22",
  RegDate = "2015-9-9",
  RegType = "初始登記",
  RegContent = "aaaaa"
};
RegcardParcel parcel = new RegcardParcel()
{
  ParcelCode = "aaaaaa",
  IsAreaUnitSquaremeter = true, 
  OwnerName = "xt張三",
  CardExItem = aa
};
StiReport report = new StiReport();
report.Load(@"F:\stimulsoft報表\報表模板\土地登記卡.mrt");
report.RegBusinessObject("land", "Regcard", parcel);
report.Compile();
report.Render(true);
report.Show();

注意,定義的對象,類名,與報表里的名稱關鍵字不可以重名,否則報對象已存在錯誤。

其他類型使用待補充

 

列表及底部邊線

List<RegcardEx> cers = new List<RegcardEx>() {
new RegcardEx(){ExIndex = "22",RegDate = "2015-9-9",RegType = "初始登記",RegContent = "aaaaa" },
new RegcardEx(){ExIndex = "22",RegDate = "2015-9-9",RegType = "初始登記",RegContent = "aaaaa" },
new RegcardEx(){ExIndex = "22",RegDate = "2015-9-9",RegType = "初始登記",RegContent = "aaaaa" },
new RegcardEx(){ExIndex = "22",RegDate = "2015-9-9",RegType = "初始登記",RegContent = "aaaaa" },
};
StiReport report = new StiReport();
report.Load(@"F:\stimulsoft報表\報表模板\土地登記卡續表.mrt");
report.RegBusinessObject("land", "cardex", cers);
report.Compile();
report.Render(true);
report.Show();
}

 


免責聲明!

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



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