K/3Cloud 分页报表示例参考
生活随笔
收集整理的這篇文章主要介紹了
K/3Cloud 分页报表示例参考
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
分頁報表首先需要實現的方法就是GetList,這個方法用來獲得分頁的條件。
其他的就和其他報表類似了。
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Kingdee.BOS.Core.Report.PlugIn; using Kingdee.BOS.Core.Report; using System.Data; using Kingdee.BOS.App.Data; using Kingdee.BOS.Contracts.Report; using Kingdee.BOS.Core.CommonFilter; using Kingdee.BOS.Util;namespace Kingdee.BOS.Demo.Report {public class DemoMoveReport : SysReportBaseService{public override void Initialize(){// 標記報表類型this.ReportProperty.ReportType = Core.Report.ReportType.REPORTTYPE_MOVE;this.ReportProperty.IsGroupSummary = true;}/// <summary>/// 構建分頁報表每個報表的臨時表/// 首先從分頁依據中拿到本次分頁的條件,就是當前頁報表的條件:this.CacheDataList[filter.CurrentPosition]/// 然后把條件拼裝到SQL中,例如b.FLocaleId= dr["FLocaleId"] 語言id=當前報表的語言id/// </summary>/// <param name="filter"></param>/// <param name="tableName"></param>public override void BuilderReportSqlAndTempTable(IRptParams filter, string tableName){DataRow dr = this.CacheDataList[filter.CurrentPosition];string sSQL = @"select a.fdeptid as FID, fname,ffullname as fdesc,FLocaleId,'BD_DEPARTMENT' as fformid, {0} into {1} from T_BD_DEPARTMENT a inner join T_BD_DEPARTMENT_l b on a.fdeptid=b.fdeptid where b.FLocaleId=" + dr["FLocaleId"].ToString();KSQL_SEQ = string.Format(KSQL_SEQ, "b.FLocaleId");sSQL = string.Format(sSQL, this.KSQL_SEQ, tableName);DBUtils.Execute(this.Context, sSQL);}public override List<Core.Report.SummaryField> GetSummaryColumnInfo(IRptParams filter){List<Core.Report.SummaryField> fls = new List<Core.Report.SummaryField>();Core.Report.SummaryField fs = new Core.Report.SummaryField("FLocaleId", Core.Enums.BOSEnums.Enu_SummaryType.SUM);fls.Add(fs);return fls;}/// <summary>/// 分頁報表必須實現的方法,此方法用于為報表提供分頁依據。/// 比如以下示例:分別按語言來對部門分類,也就是說每種語言一個報表,中文的是一個報表、英文的一個報表,繁體的一個/// </summary>/// <param name="filter"></param>/// <returns></returns>public override DataTable GetList(IRptParams filter){DataTable dt;string sSQL = "select FLocaleId from T_BD_DEPARTMENT_L group by FLocaleId";dt = DBUtils.ExecuteDataSet(this.Context, sSQL).Tables[0];return dt;}public override ReportTitles GetReportTitles(IRptParams filter){ReportTitles titles = new ReportTitles();if (CacheDataList == null){ DataTable dt = GetList(filter);if (dt != null && dt.Rows.Count > 0){//titles.AddTitle("FCondition", dt.Rows[0]["flocaleid"].ToString());return titles;}return null;}DataRow dr = this.CacheDataList[filter.CurrentPosition];//titles.AddTitle("FCondition", dr["flocaleid"].ToString());return titles;}public override ReportHeader GetReportHeaders(IRptParams filter){// TODO:ReportHeader header = new ReportHeader();header.AddChild("FID", new LocaleValue(Kingdee.BOS.Resource.ResManager.LoadKDString("編碼","002460030014674",Kingdee.BOS.Resource.SubSystemType.BOS), this.Context.UserLocale.LCID));header.AddChild("fname", new LocaleValue(Kingdee.BOS.Resource.ResManager.LoadKDString("全名","002460030014677",Kingdee.BOS.Resource.SubSystemType.BOS), this.Context.UserLocale.LCID));header.AddChild("fdesc", new LocaleValue(Kingdee.BOS.Resource.ResManager.LoadKDString("別名","002460030014680",Kingdee.BOS.Resource.SubSystemType.BOS), this.Context.UserLocale.LCID));header.AddChild("FLocaleId", new LocaleValue(Kingdee.BOS.Resource.ResManager.LoadKDString("類別","002460030014683",Kingdee.BOS.Resource.SubSystemType.BOS), this.Context.UserLocale.LCID),SqlStorageType.SqlInt);return header;}} }
轉載于:https://www.cnblogs.com/fyq891014/p/4188794.html
總結
以上是生活随笔為你收集整理的K/3Cloud 分页报表示例参考的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: IOS Core Animation A
- 下一篇: 问路和谷粉