简单帐表插件开发示例分享
生活随笔
收集整理的這篇文章主要介紹了
简单帐表插件开发示例分享
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
public class DemoSysReport : SysReportBaseService
{
public override void Initialize()
{
// 支持分組匯總
this.ReportProperty.IsGroupSummary = true;
//this.ReportProperty.BillKeyFieldName = "FID";
this.ReportProperty.ReportName = new LocaleValue(Kingdee.BOS.Resource.ResManager.LoadKDString("銷售分組匯總報表","002460030014686",Kingdee.BOS.Resource.SubSystemType.BOS), this.Context.UserLocale.LCID);
//this.ReportProperty.GroupSummaryInfoData.DefaultGroupbyString = "fwname";
this.ReportProperty.DecimalControlFieldList = new List<DecimalControlField>();
// 標示famount用famount_decimal做精度格式化
this.ReportProperty.DecimalControlFieldList.Add(new DecimalControlField() { ByDecimalControlFieldName = "famount", DecimalControlFieldName = "famount_decimal" });
}public override void BuilderReportSqlAndTempTable(IRptParams filter, string tableName)
{
// 拼接sql
string sSQL = @"select b.fname as fwname,c.fcustid,d.fname as fcname,a.* ,f.famount,3 as famount_decimal,f.fprice, {0} into {1} from T_SAL_ORDERENTRY a
left join T_BD_MATERIAL_L b on a.fmaterialid=b.fmaterialid and b.FLOCALEID=2052
left join T_SAL_ORDER c on a.fid=c.fid
left join T_BD_CUSTOMER_L d on c.fcustid=d.fcustid and d.FLOCALEID=2052
left join T_SAL_ORDERENTRY_F f on a.fentryid=f.fentryid";
// 設置分頁排序
KSQL_SEQ = string.Format(KSQL_SEQ, "a.FID asc");
sSQL = string.Format(sSQL, this.KSQL_SEQ, tableName);DBUtils.Execute(this.Context, sSQL);
}public override ReportTitles GetReportTitles(IRptParams filter)
{
ReportTitles titles = new ReportTitles();
// TODO:從filter中獲取具體的固定過濾條件,設置到tilte中,用于報表條件展示
//titles.AddTitle("FText", "55555");
//titles.AddTitle("FLabel", "66666");
return titles;
}
/// <summary>
/// 設置匯總列信息
/// </summary>
/// <param name="filter"></param>
/// <returns></returns>
public override List<Core.Report.SummaryField> GetSummaryColumnInfo(IRptParams filter)
{
List<Core.Report.SummaryField> summarys = new List<Core.Report.SummaryField>();
summarys.Add(new Core.Report.SummaryField("FQty", Core.Enums.BOSEnums.Enu_SummaryType.SUM));
// 單價求平均
summarys.Add(new Core.Report.SummaryField("fprice", Core.Enums.BOSEnums.Enu_SummaryType.AVERAGE));
// 金額匯總
summarys.Add(new Core.Report.SummaryField("famount", Core.Enums.BOSEnums.Enu_SummaryType.SUM));
return summarys;
}
/// <summary>
/// 構建動態列
/// </summary>
/// <param name="filter"></param>
/// <returns></returns>
public override ReportHeader GetReportHeaders(IRptParams filter)
{
// TODO:fentryid,fid,fbaseunitqty,fmaterialid,fbomid,fqty
ReportHeader header = new ReportHeader();
header.AddChild("fwname", new LocaleValue(Kingdee.BOS.Resource.ResManager.LoadKDString("物料","002460030014689",Kingdee.BOS.Resource.SubSystemType.BOS), this.Context.UserLocale.LCID));
header.AddChild("fcustid", new LocaleValue(Kingdee.BOS.Resource.ResManager.LoadKDString("客戶","002460030014692",Kingdee.BOS.Resource.SubSystemType.BOS), this.Context.UserLocale.LCID));
header.AddChild("FQty", new LocaleValue(Kingdee.BOS.Resource.ResManager.LoadKDString("數量","002460030014695",Kingdee.BOS.Resource.SubSystemType.BOS), this.Context.UserLocale.LCID),SqlStorageType.SqlDecimal);
header.AddChild("fprice", new LocaleValue(Kingdee.BOS.Resource.ResManager.LoadKDString("單價","002460030014698",Kingdee.BOS.Resource.SubSystemType.BOS), this.Context.UserLocale.LCID), SqlStorageType.SqlDecimal);
header.AddChild("famount", new LocaleValue(Kingdee.BOS.Resource.ResManager.LoadKDString("金額","002460030014701",Kingdee.BOS.Resource.SubSystemType.BOS), this.Context.UserLocale.LCID), SqlStorageType.SqlDecimal);
return header;
}
}
轉載于:https://www.cnblogs.com/fyq891014/p/4188793.html
總結
以上是生活随笔為你收集整理的简单帐表插件开发示例分享的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: SQL Server数据库自增字段正确的
- 下一篇: android开发 eclipse al